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

MacOS: python error without ~/.xpra/xpra.conf defining ssh=ssh #4498

Open
deenoCO opened this issue Feb 9, 2025 · 1 comment
Open

MacOS: python error without ~/.xpra/xpra.conf defining ssh=ssh #4498

deenoCO opened this issue Feb 9, 2025 · 1 comment
Labels
bug Something isn't working macos packaging

Comments

@deenoCO
Copy link

deenoCO commented Feb 9, 2025

Attaching from MacOS (version: Version 15.3 (24D60)) to a remote xpra instance (running on ubuntu linux 14.10 if that matter), when ~/.xpra/xpra.conf does not define ssh=ssh, the following errors

$ xpra attach ssh://tdj.minitu./:63  --swap-keys=no --keyboard-sync=no --keyboard-raw=no
grep: /usr/share/locale/locale.alias: No such file or directory
grep: /usr/share/locale/locale.alias: No such file or directory

2025-02-09 12:54:42,065 Xpra GTK3 client version 6.2.3-r0
2025-02-09 12:54:42,080  running on Mac OS X 15.3
2025-02-09 12:54:42,080  cpython 3.11
grep: /usr/share/locale/locale.alias: No such file or directory
2025-02-09 12:54:42,394 GStreamer version 1.24.9
2025-02-09 12:54:42,419 created unix domain sockets:
2025-02-09 12:54:42,419  '/Users/dcj/.xpra/clients/highdesert-64305'
2025-02-09 12:54:42,606 removing unix domain socket '/Users/dcj/.xpra/clients/highdesert-64305'
xpra main error:
Traceback (most recent call last):
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 141, in main
    return run_mode(script_file, cmdline, error_handler, options, args, mode, defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 515, in run_mode
    return do_run_mode(script_file, cmdline, error_cb, options, args, full_mode, defaults)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 615, in do_run_mode
    return run_client(script_file, cmdline, error_cb, options, args, mode)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 1501, in run_client
    app = get_client_app(cmdline, error_cb, opts, extra_args, mode)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 1710, in get_client_app
    display_desc = do_pick_display(dotxpra, error_cb, opts, extra_args, cmdline)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/main.py", line 1029, in do_pick_display
    return parse_display_name(error_cb, opts, extra_args[0], cmdline, find_session_by_name=find_session_by_name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/parsing.py", line 537, in parse_display_name
    ssh_desc = get_ssh_display_attributes(args, opts.ssh)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/parsing.py", line 654, in get_ssh_display_attributes
    ssh = parse_ssh_option(ssh_option)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Applications/Xpra.app/Contents/Resources/lib/python/xpra/scripts/parsing.py", line 637, in parse_ssh_option
    import paramiko
  File "/Applications/Xpra.app/Contents/Resources/lib/python/paramiko/__init__.py", line 22, in <module>
    from paramiko.transport import (
  File "/Applications/Xpra.app/Contents/Resources/lib/python/paramiko/transport.py", line 33, in <module>
    from cryptography.hazmat.primitives.ciphers import (
  File "cryptography/hazmat/primitives/ciphers/__init__.pyc", line 11, in <module>
  File "cryptography/hazmat/primitives/ciphers/base.pyc", line 10, in <module>
  File "cryptography/hazmat/bindings/_rust.pyc", line 13, in <module>
  File "cryptography/hazmat/bindings/_rust.pyc", line 9, in __load
  File "imp.pyc", line 343, in load_dynamic
RuntimeError: OpenSSL 3.0's legacy provider failed to load. This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY. If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.

with configuration file with just that one line, attach works with no issues.

xpra run from command line: xpra attach ssh://tdj.minitu./:63 --swap-keys=no --keyboard-sync=no --keyboard-raw=no

both macos & linux with same xpra version: xpra v6.2.3-r0

@deenoCO deenoCO added the bug Something isn't working label Feb 9, 2025
@totaam
Copy link
Collaborator

totaam commented Feb 10, 2025

TIL:

RuntimeError: OpenSSL 3.0's legacy provider failed to load.
This is a fatal error by default, but cryptography supports running without legacy algorithms by setting the environment variable CRYPTOGRAPHY_OPENSSL_NO_LEGACY.
If you did not expect this error, you have likely made a mistake with your OpenSSL configuration.

We do set it:

if os.environ.get("CRYPTOGRAPHY_OPENSSL_NO_LEGACY") is None:
os.environ["CRYPTOGRAPHY_OPENSSL_NO_LEGACY"] = "1"

And this is called very early by the xpra wrapper script:

xpra/fs/bin/xpra

Lines 15 to 20 in 528960f

from xpra.platform import init, set_default_name
set_default_name("Xpra")
init()
from xpra.scripts.main import main
sys.exit(main(sys.argv[0], sys.argv))

Long before getting to the parse_ssh_option function.

Can you have a look at your xpra script to make sure it is correct? Try:

$ cat `which xpra`

BTW, this must be a typo: running on ubuntu linux 14.10 as you can't run xpra v5 or later on Ubuntu 14.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macos packaging
Projects
None yet
Development

No branches or pull requests

2 participants