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

Load_acl uncaught exception when MySQL is unreachable #60

Closed
jathanism opened this Issue Jan 10, 2013 · 1 comment

Comments

Projects
None yet
1 participant
@jathanism
Member

jathanism commented Jan 10, 2013

load_acl crashes when MySQL is unreachable. Let's make it exit gracefully.

Exception 1:

Traceback (most recent call last): 
 File "/usr/local/bin/load_acl", line 58, in <module> 
   queue = Queue(verbose=False) 
 File "/usr/local/packages/python-modules-2.0/lib/python/site-packages/trigger/acl/queue.py", line 42, in __init__ 
   self.dbconn = settings.get_firewall_db_conn() 
 File "/etc/trigger_settings.py", line 183, in get_firewall_db_conn 
   port=DATABASE_PORT, user=DATABASE_USER, passwd=DATABASE_PASSWORD) 
 File "/usr/local/packages/python-modules-2.0/lib/python/site-packages/MySQLdb/__init__.py", line 81, in Connect 
   return Connection(*args, **kwargs) 
 File "/usr/local/packages/python-modules-2.0/lib/python/site-packages/MySQLdb/connections.py", line 188, in __init__ 
   super(Connection, self).__init__(*args, **kwargs2) 
_mysql_exceptions.OperationalError: (2003, "Can't connect to MySQL server on '127.0.0.1' (111)") 

Exception 2:

Traceback (most recent call last): 
 File "/usr/local/bin/load_acl", line 58, in <module> 
   queue = Queue(verbose=False) 
 File "/usr/local/packages/python-modules-2.0/lib/python/site-packages/trigger/acl/queue.py", line 42, in __init__ 
   self.dbconn = settings.get_firewall_db_conn() 
 File "/etc/trigger_settings.py", line 179, in get_firewall_db_conn 
   port=DATABASE_PORT, user=DATABASE_USER, passwd=DATABASE_PASSWORD) 
 File "/usr/local/packages/python-modules-2.0/lib/python/site-packages/MySQLdb/__init__.py", line 81, in Connect 
   return Connection(*args, **kwargs) 
 File "/usr/local/packages/python-modules-2.0/lib/python/site-packages/MySQLdb/connections.py", line 188, in __init__ 
   super(Connection, self).__init__(*args, **kwargs2) 
_mysql_exceptions.OperationalError: (2013, "Lost connection to MySQL server at 'reading initial communication packet', system error: 104")
@jathanism

This comment has been minimized.

Member

jathanism commented Jan 18, 2013

Fixed in fac9ffd

@jathanism jathanism closed this Jan 18, 2013

jathanism added a commit to jathanism/trigger that referenced this issue Jan 24, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment