Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle internal server errors #26

Merged
merged 1 commit into from
Mar 19, 2017
Merged

handle internal server errors #26

merged 1 commit into from
Mar 19, 2017

Conversation

jsoref
Copy link

@jsoref jsoref commented Mar 15, 2017

No description provided.

@paskal
Copy link

paskal commented Mar 15, 2017

Could you please provide an example of the error handled with this new exception?

@jsoref
Copy link
Author

jsoref commented Mar 15, 2017

I was querying zabbix for all items, and zabbix ran out of memory.
I've since deleted most of the items (using SQL) and vacuumed the database and increased the apache php memory limit...

The apache2 error log shows something like:

[Tue Mar 14 20:52:07.318054 2017] [:error] [pid 30428] [client 10.4.0.100:49590] PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 2 bytes) in /usr/share/zabbix/include/db.inc.php on line 609

@paskal
Copy link

paskal commented Mar 15, 2017

Not Zabbix ran out of memory but apache. I guess it's very easy to reproduce by, could you please post error message before and after your patch with php memory_limit set to very low value like 1M?

@jsoref
Copy link
Author

jsoref commented Mar 16, 2017

before:

$ ./zabbix_tool get_graphs
Traceback (most recent call last):
  File "./zabbix_tool", line 933, in <module>
    tool.login(**options)      # Cheating!
  File "./zabbix_tool", line 115, in login
    self.z.login(user=username, password=password)
  File "/Users/jsoref/code/zabbix/scripts/zabbix/build/lib/zabbix_api.py", line 207, in login
    result = self.do_request(obj)
  File "/Users/jsoref/code/zabbix/scripts/zabbix/build/lib/zabbix_api.py", line 261, in do_request
    raise ZabbixAPIException("urllib2.URLError - %s" % e)
zabbix_api.ZabbixAPIException: urllib2.URLError -

after:

$ ./zabbix_tool get_graphs
Traceback (most recent call last):
  File "./zabbix_tool", line 933, in <module>
    tool.login(**options)      # Cheating!
  File "./zabbix_tool", line 115, in login
    self.z.login(user=username, password=password)
  File "/Users/jsoref/code/zabbix/scripts/zabbix/build/lib/zabbix_api.py", line 207, in login
    result = self.do_request(obj)
  File "/Users/jsoref/code/zabbix/scripts/zabbix/build/lib/zabbix_api.py", line 261, in do_request
    raise ZabbixAPIException("urllib2.URLError - %s" % e)
zabbix_api.ZabbixAPIException: urllib2.URLError - Internal Server Error

@paskal
Copy link

paskal commented Mar 16, 2017

Thanks a lot! Looks valid to me. @gescheit, could you please review and merge?

@gescheit gescheit merged commit eac9391 into gescheit:master Mar 19, 2017
@gescheit
Copy link
Owner

Thanks guys!

@jsoref jsoref deleted the ise branch March 20, 2017 15:29
@paskal
Copy link

paskal commented Apr 11, 2017

A side-note: I've tested everything, current master works as well as 0.3 with Zabbix 3.2, I think you can release new version safely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants