freeciv-web icon indicating copy to clipboard operation
freeciv-web copied to clipboard

'[' or '{' expected near 'null'

Open andreasrosdal opened this issue 3 years ago • 5 comments

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

andreasrosdal avatar Jul 03 '22 20:07 andreasrosdal

Can we please improve the error logging here? @cazfi

andreasrosdal avatar Jul 04 '22 20:07 andreasrosdal

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?

cazfi avatar Jul 05 '22 01:07 cazfi

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.

andreasrosdal avatar Jul 05 '22 02:07 andreasrosdal

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?

andreasrosdal avatar Jul 05 '22 06:07 andreasrosdal

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

cazfi avatar Jul 05 '22 19:07 cazfi