Closed fluca1978 closed 3 months ago
The problem is in interpreting a faulty JSON too early in the management protocol, for example https://github.com/agroal/pgagroal/blob/master/src/libpgagroal/management.c#L1805. If the JSON object if faulty, we don't need to raise an error at the management level, rather to propagate the faulty JSON to whoever requested it (setting the exist status accordingly).
While reviewing #411 I found that, if
pgagroal-cli
encounters an error in the management phase, it does not report the JSON output even if requested, and reports instead a misleading success message.Tested on d9f9253504605194b6bac1dd18491f132059b145.
Log on the daemon side:
Need some investigation in order to make the output to appear as JSON (when required) reporting the correct error message. However, it seems this is not a problem of JSON output strictly, since the application seems to misbehave even with output text: