freeciv-web
freeciv-web copied to clipboard
'[' or '{' expected near 'null'
I see this error in the logs of www.fciv.net often:
[T001 - 2022/06/28 15:06:28] in get_packet_from_connection_json() [../freeciv/common/networking/packets_json.c::136]: '[' or '{' expected near 'null' freeciv-web-log-6004.log:1: [T002 - 2022/06/25 00:33:09] in get_packet_from_conne
Can we please improve the error logging here? @cazfi
Well, it already should give you all of the raw contents in the previous line (135), starting with "ERROR: Unable to parse packet: ". Did you cut that out, or isn't it showing in your logs?
freeciv-web-log-6026.log:1: [T001 - 2022/07/04 08:40:04] in get_packet_from_connection_json() [../freeciv/common/networking/packets_json.c::135]: ERROR: Unable to parse packet: null
So it looks like the packet is null.
So why is the packet null? Is the JavaScript client sending empty packets? Should this be fixed in the Freeciv C server, or Freeciv-proxy?
Upcoming improvements to the server side error detection with json packets may help in investigating this.
E.g. https://osdn.net/projects/freeciv/ticket/44986, https://osdn.net/projects/freeciv/ticket/45000