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

issue running as server 'read error in handshake: end of file' #84

Open
dbadb opened this issue Feb 1, 2019 · 9 comments
Open

issue running as server 'read error in handshake: end of file' #84

dbadb opened this issue Feb 1, 2019 · 9 comments
Labels

Comments

@dbadb
Copy link

dbadb commented Feb 1, 2019

platform windows 10, python3.7.2 native build, pynetworktables version 2019.0.0

in one git-bash window, i start a pynetworktables server:

networktables.NetworkTables.initialize()

in another git-bash window, I start a pynetworktables client:

networktables.NetworkTables.initialize(server="localhost")

back in the server window, i see a stream like this:

read error in handshake: end of file
read error in handshake: end of file
read error in handshake: end of file
read error in handshake: end of file
read error in handshake: end of file

fwiw: connections to robot-based server appear solid, just trying to get work done without a robot.

@virtuald
Copy link
Member

virtuald commented Feb 1, 2019

Hm. I don't know what's happening here. Did you enable logging as shown in the examples? Set the level to DEBUG and perhaps that output will be more useful.

# To see messages from networktables, you must setup logging
import logging
logging.basicConfig(level=logging.DEBUG)

Also, what is your client doing? If it exits immediately, then that's your problem. Try the nt_driverstation.py example.

@dbadb
Copy link
Author

dbadb commented Feb 1, 2019

thanks for the rapid response! (and thanks for all that is robotpy!)

here's what i'm seeing:

  1. start the server as above but with more logging:
  2. start the nt_driverstation.py (with server == "localhost")

in the server:

networktables.NetworkTables.initialize()
INFO:nt:NetworkTables initialized in server mode
DEBUG:nt.th:Started thread nt-dispatch-thread-0
DEBUG:nt.th:Started thread nt-server-thread-0
True
>>> DEBUG:nt:Listening on  1735
DEBUG:nt:server: client connection from 127.0.0.1 port 53199
DEBUG:nt.th:Started thread nt-net-write-0
DEBUG:nt.th:Started thread nt-net-read-0
WARNING:nt:read error in handshake: end of file
DEBUG:nt:server: client disconnected before sending hello
INFO:nt:DISCONNECTED 127.0.0.1 port 53199 (None)
DEBUG:nt.th:Thread nt-net-read-0 exited
DEBUG:nt.th:Thread nt-net-write-0 exited
DEBUG:nt:server: client connection from 127.0.0.1 port 53201
DEBUG:nt.th:Started thread nt-net-write-1
DEBUG:nt.th:Started thread nt-net-read-1
WARNING:nt:read error in handshake: end of file
DEBUG:nt:server: client disconnected before sending hello
INFO:nt:DISCONNECTED 127.0.0.1 port 53201 (None)
DEBUG:nt.th:Thread nt-net-read-1 exited
DEBUG:nt.th:Thread nt-net-write-1 exited
DEBUG:nt:server: client connection from 127.0.0.1 port 53203
DEBUG:nt.th:Started thread nt-net-write-2
DEBUG:nt.th:Started thread nt-net-read-2
WARNING:nt:read error in handshake: end of file
DEBUG:nt:server: client disconnected before sending hello
INFO:nt:DISCONNECTED 127.0.0.1 port 53203 (None)
DEBUG:nt.th:Thread nt-net-read-2 exited
DEBUG:nt.th:Thread nt-net-write-2 exited
DEBUG:nt:server: client connection from 127.0.0.1 port 53205
DEBUG:nt.th:Started thread nt-net-write-3
DEBUG:nt.th:Started thread nt-net-read-3
WARNING:nt:read error in handshake: end of file
DEBUG:nt:server: client disconnected before sending hello
INFO:nt:DISCONNECTED 127.0.0.1 port 53205 (None)
DEBUG:nt.th:Thread nt-net-read-3 exited
DEBUG:nt.th:Thread nt-net-write-3 exited
DEBUG:nt:server: client connection from 127.0.0.1 port 53207
DEBUG:nt.th:Started thread nt-net-write-4
DEBUG:nt.th:Started thread nt-net-read-4
WARNING:nt:read error in handshake: end of file
DEBUG:nt:server: client disconnected before sending hello
INFO:nt:DISCONNECTED 127.0.0.1 port 53207 (None)
DEBUG:nt.th:Thread nt-net-read-4 exited
DEBUG:nt.th:Thread nt-net-write-4 exited

and in the client:

python client.py
INFO:nt:NetworkTables initialized in client mode
DEBUG:nt.th:Started thread nt-dispatch-thread-0
DEBUG:nt.th:Started thread nt-client-thread-0
robotTime: N/A
robotTime: N/A
robotTime: N/A
robotTime: N/A
robotTime: N/A
robotTime: N/A
robotTime: N/A
robotTime: N/A
robotTime: N/A

@virtuald
Copy link
Member

virtuald commented Feb 1, 2019

I've no idea. Do you perhaps have a firewall enabled that might be killing the connection oddly? Unfortunately, I don't have a Windows 10 machine available to me at this time that I could test this with.

@dbadb
Copy link
Author

dbadb commented Feb 1, 2019

Hm - I had thought of that and had whitelisted python. But just to be certain, i just disabled all three firewalls (public, private and domain) and still see the same behavior. I'll keep you posted if I learn more.
thx!

@dbadb
Copy link
Author

dbadb commented Feb 1, 2019

btw: I can confirm that the same combination of scripts works on my mac laptop

@virtuald
Copy link
Member

Any news here?

@dbadb
Copy link
Author

dbadb commented Feb 15, 2019

no new news with all the excitement of the build season.
i did just re-verify that the condition persists on my windows 10 machine with python37 (windows native) plus pynetworktables 2019.0.0

@virtuald
Copy link
Member

I just setup a clean Windows 10 VM, installed Python 3.7.2, installed pynetworktables from pip, and ran the nt_robot.py / nt_driverstation.py programs. The firewall asked me if I wanted to allow the programs to communicate, and I said yes. They were able to send values back and forth without any problem.

I'm guessing you have something on your machine that is causing this issue. Recommend that you double-check your firewall configuration, and disable any antivirus.

@dbadb
Copy link
Author

dbadb commented Feb 15, 2019 via email

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