pynetworktables icon indicating copy to clipboard operation
pynetworktables copied to clipboard

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

Open dbadb opened this issue 6 years ago • 9 comments
trafficstars

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.

dbadb avatar Feb 01 '19 00:02 dbadb

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.

virtuald avatar Feb 01 '19 03:02 virtuald

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

dbadb avatar Feb 01 '19 06:02 dbadb

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.

virtuald avatar Feb 01 '19 16:02 virtuald

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 avatar Feb 01 '19 17:02 dbadb

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

dbadb avatar Feb 01 '19 17:02 dbadb

Any news here?

virtuald avatar Feb 15 '19 21:02 virtuald

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

dbadb avatar Feb 15 '19 22:02 dbadb

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.

virtuald avatar Feb 15 '19 23:02 virtuald

completely agree that it smells machine specific. as i mentioned earlier, i believe i've disproved the theory that it's firewall related. It would be interesting if the problem turns out to be related to the national instruments installation.

On Fri, Feb 15, 2019 at 3:01 PM Dustin Spicuzza [email protected] wrote:

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.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/robotpy/pynetworktables/issues/84#issuecomment-464238029, or mute the thread https://github.com/notifications/unsubscribe-auth/AOlyznVnoeUtk_O7ut8tN5tal6NMccMQks5vNzxKgaJpZM4adbzX .

dbadb avatar Feb 15 '19 23:02 dbadb