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

Better logging for malformed messages #661

Open
Askaholic opened this issue Sep 15, 2020 · 0 comments
Open

Better logging for malformed messages #661

Askaholic opened this issue Sep 15, 2020 · 0 comments

Comments

@Askaholic
Copy link
Collaborator

There are a number of mysterious errors which indicate that sometimes clients are sending malformed protocol messages:

ERROR    Sep 03  21:05:08 ServerContext                  Invalid control character at: line 1 column 728 (char 727)
Traceback (most recent call last):
  File "/code/server/servercontext.py", line 80, in client_connected
    message = await protocol.read_message()
  File "/code/server/protocol/qdatastreamprotocol.py", line 119, in read_message
    message = json.loads(action)
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid control character at: line 1 column 728 (char 727)
ERROR    Sep 02  20:31:37 ServerContext                  Expecting ',' delimiter: line 1 column 10652 (char 10651)
Traceback (most recent call last):
  File "/code/server/servercontext.py", line 80, in client_connected
    message = await protocol.read_message()
  File "/code/server/protocol/qdatastreamprotocol.py", line 119, in read_message
    message = json.loads(action)
  File "/usr/local/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.7/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 1 column 10652 (char 10651)

We should probably have some explicit error handling that expects these sorts of errors and logs the entire message. These could easily be caused by non FAF traffic like automated portscans or something, but if they are legitimate messages, then maybe there is a bug in the client somewhere.

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

Successfully merging a pull request may close this issue.

1 participant