Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minimal diagnostics-info to --debug output #1664

Closed
buhtz opened this issue Mar 11, 2024 · 4 comments · Fixed by #1669 or #1703
Closed

Add minimal diagnostics-info to --debug output #1664

buhtz opened this issue Mar 11, 2024 · 4 comments · Fixed by #1669 or #1703
Labels
Discussion decision or consensus needed

Comments

@buhtz
Copy link
Member

buhtz commented Mar 11, 2024

I realized that BIT do not show it's version number in the --debug output. E.g. try backintime last-snapshot --debug.

Beside the version number I suggest that we could show a minimal diagnostic info based on our --diagnostics.

This is the current situation:

$ backintime last-snapshot --debug
DEBUG: [common/backintime.py:590 argParse] Arguments: {'debug': True, 'command': 'last-snapshot', 'func': <function lastSnapshot at 0xffff8880dee0>} | unknownArgs: []
DEBUG: [common/configfile.py:591 Config.setCurrentProfile] Change current profile: 1=Hauptprofil
DEBUG: [common/tools.py:225 initiate_translation] Language code "en".
DEBUG: [common/backintime.py:673 getConfig] config file: /home/user/.config/backintime/config
DEBUG: [common/backintime.py:674 getConfig] share path: /home/user/.local/share/backintime
DEBUG: [common/backintime.py:675 getConfig] profiles: 1=Main profile, 3=playwithme
DEBUG: [common/tools.py:1190 keyringSupported] Keyring config file folder: /home/user/.config/python_keyring
...

My proposed modification would be to use some entries from the result of --diagnostics. It would be

  • ['backintime']['name']
  • ['backintime']['version']
  • ['host-setup']['OS']

$ backintime last-snapshot --debug
DEBUG: [common/backintime.py:590 argParse] Arguments: {'debug': True, 'command': 'last-snapshot', 'func': <function lastSnapshot at 0xffff8880dee0>} | unknownArgs: []
DEBUG: [common/backintime.py: XYZ] Back In Time 1.4.4-dev.4da45e1f
DEBUG: [common/backintime.py: XYZ] Debian GNU/Linux 12 (bookworm); debian_version: 12.5
DEBUG: [common/configfile.py:591 Config.setCurrentProfile] Change current profile: 1=Hauptprofil
DEBUG: [common/tools.py:225 initiate_translation] Language code "en".
...
@buhtz buhtz added the Discussion decision or consensus needed label Mar 11, 2024
@buhtz buhtz added this to the Upcoming release (1.5.0) milestone Mar 11, 2024
@emtiu
Copy link
Member

emtiu commented Mar 11, 2024

Good idea. --debug implies that you want to output lots of information, so it makes sense to include more than is currently the case.

buhtz added a commit that referenced this issue Mar 15, 2024
The debug output now contains minimal diagnostic information about appliation name, version, if it runs as root and the operating system.

- Separated code from `collect_diagnostics()` into `collect_minimal_diagnostics()` which is then called in `common/backintime.py::startApp()` to build a debug message.
- Fixed an the user-callback unit tests introduced in #1658
- Minor refactoring and minor mods in README.md and CONTRIBUTING.md.

Fix #1664
Improve PR #1658
@wahnfred
Copy link

wahnfred commented Apr 24, 2024

Looks like there went something wrong:

  File "/home/glen/Software/backintime/qt/app.py", line 1993, in <module>
    cfg = backintime.startApp('backintime-qt')
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/glen/Software/backintime/common/backintime.py", line 512, in startApp
    f'{diag["backintime"]} {list(diag["host-setup"]["OS"].values())}')
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'values'

probably it should be

f'{diag["backintime"]} {list(diag["host-setup"].values())}')

@buhtz
Copy link
Member Author

buhtz commented Apr 24, 2024

Hello wahnfred,

Thank you for taking the time to report the bug and providing the
details. I appreciate your feedback, will investigate the issue,
and work on a solution to the best of my ability.

Best regards,

EDIT: Which OS do you use?

@wahnfred
Copy link

Hello buhtz,

After changing the line as written above, the output of

backintime --diagnostics

is:

QSettings::value: Empty key passed
{
    "backintime": {
        "name": "Back In Time",
        "version": "1.4.4-dev.",
        "running-as-root": false,
        "latest-config-version": 6,
        "local-config-file": "/home/UsernameReplaced/.config/backintime/config",
        "local-config-file-found": true,
        "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": "openSUSE Tumbleweed",
        "platform": "Linux-6.8.7-1-default-x86_64-with-glibc2.39",
        "system": "Linux #1 SMP PREEMPT_DYNAMIC Thu Apr 18 07:12:38 UTC 2024 (5c0cf23)",
        "display-system": "wayland",
        "locale": "de_DE, UTF-8",
        "PATH": "/home/UsernameReplaced/bin:/usr/local/bin:/usr/bin:/bin:/sbin:/usr/sbin:/home/UsernameReplaced/.platformio/penv/bin",
        "RSYNC_OLD_ARGS": "(not set)",
        "RSYNC_PROTECT_ARGS": "(not set)"
    },
    "python-setup": {
        "python": "3.11.8 main Feb 08 2024 08:03:16 CPython GCC",
        "python-executable": "/usr/bin/python3",
        "python-executable-symlink": true,
        "python-executable-resolved": "/usr/bin/python3.11",
        "sys.path": [
            "/usr/share/backintime/qt/plugins",
            "/usr/share/backintime/common/plugins",
            "/usr/share/backintime/plugins",
            "/usr/share/backintime/common",
            "/usr/lib64/python311.zip",
            "/usr/lib64/python3.11",
            "/usr/lib64/python3.11/lib-dynload",
            "/usr/lib64/python3.11/site-packages",
            "/usr/lib64/python3.11/site-packages/PIL",
            "/usr/lib64/python3.11/_import_failed",
            "/usr/lib/python3.11/site-packages"
        ],
        "qt": {
            "Version": "PyQt 6.7.0.dev2404081550 / Qt 6.7.0",
            "Theme": "breeze-dark",
            "Theme Search Paths": [
                "/home/UsernameReplaced/.local/share/icons",
                "/usr/share/icons",
                ":/icons"
            ],
            "Fallback Theme": "breeze",
            "Fallback Search Paths": []
        }
    },
    "external-programs": {
        "rsync": {
            "version": "3.2.7",
            "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": true,
                "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.6p1, OpenSSL 3.1.4 24 Oct 2023",
        "sshfs": "3.7.4a",
        "encfs": "1.9.5",
        "shell": "/bin/bash",
        "shell-version": "GNU bash, version 5.2.26(1)-release (x86_64-suse-linux)"
    }
}

Best Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion decision or consensus needed
Projects
None yet
3 participants