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

Proxy cannot establish connection: 'SocketProtocol' object has no attribute 'encryption' #3937

Closed
goekce opened this issue Jul 25, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@goekce
Copy link
Contributor

goekce commented Jul 25, 2023

Using proxy according to the example in the proxy-server docs leads to an error. The client waits in the loop afterwards.

Steps to reproduce the behavior:

  1. server: xpra start
  2. server: xpra proxy :20 --tcp-auth=allow --bind-tcp=0.0.0.0:14501 --daemon=no
  3. client: xpra attach tcp://SERVER_ADDR:14501
  • ArchLinux
  • version (server & client): latest (g27b450d87)

The client logs look typical. Only problem: it waits for the session to be established.

Server logs:

2023-07-25 12:25:05,988 created tcp socket '0.0.0.0:14501'
2023-07-25 12:25:05,989 no uinput module (not usually needed)
2023-07-25 12:25:06,098 serving html content from '/usr/share/xpra/www'
2023-07-25 12:25:06,099 wrote pid 124326 to '/run/user/1000/xpra/20/server.pid'
2023-07-25 12:25:06,132 Warning: socket directory '/run/xpra'
2023-07-25 12:25:06,132  expected permissions 775 but found 777
2023-07-25 12:25:06,134 created unix domain socket '/run/user/1000/xpra/20/socket'
2023-07-25 12:25:06,154 Warning: cannot watch for application menu changes without pyinotify:
2023-07-25 12:25:06,154  No module named 'pyinotify'
2023-07-25 12:25:06,161 Warning: cannot load menu data                              
2023-07-25 12:25:06,161  No module named 'xdg'                                
2023-07-25 12:25:06,164 xpra is ready.             
2023-07-25 12:25:11,828 python-zeroconf: '::' IPv6 loopback address is not supported
2023-07-25 12:25:13,444 xpra proxy server version 5.0-r33870 (g27b450d87) beta
2023-07-25 12:25:13,468  uid=1000 (u), gid=1000 (u)
2023-07-25 12:25:13,468  running with pid 124326 on Linux Arch rolling n/a
2023-07-25 12:25:23,277 New tcp connection received                          
2023-07-25 12:25:23,277  from '10.10.10.10:52928'                                        
2023-07-25 12:25:23,277  on '0.0.0.0:14501'              
2023-07-25 12:25:23,280 Authentication required by allow authenticator module      
2023-07-25 12:25:23,281  sending challenge using 'hmac+sha512' digest over tcp connection
2023-07-25 12:25:23,418 started proxy instance pid 124387                          
2023-07-25 12:25:23,418  for client tcp socket: 10.10.20.20:14501 <- 10.10.10.10:52928
2023-07-25 12:25:23,418  and server socket socket:  <- /run/user/1000/xpra/0/socket
2023-07-25 12:25:23,420 proxy instance now also available using unix domain socket:
2023-07-25 12:25:23,420  /run/user/1000/xpra/SERVER-proxy-124387
2023-07-25 12:25:23,458 proxy video encoders: none
Process tcp socket: 10.10.20.20:14501 <- 10.10.10.10:52928:
Traceback (most recent call last):                      
  File "/usr/lib/python3.11/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.11/site-packages/xpra/server/proxy/proxy_instance_process.py", line 170, in run
    ProxyInstance.run(self)        
  File "/usr/lib/python3.11/site-packages/xpra/server/proxy/proxy_instance.py", line 128, in run
    self.send_hello()
  File "/usr/lib/python3.11/site-packages/xpra/server/proxy/proxy_instance.py", line 239, in send_hello
    hello = self.filter_client_caps(self.caps)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/xpra/server/proxy/proxy_instance.py", line 272, in filter_client_caps
    fc = self.filter_caps(caps, remove, self.server_protocol)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/xpra/server/proxy/proxy_instance.py", line 301, in filter_caps
    ncaps.update(proto_crypto_caps(proto))
                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/xpra/server/server_core.py", line 150, in proto_crypto_caps
    if FULL_INFO>1 or proto.encryption:
                      ^^^^^^^^^^^^^^^^
AttributeError: 'SocketProtocol' object has no attribute 'encryption'

Attaching with ssh and without proxy works fine.

@goekce goekce added the bug Something isn't working label Jul 25, 2023
totaam added a commit that referenced this issue Jul 25, 2023
server core assumes that these exist in 'proto_crypto_caps'
@totaam
Copy link
Collaborator

totaam commented Jul 25, 2023

The commit above should fix this - untested.

@goekce
Copy link
Contributor Author

goekce commented Jul 26, 2023

Thanks Antoine, was close enough. My patch fixes the issue.

totaam added a commit that referenced this issue Jul 26, 2023
packets have been made immutable so we have to replace them
@totaam
Copy link
Collaborator

totaam commented Jul 26, 2023

@goekce the commit above is the more correct fix - unfortunately also more complicated. (also still untested)

Packets have been made immutable in v5 to prevent bugs, so the proxy needs a utility function to continue to modify packet data.

@goekce
Copy link
Contributor Author

goekce commented Jul 26, 2023

fixed with #3940, 1a81bb4 and 9b19cbb

@goekce goekce closed this as completed Jul 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants