[ZBX-2469] PHP Fatal error: Cannot break/continue 1 level in /srv/src/zabbix/1.8/frontends/php/api/classes/class.cscreen.php on line 693 Created: 2010 May 27 Updated: 2017 May 30 Resolved: 2010 Jun 07 |
|
Status: | Closed |
Project: | ZABBIX BUGS AND ISSUES |
Component/s: | API (A) |
Affects Version/s: | None |
Fix Version/s: | 1.8.3 |
Type: | Incident report | Priority: | Major |
Reporter: | Maxence Dunnewind | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Remaining Estimate: | Not Specified | ||
Time Spent: | Not Specified | ||
Original Estimate: | Not Specified | ||
Environment: |
Debian squeeze, root@zabbix:~# dpkg -l|grep zabbix |
Description |
I tried to use the python API mapping to delete a screen, the trace : 20: url: http://zabbix.krg/zabbix/api_jsonrpc.php , 'jsonrpc': '2.0', 'method': 'user.authenticate', 'auth': '', 'id': 0} , "jsonrpc": "2.0", "method": "user.authenticate", "auth": "", "id": 0} 20: Response Code: 200 OK 10: json_obj: {'params': {}, 'jsonrpc': '2.0', 'method': 'APIInfo.version', 'auth': '42e72a52d13b0286ce579af874f8572b', 'id': 1} 20: Response Code: 200 OK Zabbix API Version: 1.2 , 'jsonrpc': '2.0', 'method': 'user.checkAuthentication', 'auth': '42e72a52d13b0286ce579af874f8572b', 'id': 2} , "jsonrpc": "2.0", "method": "user.checkAuthentication", "auth": "42e72a52d13b0286ce579af874f8572b", "id": 2} 20: Response Code: 200 OK Logged in: True , 'jsonrpc': '2.0', 'method': 'screen.delete', 'auth': '42e72a52d13b0286ce579af874f8572b', 'id': 3} , "jsonrpc": "2.0", "method": "screen.delete", "auth": "42e72a52d13b0286ce579af874f8572b", "id": 3} 20: Response Code: 500 Internal Server Error Also tried with svn version svn://svn.zabbix.com/branches/1.8/frontends/php, same issue. Log in apache : [Thu May 27 09:28:40 2010] [error] [client 10.2.23.254] PHP Fatal error: Cannot break/continue 1 level in /srv/src/zabbix/1.8/frontends/php/api/classes/class.cscreen.php on line 693 |
Comments |
Comment by Maxence Dunnewind [ 2010 Jun 03 ] |
methods must be declared as public. If they are declared protected, any access finish with an error : Error -32400: System error., JSON-rpc error generation failed. No such error: |
Comment by Alexey Fukalov [ 2010 Jun 04 ] |
Yes, it's not mistake. Probably in future there will be additionsl methods for configuration separate screenitems. |
Comment by Maxence Dunnewind [ 2010 Jun 04 ] |
mhhh ok. Why not directly providing get / updateItems as public ? Do you have some exemples of the parameters I'm supposed to send at update() to :
Regards, Maxence |
Comment by Alexey Fukalov [ 2010 Jun 04 ] |
{"jsonrpc":"2.0","method":"screen.update","params":[{"screenid":37,"screenitems":[ {"resourceid":18470,"resourcetype":1,"x":0,"y":0}]}],"auth":"f3f8d561cc345977322643e7c610f744","id":4} this request will update screen with id 37 by setting cell 0,0 to contain simple graph for item with id 18470, and removing all other screen items. |
Comment by Maxence Dunnewind [ 2010 Jun 04 ] |
ok, and so, to delete all the items of a screen, I have to do something like : {"jsonrpc":"2.0","method":"screen.update","params":[{"screenid":37,"screenitems":{}}],"auth":"f2b9e786c3085f165d89d596da4fafaa","id":4} Right ? |
Comment by Alexey Fukalov [ 2010 Jun 04 ] |
yes |
Comment by Maxence Dunnewind [ 2010 Jun 04 ] |
Ok. I'll be able to try it this afternoon, I'll close this bug if it works. Regards, Maxence |
Comment by richlv [ 2010 Jun 04 ] |
i strongly suggest adding these examples to http://www.zabbix.com/documentation/1.8/api/objects/screen |
Comment by Maxence Dunnewind [ 2010 Jun 04 ] |
Ok, it works perfectly, I'm able to update my screen with new data. Thanks ! Maxence |
Comment by richlv [ 2010 Jun 04 ] |
dev branch rev 12569. |
Comment by richlv [ 2010 Jun 07 ] |
dev branch rev 12591. attempting to update an existing screen upon import : Undefined index: resourcetype[/usr/local/apache2/htdocs/dev/ZBX-2469-cscreen/api/classes/class.cscreen.php:476] |
Comment by richlv [ 2010 Jun 07 ] |
also, a couple of error messages are quite useless : |
Comment by richlv [ 2010 Jun 08 ] |
confirming the fix in dev branch rev 12616. |
Comment by Alexey Fukalov [ 2010 Jun 08 ] |
Path |