[ZBX-11244] json parsing fails with "Invalid JSON" Created: 2016 Sep 20 Updated: 2017 May 30 Resolved: 2016 Oct 27 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A) |
Affects Version/s: | 3.0.4 |
Fix Version/s: | 3.0.6rc1, 3.2.2rc1, 3.4.0alpha1 |
Type: | Incident report | Priority: | Blocker |
Reporter: | richlv | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | json, regression | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified |
Issue Links: |
|
Comments |
Comment by richlv [ 2016 Sep 20 ] |
looks like json parsing got seriously broken in $ json='{"jsonrpc":"2.0","method":"user.login","params":{"user":"Admin","password":"zabbix"},"id":1}' $ curl -w '\n' -s -X POST -H 'Content-Type: application/json-rpc' -d "$json" http://localhost/3.0/api_jsonrpc.php {"jsonrpc":"2.0","error":{"code":-32700,"message":"Parse error","data":"Invalid JSON. An error occurred on the server while parsing the JSON text."},"id":null} curl sends : "POST /zabbix/api_jsonrpc.php HTTP/1.1\r\nHost: localhost\r\nUser-Agent: curl/7.42.1\r\nAccept: */*\r\nContent-Type: application/json-rpc\r\nContent-Length: 92\r\n\r\n{\"jsonrpc\":\"2.0\",\"method\":\"user.login\",\"params\":{\"user\":\"Admin\",\"password\":\"zabbix\"},\"id\":1}" |
Comment by richlv [ 2016 Sep 20 ] |
for the record, php 5.4.20 vitalijs.cemeris Could not reproduce with PHP 5.4.20 and PHP 5.6.23. |
Comment by vitalijs.cemeris (Inactive) [ 2016 Sep 21 ] |
This issue is reproducible when PHP is compiled without JSON library. |
Comment by richlv [ 2016 Sep 28 ] |
more users are hit by this : |
Comment by Ivo Kurzemnieks [ 2016 Oct 12 ] |
(1) Moved vitalijs.cemeris Issue described in iivs em ... yeah, but the only problem was that both valid and invalid json strings returned same error. vitalijs.cemeris RESOLVED in r63256 iivs CLOSED |
Comment by richlv [ 2016 Oct 14 ] |
(2) [D] given that this has slipped in two released versions already, i'd suggest to document in the known issues section that 3.0.4 and 3.0.5 break api unless a non-requirement module is installed. hoping that 3.0.6 will be good vitalijs.cemeris I agree that this should be documented. RESOLVED martins-v Looks good enough to me. iivs CLOSED |
Comment by vitalijs.cemeris (Inactive) [ 2016 Oct 18 ] |
Fixed in development branch svn://svn.zabbix.com/branches/dev/ZBX-11244 |
Comment by vitalijs.cemeris (Inactive) [ 2016 Oct 18 ] |
(3) No translation strings changed. iivs CLOSED |
Comment by Ivo Kurzemnieks [ 2016 Oct 26 ] |
TESTED |
Comment by vitalijs.cemeris (Inactive) [ 2016 Oct 27 ] |
Fixed in:
|
Comment by vitalijs.cemeris (Inactive) [ 2016 Oct 27 ] |
(4) [D] Zabbix API changes "fixed decoding valid JSON-RPC request when PHP is compiled without JSON library" in: 3.0, 3.2 martins-v Reviewed, with one small grammar fix. iivs CLOSED |