Bug 2188385

Summary: [abrt] rdiff-backup: __init__(): repository.py:70:__init__:AttributeError: 'NoneType' object has no attribute 'append_path'
Product: [Fedora] Fedora Reporter: Solomon Peachy <pizza>
Component: rdiff-backupAssignee: Frank Crawford <frank>
Status: RELEASE_PENDING --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 38CC: frank, kevin, pizza
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:4ef912f57e800941a22e2870467115cebb1be9f9;VARIANT_ID=workstation;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: open_fds
none
File: environ
none
File: cpuinfo
none
File: namespaces
none
File: os_info
none
File: backtrace
none
File: mountinfo none

Description Solomon Peachy 2023-04-20 15:00:17 UTC
Version-Release number of selected component:
rdiff-backup-2.2.4-2.fc38

Additional info:
reporter:       libreport-2.17.9
cmdline:        /usr/bin/python3 /bin/rdiff-backup --new backup /etc backup.shaftnet.org::flapjack/etc
exception_type: AttributeError
type:           Python3
interpreter:    python3-3.11.2-1.fc38.x86_64
cgroup:         0::/system.slice/crond.service
runlevel:       N 5
package:        rdiff-backup-2.2.4-2.fc38
executable:     /bin/rdiff-backup
kernel:         6.2.11-300.fc38.x86_64
reason:         repository.py:70:__init__:AttributeError: 'NoneType' object has no attribute 'append_path'
crash_function: __init__
uid:            0

Truncated backtrace:
repository.py:70:__init__:AttributeError: 'NoneType' object has no attribute 'append_path'

Traceback (most recent call last):
  File "/bin/rdiff-backup", line 33, in <module>
    sys.exit(load_entry_point('rdiff-backup==2.2.4', 'console_scripts', 'rdiff-backup')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/rdiffbackup/run.py", line 37, in main
    sys.exit(main_run(sys.argv[1:]))
             ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/rdiffbackup/run.py", line 85, in main_run
    with action.connect() as conn_act:
         ^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/rdiffbackup/actions/backup.py", line 63, in connect
    self.repo = repository.Repo(
                ^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/site-packages/rdiffbackup/locations/repository.py", line 70, in __init__
    self.data_dir = self.base_dir.append_path(b"rdiff-backup-data")
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'append_path'

Local variables in innermost frame:
self: <rdiffbackup.locations.repository.Repo object at 0x7fa92a13d250>
base_dir: None
force: False
must_be_writable: True
must_exist: False
create_full_path: False
can_be_sub_path: False
__class__: <class 'rdiffbackup.locations.repository.Repo'>

Comment 1 Solomon Peachy 2023-04-20 15:00:20 UTC
Created attachment 1958590 [details]
File: open_fds

Comment 2 Solomon Peachy 2023-04-20 15:00:21 UTC
Created attachment 1958591 [details]
File: environ

Comment 3 Solomon Peachy 2023-04-20 15:00:22 UTC
Created attachment 1958592 [details]
File: cpuinfo

Comment 4 Solomon Peachy 2023-04-20 15:00:24 UTC
Created attachment 1958593 [details]
File: namespaces

Comment 5 Solomon Peachy 2023-04-20 15:00:25 UTC
Created attachment 1958594 [details]
File: os_info

Comment 6 Solomon Peachy 2023-04-20 15:00:26 UTC
Created attachment 1958595 [details]
File: backtrace

Comment 7 Solomon Peachy 2023-04-20 15:00:28 UTC
Created attachment 1958596 [details]
File: mountinfo

Comment 8 Frank Crawford 2023-04-22 11:13:45 UTC
@pizza Do you have any additional information on this failure?

Firstly, has this been working before, and is now failing?
Was it working under a previous version of rdiff-backup or Fedora?
Can you connect to the remote host with the user listed?
Is rdiff-backup installed on the remote machine?
Does the directory you are backing up to exist, and is it writeable?
Is there any other information you can supply?

Finally are you able to run the backup with a higher level of verbosity, e.g. -v5 or even -v9?

Comment 9 Solomon Peachy 2023-04-23 17:07:29 UTC
I recently upgraded the system from up-to-date F37 to F38 beta (now final).  It was working fine prior to the upgrade, and seems to work if I kick off the backup run manually (normally it's executed by cron)

...I saw this error pop up in abrt, presumably due to it failing in a cron-invoked run, so I reported it thinking it had to do with the F38 upgrade.

The server is running up-to-date F37.

Unless a transient network connectivity failure can result in the error that was reported, I'm at a loss as to its cause.

Comment 10 Frank Crawford 2023-04-24 00:47:46 UTC
Thanks for the additional information.

Does it seem to be running fine from cron since then, or does it still come up with failures?

My test setup which has f37 for the server and has an f38 client is working fine, so it is not a generic issue, but obviously something did upset it there, and we want to get to the bottom of it.

If you don't have any more info, I'll take it up stream and see if they can suggest what may have caused it.  Normally they respond pretty quickly.

If it does become more of a problem for you, I'll dig into it a bit more myself.

Comment 11 Frank Crawford 2023-04-24 12:36:11 UTC
Submitted upstream issue #868 (https://github.com/rdiff-backup/rdiff-backup/issues/868)

Comment 12 Solomon Peachy 2023-04-24 20:20:31 UTC
At this point it seems to be running okay, manually and via cron alike.

I don't know if there is anything for upstream can do, short of perhaps trapping these exceptions and reporting a more user-friendly error message.

Comment 13 Frank Crawford 2023-04-25 04:20:47 UTC
Solomon,

An interesting response from upstream, and primarily they agree that trapping it and generating a better message will be looked at.

The actual response from Eric L:

> Actually, it might very much have been a network issue, I did a very simple test and get the following error:
> 
> $ rdiff-backup backup . doesnotexist::/tmp/bak
> ssh: Could not resolve hostname doesnotexist: Name or service not known
> ERROR: Couldn't start up the remote connection by executing 'ssh -C doesnotexist rdiff-backup --terminal-verbosity 3 --server'
> due to exception 'Truncated header <b''> (problem probably originated remotely)'.
> 
> Remember that, under the default settings, rdiff-backup must be
> installed in the PATH on the remote system.  See the man page for more
> information on this.  This message may also be displayed if the remote
> version of rdiff-backup is quite different from the local version (2.2.4)
> 
> Traceback (most recent call last):
>   File "/usr/bin/rdiff-backup", line 33, in <module>
>     sys.exit(load_entry_point('rdiff-backup==2.2.4', 'console_scripts', 'rdiff-backup')())
>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib64/python3.11/site-packages/rdiffbackup/run.py", line 37, in main
>     sys.exit(main_run(sys.argv[1:]))
>              ^^^^^^^^^^^^^^^^^^^^^^
>   File "/usr/lib64/python3.11/site-packages/rdiffbackup/run.py", line 85, in main_run
>     with action.connect() as conn_act:
>          ^^^^^^^^^^^^^^^^
>   File "/usr/lib64/python3.11/site-packages/rdiffbackup/actions/backup.py", line 63, in connect
>     self.repo = repository.Repo(
>                 ^^^^^^^^^^^^^^^^
>   File "/usr/lib64/python3.11/site-packages/rdiffbackup/locations/repository.py", line 70, in __init__
>     self.data_dir = self.base_dir.append_path(b"rdiff-backup-data")
>                     ^^^^^^^^^^^^^^^^^^^^^^^^^
> AttributeError: 'NoneType' object has no attribute 'append_path'
> Still, I don't quite understand the final traceback and we should get rid of it to fail more gracefully, but that should be simple enough.

Is there anything else we can do here, or should I just close this request?

Comment 14 Frank Crawford 2023-07-08 03:32:17 UTC
Upstream has improved the test and messaging and it will be available in the next release of rdiff-backup.