Skip to content

confusing error on port mismatch #14

@ghost

Description

  • install event-source-library via pip install
  • run server on non-defaul port: eventsource-server -P 8888 -i -k 50000
  • try to tun client on default port: eventsource-client 42:42:42:42:42:42 -r 5000 - it will terminate with following error:
Traceback (most recent call last):
  File "/home/msuraev/.local/lib/python2.7/site-packages/eventsource/client.py", line 139, in handle_stream
    (field, value) = line.split(":", 1)
ValueError: need more than 1 value to unpack
ERROR:eventsource.client:HTTP 599: Failed writing body (0 != 877)

Hmm, looking further into this, seems like it's not the port to be blamed - I've got the same error if I run eventsource-server -i -k 50000 instead.

Note, that running both client and the server with -P 8888 fixes it. What's the default port used if -P not specified? In general, I think every option with default value should explicitly mention that value in '--help' output to make troubleshooting easier.

Incidentally, trying to connect with some "empty" port leads to expected error:

eventsource-client 42:42:42:42:42:42 -r 5000 -P 1111 

ERROR:eventsource.client:HTTP 599: Failed to connect to 127.0.0.1 port 1111: Connection refused

So it seems like eventsource-client got confused by smth else running on the default port but I don't understand how it's possible - if the port is already occupied than eventsource-server would have complained about it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions