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

Bug: Constant "Cannot connect" error messages #262

Open
redphx opened this issue May 31, 2023 · 2 comments
Open

Bug: Constant "Cannot connect" error messages #262

redphx opened this issue May 31, 2023 · 2 comments
Labels

Comments

@redphx
Copy link

redphx commented May 31, 2023

vncdotool version
vncdotool 1.1.0, python 3.1.0

VNC server and version
Unknown, but it uses protocol version 3.8

Steps to reproduce

from vncdotool import api
import logging
logging.basicConfig(level=logging.DEBUG)


with api.connect('<VNC_SERVER>', timeout=60) as cli:
    cli.captureScreen('vnc.png')

Expected result
Screenshot captured successfully.

Which erroneous result did you get instead
Note: I printed data param in rfb.RFBClient.dataReceived() to get additional info.

INFO:twisted:Starting factory <vncdotool.client.VNCDoToolFactory object at 0x10f82a7a0>
b'RFB 003.008\n'
INFO:twisted:Using protocol version 3.8
b'\x01\x01'
INFO:twisted:Offered <AuthTypes.NONE: 1>
b'\x00\x00\x00\x01\x00\x00\x00\x00\x04\x00\x03\x00\xff\xff\xff!'
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
INFO:twisted:Cannot connect b''
....

It didn't stop until timed out (60s later).

Additional information
Since the waitfor variable in _handleAuthFailed is 0, it kepts reconnecting instantly until timed out.
This bug also occurs in version 0.13.0.

@redphx redphx changed the title Bug: Cannot connect to server Bug: Constant "Cannot connect" error messages May 31, 2023
@pmhahn
Copy link
Collaborator

pmhahn commented Jun 1, 2023

b'RFB 003.008\n'

Hello, I'm a RFB server talking protocol version 3.008.

b'\x01\x01'

I offer a single authentication mechanism, which is AuthTypes.NONE

b'\x00\x00\x00\x01\x00\x00\x00\x00\x04\x00\x03\x00\xff\xff\xff!'

And now I'm pissed because authentication failed (0x00000001).
Here are no messages with an explanation (0x00000000).
And I send you additional garbage for your convenience: \x04\x00\x03\x00\xff\xff\xff!'

Summary: to me it looks like your server is announcing RFB3.8, but does not follow the protocol. There's not much we can do expect fixing the logic to terminate the function earlier, so that you do not have to wait for your timeout. (self.transport.loseConnection() is called, but the API does not handle this correctly?)

Have you checked any other VNC viewer, if they can be used to connect to that serrver? (name and version of any working VNC viewer please).

It would also be of interest, what kind of server you're trying to connect to. Without access to it or at least some information on which software and version it is, there's very little we can do to help you.

@pmhahn pmhahn added the bug label Jun 1, 2023
@redphx
Copy link
Author

redphx commented Jun 2, 2023

I couldn't connect to it using TightVNC either.

If the server doesn't follow the protocol then I'd love vncdotool to drop the connection instantly instead of trying again and again. Maybe drop connection when waitfor == 0?

Thank you.

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

No branches or pull requests

2 participants