bit-team / backintime

Back In Time - An easy-to-use backup tool for GNU Linux using rsync in the back
https://backintime.readthedocs.io
GNU General Public License v2.0
2.02k stars 198 forks source link

After finishing and quitting python3 activity still running #1209

Open wolftune opened 2 years ago

wolftune commented 2 years ago

On Ubuntu based system w/ BIT 1.3.1

I can run backups, get to done, quit the GUI, and then two backintime-related entries persist in System Activity: encfs (user owned) and a Python process (root owned).

wolftune commented 2 years ago

Update, I ran backintime-qt in command line, same error. When I choose "quite" in the GUI, nothing showed in the command line. When I did ctrl-C, I got a traceback

INFO: Lock
INFO: Take a new snapshot. Profile: 2 main2
INFO: Call rsync to take the snapshot
INFO: Save config file
INFO: Save permissions
INFO: Create info file
INFO: Unlock

^CException ignored in: <module 'threading' from '/usr/lib/python3.8/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.8/threading.py", line 1388, in _shutdown
    lock.acquire()
KeyboardInterrupt:

And even then, a python3 activity remained listed under root within System Activity, and I had to sudo kill -9 to stop it

buhtz commented 1 year ago

Tag: Qt

emtiu commented 1 year ago

Hi @wolftune, if you're still running backintime and still encountering this problem: Could you post the console output again, this time running backintime-qt --debug?

wolftune commented 1 year ago
DEBUG: [common/backintime.py:583 argParse] Arguments: {'debug': True} | unknownArgs: []

Back In Time
Version: 1.3.2

Back In Time comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions; type `backintime --license' for details.

DEBUG: [common/backintime.py:670 getConfig] config file: /home/aaron/.config/backintime/config
DEBUG: [common/backintime.py:671 getConfig] share path: /home/aaron/.local/share/backintime
DEBUG: [common/backintime.py:672 getConfig] profiles: 1=Main profile, 2=main2, 3=offsite-backup
DEBUG: [common/pluginmanager.py:90 PluginManager.load] Register plugin path /usr/share/backintime/plugins
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin notifyplugin.py
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin qt4plugin.py
Traceback (most recent call last):
  File "/usr/share/backintime/qt/app.py", line 1607, in <module>
    mainWindow = MainWindow(cfg, appInstance, qapp)
  File "/usr/share/backintime/qt/app.py", line 485, in __init__
    hash_id = mnt.mount()
  File "/usr/share/backintime/common/mount.py", line 134, in mount
    return backend.mount(check = check)
  File "/usr/share/backintime/common/mount.py", line 408, in mount
    self.createMountStructure()
  File "/usr/share/backintime/common/mount.py", line 654, in createMountStructure
    tools.mkdir(self.currentMountpoint, 0o700, False)
  File "/usr/share/backintime/common/tools.py", line 312, in mkdir
    os.mkdir(path, mode)
FileExistsError: [Errno 17] File exists: '/home/aaron/.local/share/backintime/mnt/A588EEE/mountpoint'

This might have something to do with something weird with my mountpoint setup, dunno. Okay, yeah, I see the ghost thing in Dolphin still, something weird there. I'll get that cleared and then revisit this after logging out and in.

I do recall something before where the problem was that a status of something would make BiT crash, and when I added some ignore (which I didn't want backed up anyway, something that was like BiT's own config or temp area) the crashing ended. Then, it was less of a problem for BiT process to linger because having it linger didn't block me from opening it again (unlike the current status).

wolftune commented 1 year ago

Okay, I tried after restarting and with a drive that successfully and fully unmounted afterwards.

I still have backintime running after quitting the GUI. Two processes showed "backintime-qt" and "python3" from /usr/bin/python3 -Es /usr/share/backintime/qt/serviceHelper.py (double instances, one user one root)

If I force the user instance of python3 process to close, backintime-qt stops too. Not so the other way around.

No errors in the debugging (the only error is in the drive missing)

DEBUG: [common/backintime.py:670 getConfig] config file: /home/aaron/.config/backintime/config
DEBUG: [common/backintime.py:671 getConfig] share path: /home/aaron/.local/share/backintime
DEBUG: [common/backintime.py:672 getConfig] profiles: 1=Main profile, 2=main2, 3=offsite-backup
DEBUG: [common/pluginmanager.py:90 PluginManager.load] Register plugin path /usr/share/backintime/plugins
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin notifyplugin.py
DEBUG: [common/pluginmanager.py:106 PluginManager.load] Add plugin qt4plugin.py
DEBUG: [common/mount.py:680 EncFS_mount.mountProcessLockAcquire] Acquire mountprocess lock /home/aaron/.local/share/backintime/mnt/17394.lock
DEBUG: [common/mount.py:574 EncFS_mount.checkFuse] Check fuse
DEBUG: [common/tools.py:829 keyringSupported] No appropriate keyring found. 'keyring.backends.chainer' can't be used with BackInTime
DEBUG: [common/tools.py:829 keyringSupported] No appropriate keyring found. 'keyring.backends.chainer' can't be used with BackInTime
DEBUG: [common/encfstools.py:64 EncFS_mount._mount] Provide password through temp FIFO
DEBUG: [common/encfstools.py:130 EncFS_mount.isConfigured] No encfs config in /media/aaron/backintime-t450s/back-in-time/.encfs6.xml
DEBUG: [common/mount.py:692 EncFS_mount.mountProcessLockRelease] Release mountprocess lock /home/aaron/.local/share/backintime/mnt/17394.lock
ERROR: [common/config.py:1357 Config.canBackup] /home/aaron/.local/share/backintime/mnt/1_17394/backintime/aaron-ThinkPad-T450s/aaron/1 does not exist
DEBUG: [common/tools.py:1237 readCrontab] Read 2 lines from users crontab
DEBUG: [common/config.py:1466 Config.removeOldCrontab] Clearing system Back In Time entries
DEBUG: [common/config.py:1500 Config.cronLine] Profile: Main profile | Automatic backup: Disabled
DEBUG: [common/config.py:1500 Config.cronLine] Profile: main2 | Automatic backup: Disabled
DEBUG: [common/config.py:1500 Config.cronLine] Profile: offsite-backup | Automatic backup: Disabled
DEBUG: [common/config.py:1450 setupCron] Crontab didn't change. Skip writing.

I noticed that when I closed the GUI debug version, nothing showed in the CLI at all. It's as though the GUI closing is just doing nothing. The processes only stopped at all after I did ctrl-C in the terminal.

emtiu commented 1 year ago

Thanks a lot for the debug info! We'll see if we can get this reproduced.

aryoda commented 1 year ago

One of the permanently running BiT processes works as designed:

> ps aux | grep -i backintime
root        2473  0.0  0.0  70552 22032 ?        S    Nov08   0:00 /usr/bin/python3 -Es /usr/share/backintime/qt/serviceHelper.py

BiT installs a D-Bus listener to change udev rules and this is contained in the serviceHelper.py (a root daemon).

Why the GUI doesn't quit or is still running in the background I cannot figure out but when I start the GUI (non-root) and just quit it without doing anything else I can see more debug output (with the newest version at master branch) so something seems to block in your case.

Here is the missing debug output when quitting (as said: I use Git HEAD of master so the output may look different to yours):

... (omitted) ...
DEBUG: [common/config.py:1489 setupCron] Crontab didn't change. Skip writing.
DEBUG: [common/tools.py:862 keyringSupported] Available keyring backends:
DEBUG: [common/tools.py:865 keyringSupported] keyring.backends.chainer.ChainerBackend (priority: 10)
DEBUG: [common/tools.py:865 keyringSupported] keyring.backends.kwallet.DBusKeyring (priority: 4.9)
DEBUG: [common/tools.py:865 keyringSupported] keyring.backends.fail.Keyring (priority: 0)
DEBUG: [common/tools.py:865 keyringSupported] keyring.backends.SecretService.Keyring (priority: 5)
DEBUG: [common/tools.py:878 keyringSupported] Metaclass keyring.backends.Gnome.Keyring not found: AttributeError("module 'keyring.backends' has no attribute 'Gnome'")
DEBUG: [common/tools.py:880 keyringSupported] Metaclass keyring.backends.kwallet.Keyring not found: AttributeError("module 'keyring.backends.kwallet' has no attribute 'Keyring'")
DEBUG: [common/tools.py:884 keyringSupported] Metaclass keyring.backend.SecretServiceKeyring not found: AttributeError("module 'keyring.backend' has no attribute 'SecretServiceKeyring'")
DEBUG: [common/tools.py:886 keyringSupported] Metaclass keyring.backend.GnomeKeyring not found: AttributeError("module 'keyring.backend' has no attribute 'GnomeKeyring'")
DEBUG: [common/tools.py:888 keyringSupported] Metaclass keyring.backend.KDEKWallet not found: AttributeError("module 'keyring.backend' has no attribute 'KDEKWallet'")
DEBUG: [common/tools.py:899 keyringSupported] Available supported backends: [<class 'keyring.backends.SecretService.Keyring'>, <class 'keyring.backends.kwallet.DBusKeyring'>]
DEBUG: [common/tools.py:902 keyringSupported] Found appropriate keyring 'keyring.backends.kwallet'
DEBUG: [common/mount.py:73 Mount.__init__] pw-cache is not running
DEBUG: [common/mount.py:81 Mount.__init__] Call command: /home/username/dev/backintime/common/backintime pw-cache start
DEBUG: [plugins/usercallbackplugin.py:80 UserCallbackPlugin.callback] Call user-callback: /home/username/.config/backintime/user-callback 1 Main profile 8
DEBUG: [plugins/usercallbackplugin.py:80 UserCallbackPlugin.callback] Call user-callback: /home/username/.config/backintime/user-callback 1 Main profile 6

Are you

wolftune commented 1 year ago

I have indeed been using encfs for one of my backup drives, but the pass is something I enter when starting BiT

aryoda commented 1 year ago

I have indeed been using encfs for one of my backup drives, but the pass is something I enter when starting BiT

Is your main config using the encfs drive?

And which password do you mean? Are you starting BiT as root (I thought no), is it a password to open a keyring/password safe or some automount thing of dolphin?

I saw this in your debug output which is IMHO a hint for BiT asking for the encfs password:

DEBUG: [common/encfstools.py:64 EncFS_mount._mount] Provide password through temp FIFO

wolftune commented 1 year ago

My main config uses the encfs drive

I am not starting BiT as root. The pass I enter is what I used with an older GPG key, and I never use it anymore in any other context.