Closed totaam closed 4 years ago
TypeError: sequence item 0: expected str instance, tuple found That's caused by 24825, a backport for your ticket #2528. (maybe I should not have backported it) Fixed in r24944.
NameError: name 'POSIX' is not defined That has already been fixed in the 3.0.5 release: 24926. (you're running an older pre-release build)
There are beta builds with both fixes.
In addition to the specific errors below, password input in general feels very unresponsive. How "unresponsive"? Is keyboard input delayed? I'm not seeing this problem on my test systems. It sounds similar to #2448, but we don't need a temporary main loop here as we're reading from the keyboard using
sys.stdin.readline()
, not using GTK or the UI at all.Particularly, Enter is not entered in the terminal Do you mean that the
Enter
key cannot be used to submit the line? (again, works fine here)
Replying to [comment:1 Antoine Martin]:
TypeError: sequence item 0: expected str instance, tuple found
That's caused by 24825, a backport for your ticket #2528. (maybe I should not have backported it) Fixed in r24944.Oops 😕 Sorry about that Are you sure you fixed it though?
24825 says
tags/v3.0.x/src/xpra/client/mixins/tray.py
, r24944 saystrunk/src/xpra/client/mixins/tray.py
instread
NameError: name 'POSIX' is not defined
That has already been fixed in the 3.0.5 release: 24926. (you're running an older pre-release build)There are beta builds with both fixes. 👍
In addition to the specific errors below, password input in general feels very unresponsive. How "unresponsive"? Is keyboard input delayed? I'm not seeing this problem on my test systems. It sounds similar to #2448, but we don't need a temporary main loop here as we're reading from the keyboard using
sys.stdin.readline()
, not using GTK or the UI at all.This is sudo-like password input for me i.e. no echo. I tried to see if the caret blips when I press a letter, and it does not appear to be the case.
Particularly, Enter is not entered in the terminal Do you mean that the
Enter
key cannot be used to submit the line? (again, works fine here)The interaction feels like the same thing that would happen if I had entered the password wrong i.e. a forced delay about 3-5 seconds delay, maybe more. This is in addition to the Enter somehow not being echoed immediately. It doesn't "feel" like
sys.stdin.readline()
, since its echo seems to work okay.Do you actually use
sys.stdin.readline()
? It's not e.g. this one? [/browser/xpra/trunk/src/xpra/client/client_base.py#L643]
Are you sure you fixed it though? Yes, 24948 is the backport for v3.0.x
Do you actually use
sys.stdin.readline()
? Yes:confirm_key
does use it when not using a dialog (tty mode): [/browser/xpra/trunk/src/xpra/net/ssh.py#L127].
getpass
is used for "please enter the SSH password for user@ip:", and not the line you highlighted using "##### a lot of sleep here, to explicitly verify the key #####". Are the two prompts behaving differently? If so, we can switch to the "good" one. Could be related to python bug 18597: On Windows sys.stdin.readline() doesn't handle Ctrl-C properly.
Apologies for the confusion.
Note
In addition to the specific errors below, password input in general feels very unresponsive. Particularly, Enter is not entered in the terminal
refers to the password input. It was a general observation, and not tied specifically to the timeout issue following it.
The timeout issue is me, taking a long time (I would guess 5-10 minutes) to verify the host key. I didn't consider that different backends use different known hosts entries.
refers to the password input. It was a general observation, and not tied specifically to the timeout issue following it. So the "slow" one is the one using getpass. The host key confirmation (which is using readline) is not slow?
What are you different? I've tried win7, win10. From cmd shell, powershell. And I have not seen any issues.
I didn't consider that different backends use different known hosts entries. The paramiko backend is meant to use the same "known-host" files as openssh. You can view the paths it will try to load by running
Path_info.exe
(in latest v4 only for now).
Replying to [comment:3 Antoine Martin]:
Are you sure you fixed it though? Yes, 24948 is the backport for v3.0.x
Would you please update the python3-xpra for xenial?
There are not enough packages to downgrade from:
$ apt-cache madison python3-xpra python3-xpra | 3.0.5-24939-1 | https://xpra.org xenial/main amd64 Packages python3-xpra | 3.0.4-24778-1 | https://xpra.org xenial/main amd64 Packages
(i.e. I feel that 24778 might be too old)
Replying to [comment:5 Antoine Martin]:
refers to the password input. It was a general observation, and not tied specifically to the timeout issue following it. So the "slow" one is the one using getpass. The host key confirmation (which is using readline) is not slow?
No, it is not. I was slow in verifying the hostkey myself, manually, remotely, from other means that I have had already used (I ended up connecting via WinSCP's terminal).
I think that is what caused these
2020-01-03 10:40:34,192 SSH password authentication failed: 2020-01-03 10:40:34,192 No existing session please enter the SSH password for user@ip: 2020-01-03 10:40:42,715 SSH password authentication failed: 2020-01-03 10:40:42,715 No existing session
messages. I was able to sign in normally immediately after I restarted the xpra process.
What are you different? I've tried win7, win10. From cmd shell, powershell. And I have not seen any issues.
:/ No idea, Win10/cmd sounds my case. What diagnostics can I enable? Should I enable something for paramiko too?
I didn't consider that different backends use different known hosts entries. The paramiko backend is meant to use the same "known-host" files as openssh. You can view the paths it will try to load by running
Path_info.exe
(in latest v4 only for now).WinSCP, openssh, plink might be using their own separate methods for known hosts. I'll try to see if they can converge somewhere.
Would you please update the python3-xpra for xenial? There are 3.0.6-RC packages for xenial in the beta area.
(i.e. I feel that 24778 might be too old) It is.
BTW, the commit number was wrong, the backport is actually in 24948. It's small enough that you can apply it by hand if you want.
What diagnostics can I enable? Not a lot.
-d ssh
debugs ssh connection steps, but the password input is just one python library call. You could run the whole thing under strace to see if it is doing anything, but it's going to be very verbose and you won't see the prompt...
Replying to [comment:7 Antoine Martin]:
What diagnostics can I enable? Not a lot.
-d ssh
debugs ssh connection steps, but the password input is just one python library call. You could run the whole thing under strace to see if it is doing anything, but it's going to be very verbose and you won't see the prompt...That's the closest to diagnostics I could give:
2020-01-20 12:43:37,907 host keys=<paramiko.hostkeys.HostKeys object at 0x0000000007e2bb50> 2020-01-20 12:43:37,907 ed25519 host key 'MD5:b1:b5:b4:0f:49:ab:62:2d:7c:1d:73:de:6e:26:82:a9' OK for host '172.16.57.121' 2020-01-20 12:43:37,907 starting authentication 2020-01-20 12:43:37,907 trying none authentication 2020-01-20 12:43:38,063 auth_none() Traceback (most recent call last): File "E:\Xpra\trunk\src/xpra/net/ssh.py", line 576, in auth_none File "C:/msys64/mingw64/lib/python3.8/site-packages/paramiko/transport.py", line 1446, in auth_none File "C:/msys64/mingw64/lib/python3.8/site-packages/paramiko/auth_handler.py", line 250, in wait_for_response paramiko.ssh_exception.BadAuthenticationType: Bad authentication type; allowed types: ['publickey', 'password'] 2020-01-20 12:43:38,079 agent keys: () 2020-01-20 12:43:38,079 trying public key authentication using ['%UserProfile%/.ssh\\id_rsa', '%UserProfile%/.ssh\\id_dsa'] 2020-01-20 12:43:38,095 no keyfile at '%UserProfile%/.ssh\id_rsa' 2020-01-20 12:43:38,095 no keyfile at '%UserProfile%/.ssh\id_dsa' 2020-01-20 12:43:38,095 trying interactive authentication 2020-01-20 12:43:38,157 auth_interactive(..) Traceback (most recent call last): File "E:\Xpra\trunk\src/xpra/net/ssh.py", line 605, in auth_interactive File "C:/msys64/mingw64/lib/python3.8/site-packages/paramiko/transport.py", line 1633, in auth_interactive File "C:/msys64/mingw64/lib/python3.8/site-packages/paramiko/auth_handler.py", line 250, in wait_for_response paramiko.ssh_exception.BadAuthenticationType: Bad authentication type; allowed types: ['publickey', 'password'] 2020-01-20 12:43:38,157 SSH password authentication failed: 2020-01-20 12:43:38,157 Bad authentication type; allowed types: ['publickey', 'password'] please enter the SSH password for user@ip: 2020-01-20 12:43:46,985 trying password authentication 2020-01-20 12:43:47,001 Authentication (password) successful!
I don't think it takes me 9 seconds to type in my password.
Since you cannot reproduce it, and you have fixed me all of the other issues, I guess you can close as fixed
Related: for openssh new-format key files see #2307
Since you cannot reproduce it, and you have fixed me all of the other issues, I guess you can close as fixed The problem is still there, let's keep it open, for now.
I've seen the problem, and now that I'm trying to reproduce it, it's gone. Why!?
😂😂😂😂😂😂😂😂😂😂
Oh it's gonna be a very fun bug to catch.
I can't wait .....
Could well be related to this GTK3 bug: gtk3: disable low level keyboard hook. In particular from System-wide keyboard event delay if main thread is blocked (Windows): Keyboard input processing should not be affected in a general context. The logic controlling or affecting input queue and winapi message handling should be restricted the behavior of the program itself at runtime rather than affecting the user's ability to utilize other programs.
Closing as upstream, nothing we can do here.
Issue migrated from trac ticket # 2549
component: client | priority: major | resolution: upstream
2020-01-13 12:55:17: stdedos created the issue