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.01k stars 197 forks source link

Crash at statup, on a pinephone pro linux phone (maybe keyring) #1849

Open henrythemouse opened 3 weeks ago

henrythemouse commented 3 weeks ago

I'm using debian trixie on a pinephone pro arm64 The UI will not start.

Running backintime --diagnostics

{
    "backintime": {
        "name": "Back In Time",
        "version": "1.5.2",
        "running-as-root": false,
        "latest-config-version": 6,
        "local-config-file": "/home/UsernameReplaced/.config/backintime/config",
        "local-config-file-found": false,
        "global-config-file": "/etc/backintime/config",
        "global-config-file-found": false,
        "started-from": "/usr/share/backintime/common",
        "user-callback": "/home/UsernameReplaced/.config/backintime/user-callback",
        "keyring-supported": true
    },
    "host-setup": {
        "OS": {
            "/etc/os-release": "Debian GNU/Linux trixie/sid",
            "/etc/debian_version": "trixie/sid\n"
        },
        "platform": "Linux-6.6-rockchip-aarch64-with-glibc2.39",
        "system": "Linux #1 SMP PREEMPT_DYNAMIC Thu Mar 28 14:41:17 UTC 2024",
        "display-system": "wayland",
        "locale": "C, UTF-8",
        "PATH": "/home/UsernameReplaced/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games",
        "RSYNC_OLD_ARGS": "(not set)",
        "RSYNC_PROTECT_ARGS": "(not set)"
    },
    "python-setup": {
        "python": "3.12.4 main Jul 15 2024 12:17:32 CPython GCC 13.3.0",
        "python-executable": "/usr/bin/python3",
        "python-executable-symlink": true,
        "python-executable-resolved": "/usr/bin/python3.12",
        "sys.path": [
            "/usr/share/backintime/qt/plugins",
            "/usr/share/backintime/common/plugins",
            "/usr/share/backintime/plugins",
            "/usr/share/backintime/common",
            "/usr/lib/python312.zip",
            "/usr/lib/python3.12",
            "/usr/lib/python3.12/lib-dynload",
            "/usr/local/lib/python3.12/dist-packages",
            "/usr/lib/python3/dist-packages"
        ],
        "qt": {
            "Version": "PyQt 6.7.1 / Qt 6.6.2",
            "Theme": "Adwaita",
            "Theme Search Paths": [
                "/home/UsernameReplaced/.local/share/icons",
                "/var/lib/flatpak/exports/share/icons",
                "/usr/share/icons",
                ":/icons"
            ],
            "Fallback Theme": "",
            "Fallback Search Paths": []
        }
    },
    "external-programs": {
        "rsync": {
            "version": "3.3.0",
            "protocol": "31.0",
            "capabilities": "file_bits: 64; inum_bits: 64; timestamp_bits: 64; long_int_bits: 64; socketpairs: True; symlinks: True; symtimes: True; hardlinks: True; hardlink_specials: True; hardlink_symlinks: True; IPv6: True; atimes: True; batchfiles: True; inplace: True; append: True; ACLs: True; xattrs: True; secluded_args: optional; iconv: True; prealloc: True; stop_at: True; crtimes: False",
            "optimizations": "SIMD_roll: False; asm_roll: False; openssl_crypto: True; asm_MD5: False",
            "checksum_list": "xxh128, xxh3, xxh64, md5, md4, sha1, none",
            "compress_list": "zstd, lz4, zlibx, zlib, none",
            "daemon_auth_list": "sha512, sha256, sha1, md5, md4"
        },
        "ssh": "OpenSSH_9.8p1 Debian-2, OpenSSL 3.2.2 4 Jun 2024",
        "sshfs": "3.7.3",
        "encfs": "(no encfs)",
        "shell": "/bin/bash",
        "shell-version": "GNU bash, version 5.2.21(1)-release (aarch64-unknown-linux-gnu)"
    }
}

Running backintime --debug

DEBUG: [common/backintime.py:613 argParse] Used argument(s): {'debug': True, 'quiet': False}
DEBUG: [common/backintime.py:614 argParse] Unknown argument(s): []
DEBUG: [common/backintime.py:513 startApp] backintime: {'name': 'Back In Time', 'version': '1.5.2', 'running-as-root': False}
DEBUG: [common/backintime.py:513 startApp] host-setup: {'OS': {'/etc/os-release': 'Debian GNU/Linux trixie/sid', '/etc/debian_version': 'trixie/sid\n'}}

Back In Time
Version: 1.5.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/configfile.py:591 Config.setCurrentProfile] Change current profile: 1=Main profile
DEBUG: [common/tools.py:225 initiate_translation] No language code. Use systems current locale.
DEBUG: [common/tools.py:274 set_lc_time_by_language_code] Try to set locale.LC_TIME to "en_US.UTF-8" based on language code "en".
DEBUG: [common/backintime.py:696 getConfig] config file: /home/mobian/.config/backintime/config
DEBUG: [common/backintime.py:697 getConfig] share path: /home/mobian/.local/share/backintime
DEBUG: [common/backintime.py:698 getConfig] profiles: 1=Main profile
DEBUG: [common/pluginmanager.py:247 PluginManager.load] Register plugin path /usr/share/backintime/plugins
DEBUG: [common/pluginmanager.py:253 PluginManager.load] Probing plugin usercallbackplugin.py
DEBUG: [common/pluginmanager.py:253 PluginManager.load] Probing plugin systrayiconplugin.py
DEBUG: [common/tools.py:853 is_Qt_working] Qt probing result: exit code 1
DEBUG: [common/tools.py:856 is_Qt_working] Qt probing stdout:

DEBUG: [common/tools.py:857 is_Qt_working] Qt probing errout:
DEBUG: [common/qt_probing.py:89 <module>] /usr/share/backintime/common/qt_probing.py started... Call args: ['/usr/share/backintime/common/qt_probing.py', '--debug']
DEBUG: [common/qt_probing.py:90 <module>] Display system: wayland
DEBUG: [common/qt_probing.py:91 <module>] XDG_RUNTIME_DIR=/run/user/1000
DEBUG: [common/qt_probing.py:92 <module>] XAUTHORITY=($XAUTHORITY is not set)
DEBUG: [common/qt_probing.py:93 <module>] QT_QPA_PLATFORM=wayland
DEBUG: [common/qt_probing.py:95 <module>] Current euid: 1000
DEBUG: [common/qt_probing.py:126 <module>] isSystemTrayAvailable for Qt: False
DEBUG: [common/qt_probing.py:131 <module>] /usr/share/backintime/common/qt_probing.py is terminating normally (exit code: 1)

DEBUG: [plugins/systrayiconplugin.py:80 init] No system tray available to show the BiT system tray icon
DEBUG: [common/pluginmanager.py:253 PluginManager.load] Probing plugin notifyplugin.py
DEBUG: [common/pluginmanager.py:268 PluginManager.load] Add plugin notifyplugin.py
DEBUG: [qt/qttools.py:284 createQApplication] QT QPA platform plugin: wayland
DEBUG: [qt/qttools.py:285 createQApplication] QT_QPA_PLATFORMTHEME=<not set>
DEBUG: [qt/qttools.py:290 createQApplication] QT_STYLE_OVERRIDE=<not set>
DEBUG: [qt/qttools.py:293 createQApplication] QT active style: fusion
DEBUG: [qt/qttools.py:294 createQApplication] QT fallback style: 
DEBUG: [qt/qttools.py:295 createQApplication] QT supported styles: ['Windows', 'Fusion']
DEBUG: [qt/qttools.py:296 createQApplication] themeSearchPaths: ['/home/mobian/.local/share/icons', '/var/lib/flatpak/exports/share/icons', '/usr/share/icons', ':/icons']
DEBUG: [qt/qttools.py:297 createQApplication] fallbackSearchPaths: []
DEBUG: [qt/qttools.py:302 createQApplication] Is SystemTray available: False
DEBUG: [qt/qttools.py:319 createQApplication] Trying to set App ID for non-privileged user
DEBUG: [qt/qttools.py:359 initiate_translator] No language code. Use systems current locale.
WARNING: [qt/qttools.py:367 initiate_translator] PyQt was not able to install a translator for language code "C". Deactivate translation and falling back to the source language (English).
DEBUG: [common/tools.py:274 set_lc_time_by_language_code] Try to set locale.LC_TIME to "C.UTF-8" based on language code "C".
DEBUG: [qt/icon.py:20 <module>] Checking if the current theme contains the BiT icon...
DEBUG: [qt/icon.py:36 <module>] Probing theme: ubuntu-mono-dark (activated as ubuntu-mono-dark)
DEBUG: [qt/icon.py:36 <module>] Probing theme: gnome (activated as gnome)
DEBUG: [qt/icon.py:32 <module>] Found an installed theme: gnome
Segmentation fault
buhtz commented 3 weeks ago

Hello Henry, a Pinephone!? Cool. )

Based on your comment and output it seems you have not even started the GUI but just the CLI.

Do you have a desktop environment on your Pinephone? Just look for "Back In Time" and click on it.

On terminal there is backintime-qt to start the GUI. The command backintime is just the CLI.

Does this help? Best Christian

henrythemouse commented 3 weeks ago

Thanks for the quick reply, Christian.

Nice catch. I did run diagnostics using the command line program. I just reran it using the gui command but other than one additional sys.path line the outputs are the same. Anyway, the new output is below. As far as the debug text output is concerned, I ran that using the qt program, but I labeled it incorrectly. So that output is still valid.

When I look at the debug output it seems that the segmentation occurs when trying to detect the theme. Looking at the diagnostics the fallback theme has an empty value. The pinephone is running gnome 46 with a custom shell (phosh). As you can see , PyQt generates a warning regarding the locale setting. I realize that these conditions may or may not point to any relevant problem. I am going to try to reset the locale based on the PyQt warning to see if that will help.

If I can provide any further information, please let me know.

backintime-qt --diagnostics
{
    "backintime": {
        "name": "Back In Time",
        "version": "1.5.2",
        "running-as-root": false,
        "latest-config-version": 6,
        "local-config-file": "/home/UsernameReplaced/.config/backintime/config",
        "local-config-file-found": false,
        "global-config-file": "/etc/backintime/config",
        "global-config-file-found": false,
        "started-from": "/usr/share/backintime/common",
        "user-callback": "/home/UsernameReplaced/.config/backintime/user-callback",
        "keyring-supported": true
    },
    "host-setup": {
        "OS": {
            "/etc/os-release": "Debian GNU/Linux trixie/sid",
            "/etc/debian_version": "trixie/sid\n"
        },
        "platform": "Linux-6.6-rockchip-aarch64-with-glibc2.39",
        "system": "Linux #1 SMP PREEMPT_DYNAMIC Thu Mar 28 14:41:17 UTC 2024",
        "display-system": "wayland",
        "locale": "C, UTF-8",
        "PATH": "/home/UsernameReplaced/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games",
        "RSYNC_OLD_ARGS": "(not set)",
        "RSYNC_PROTECT_ARGS": "(not set)"
    },
    "python-setup": {
        "python": "3.12.4 main Jul 15 2024 12:17:32 CPython GCC 13.3.0",
        "python-executable": "/usr/bin/python3",
        "python-executable-symlink": true,
        "python-executable-resolved": "/usr/bin/python3.12",
        "sys.path": [
            "/usr/share/backintime/qt/plugins",
            "/usr/share/backintime/common/plugins",
            "/usr/share/backintime/plugins",
            "/usr/share/backintime/common",
            "/usr/share/backintime/qt",
            "/usr/lib/python312.zip",
            "/usr/lib/python3.12",
            "/usr/lib/python3.12/lib-dynload",
            "/usr/local/lib/python3.12/dist-packages",
            "/usr/lib/python3/dist-packages"
        ],
        "qt": {
            "Version": "PyQt 6.7.1 / Qt 6.6.2",
            "Theme": "Adwaita",
            "Theme Search Paths": [
                "/home/UsernameReplaced/.local/share/icons",
                "/var/lib/flatpak/exports/share/icons",
                "/usr/share/icons",
                ":/icons"
            ],
            "Fallback Theme": "",
            "Fallback Search Paths": []
        }
    },
    "external-programs": {
        "rsync": {
            "version": "3.3.0",
            "protocol": "31.0",
            "capabilities": "file_bits: 64; inum_bits: 64; timestamp_bits: 64; long_int_bits: 64; socketpairs: True; symlinks: True; symtimes: True; hardlinks: True; hardlink_specials: True; hardlink_symlinks: True; IPv6: True; atimes: True; batchfiles: True; inplace: True; append: True; ACLs: True; xattrs: True; secluded_args: optional; iconv: True; prealloc: True; stop_at: True; crtimes: False",
            "optimizations": "SIMD_roll: False; asm_roll: False; openssl_crypto: True; asm_MD5: False",
            "checksum_list": "xxh128, xxh3, xxh64, md5, md4, sha1, none",
            "compress_list": "zstd, lz4, zlibx, zlib, none",
            "daemon_auth_list": "sha512, sha256, sha1, md5, md4"
        },
        "ssh": "OpenSSH_9.8p1 Debian-2, OpenSSL 3.2.2 4 Jun 2024",
        "sshfs": "3.7.3",
        "encfs": "(no encfs)",
        "shell": "/bin/bash",
        "shell-version": "GNU bash, version 5.2.21(1)-release (aarch64-unknown-linux-gnu)"
    }
}
buhtz commented 3 weeks ago

The warning about the language is not a problem. But I wonder why your local is set to "C" instead of "en_US" or something else. This might indicate that you are running BIT in an unusual environment.

What is the output of $ locale ?

henrythemouse commented 3 weeks ago

locale update:

Setting the locale to en_US.UTF-8 removed the Py-QT warning, but the segmentation fault still happens exactly as before.

DEBUG: [qt/icon.py:20 <module>] Checking if the current theme contains the BiT icon...
DEBUG: [qt/icon.py:36 <module>] Probing theme: ubuntu-mono-dark (activated as ubuntu-mono-dark)
DEBUG: [qt/icon.py:36 <module>] Probing theme: gnome (activated as gnome)
DEBUG: [qt/icon.py:32 <module>] Found an installed theme: gnome
Segmentation fault
locale
LANG=en_US.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
henrythemouse commented 2 weeks ago

I've done some more investigation.

My laptop uses the same OS ver as this phone. backintime-qt [ver1.5.2] starts and works fine on this laptop. Here is a comparison of the --dbug from the phone and then the laptop.

pinephonepro first --> laptop second:

DEBUG: [qt/icon.py:20 <module>] Checking if the current theme contains the BiT icon...
DEBUG: [qt/icon.py:36 <module>] Probing theme: ubuntu-mono-dark (activated as ubuntu-mono-dark)
DEBUG: [qt/icon.py:36 <module>] Probing theme: gnome (activated as gnome)
DEBUG: [qt/icon.py:32 <module>] Found an installed theme: gnome

** this is where backintime-qt crashes on the pinephone 
** the laptop has the same lines as above,  
** but does not crash and  continues as below  
** the folder python_keyring does not exist  on either device   

DEBUG: [common/tools.py:1271 keyringSupported] Keyring config file folder: /home/user/.config/python_keyring
DEBUG: [common/tools.py:1285 keyringSupported] Available keyring backends:
DEBUG: [common/tools.py:1288 keyringSupported] keyring.backends.libsecret.Keyring (priority: 4.8)
DEBUG: [common/tools.py:1288 keyringSupported] keyring.backends.chainer.ChainerBackend (priority: 10)

I'm wondering if this could be a gnome-keyring problem?

I've also tested backintime-qt [ver 1.2] on an older phone [debian 11] 2021 . It works fine, no problems at all.

Any ideas?

buhtz commented 2 weeks ago

Hello Henry, thank you very much for the analysis. Are you skilled in Python? Maybe you can add some debug-print-statements to get a better idea about the code location where the seg fault happens.

henrythemouse commented 2 weeks ago

I have medium level python skills. If you can give me a place to start I'd be willing to give it a try.

I've since discovered that if I provide a basic config file (copied from my laptop) and generate a ssh key pair the --debug goes quite a bit further. Eventually it segfaults after:

DEBUG: [common/tools.py:1342 keyringSupported] Found appropriate keyring 'keyring.backends.chainer'

** at this point on my phone I get "Segmentation fault"
** at this point on my laptop the following line is displayed
** and the UI is started

DEBUG: [common/config.py:1699 Config._cron_line] Profile: Main profile | Automatic backup: 0
buhtz commented 2 weeks ago

I would recommend to wait for Jürgen's (aryoda) feedback. He is more involved in keyring issues and I think your issues is related to it.