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

[suggestion] more meaningful error messages with 'dest=qubes-ssh//' #232

Open
t-gh-ctrl opened this issue Jan 24, 2025 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@t-gh-ctrl
Copy link

Currently the error messages are very generic and usually don't point to the cause of the error. Wyng users are "power users" so finding the cause of the error(s) is usually pretty easy - but maybe this could be improved?

Eg.

Using a destination qube that doesn't exist:

Wyng 0.8 beta release 20250121
Traceback (most recent call last):
  File "/usr/local/bin/wyng", line 5172, in <module>
    aset        = get_configs(options)    ; dest = aset.dest
                  ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/wyng", line 2242, in get_configs
    dest.detect_state(opts.dedup, ro=opts.action not in write_actions)
  File "/usr/local/bin/wyng", line 2508, in detect_state
    do_exec([cmd])
  File "/usr/local/bin/wyng", line 2855, in do_exec
    return close()[-1]
           ^^^^^^^
  File "/usr/local/bin/wyng", line 2844, in close
    raise SPr.CalledProcessError([x for x in rclist if x][0], commands)
subprocess.CalledProcessError: Command '[['/usr/bin/qvm-run', '--no-color-stderr', '--no-color-output', '--nogui', '--no-filter-escape-chars', '-p', 'vm-backup-blah', 'set -e\nmkdir -p /tmp/wyngrpc']]' returned non-zero exit status 2.

Or anything that makes reaching the ssh folder impossible (eg. wrong ssh user, wrong host, wrong path)

Wyng 0.8 beta release 20250121
Traceback (most recent call last):
  File "/usr/local/bin/wyng", line 5172, in <module>
    aset        = get_configs(options)    ; dest = aset.dest
                  ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/bin/wyng", line 2242, in get_configs
    dest.detect_state(opts.dedup, ro=opts.action not in write_actions)
  File "/usr/local/bin/wyng", line 2563, in detect_state
    if self.online and not self.dtmp or len(self.dtmp) != len(tmpprefix)+tmpdigits+3 \
                                        ^^^^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
@t-gh-ctrl t-gh-ctrl changed the title [suggestion] more meaninful error messages when using 'qubes-ssh' destination (eg. wrong dest qube, unreachable ssh host, ...) [suggestion] more meaningful error messages when using 'qubes-ssh' destination (eg. wrong dest qube, unreachable ssh host, ...) Jan 24, 2025
@t-gh-ctrl t-gh-ctrl changed the title [suggestion] more meaningful error messages when using 'qubes-ssh' destination (eg. wrong dest qube, unreachable ssh host, ...) [suggestion] more meaningful error messages with 'dest=qubes-ssh//' Jan 24, 2025
@tasket tasket added the enhancement New feature or request label Jan 24, 2025
@tasket
Copy link
Owner

tasket commented Jan 24, 2025

This is great feedback. Though in such cases you might use --debug if you're curious. I know that's not a general solution, but it can display more info about failed subprocesses if you have the stomach for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants