SQLAlchemy registry database connection error not logged

Bug #844618 reported by Édouard Thuleau
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Jay Pipes
Diablo
Fix Released
Undecided
Unassigned

Bug Description

I tried to install Glance rev 210 on Ubuntu natty.
I had Glance trunk ppa in my source list.
I configured Glance to use a mysql server (database 'glance' created) and enabled log (verbose = True and debug = True).
When I tried to start 'glance-registry', it couldn't connect to database. But no log appeared and nothing explained that it cannot find MySQLdb library. I found the problem by started 'glance-registry' with 'strace' debugging utility.

So, Glance log must specifie it cannot load a missing library and perhaps add 'python-mysqldb' dependence with glance package.

Revision history for this message
Jay Pipes (jaypipes) wrote :

Hi!

What was the in your glance-registry log?

Anything at all to do with import error for Python-MySQLDb?

Thanks!
-jay

Revision history for this message
Édouard Thuleau (ethuleau) wrote :

I get this log output:

2011-09-07 14:50:44 DEBUG [glance-registry] ********************************************************************************
2011-09-07 14:50:44 DEBUG [glance-registry] Configuration options gathered from config file:
2011-09-07 14:50:44 DEBUG [glance-registry] /etc/glance/glance-registry.conf
2011-09-07 14:50:44 DEBUG [glance-registry] ================================================
2011-09-07 14:50:44 DEBUG [glance-registry] api_limit_max 1000
2011-09-07 14:50:44 DEBUG [glance-registry] bind_host 0.0.0.0
2011-09-07 14:50:44 DEBUG [glance-registry] bind_port 9191
2011-09-07 14:50:44 DEBUG [glance-registry] debug True
2011-09-07 14:50:44 DEBUG [glance-registry] limit_param_default 25
2011-09-07 14:50:44 DEBUG [glance-registry] log_file /var/log/glance/registry.log
2011-09-07 14:50:44 DEBUG [glance-registry] sql_connection mysql://nova:orange@192.168.254.215/glance
2011-09-07 14:50:44 DEBUG [glance-registry] sql_idle_timeout 3600
2011-09-07 14:50:44 DEBUG [glance-registry] use_syslog False
2011-09-07 14:50:44 DEBUG [glance-registry] verbose True
2011-09-07 14:50:44 DEBUG [glance-registry] ********************************************************************************

And loop on this log.

Revision history for this message
Jay Pipes (jaypipes) wrote :

The solution for this seems to be to add some error reporting to the registry log file output if the configure_db() registry call fails with a SQLAlchemy engine connection error.

Changed in glance:
importance: Undecided → Low
summary: - Python-mysqldb dependence
+ SQLAlchemy registry database connection error not logged
Changed in glance:
assignee: nobody → Jay Pipes (jaypipes)
status: New → Triaged
milestone: none → 2012.1
tags: added: diablo-backport
Changed in glance:
milestone: 2012.1 → essex-1
Revision history for this message
Jay Pipes (jaypipes) wrote :
Changed in glance:
status: Triaged → In Progress
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/863
Committed: http://github.com/openstack/glance/commit/56e15f6993e85376eb6e3fb4928b0cb8f6df1fda
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 56e15f6993e85376eb6e3fb4928b0cb8f6df1fda
Author: Jay Pipes <email address hidden>
Date: Thu Oct 13 11:56:19 2011 -0400

    Fixes LP Bug#844618 - SQLAlchemy errors not logged

    Logs any import errors or SQLAlchemy connection failures
    to the glance registry log so that there is some indication
    that a driver module is not installed or there is a problem
    with the sql_connection configuration string.

    Adds test case that verifies log output and error raised.

    Change-Id: Ib86c353350530d6de62e577df57602d1762879f9

Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
status: Fix Committed → Fix Released
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to glance (stable/diablo)

Reviewed: https://review.openstack.org/1777
Committed: http://github.com/openstack/glance/commit/f186d3c051e118181ce52f112b8586e80a4577d9
Submitter: Jenkins
Branch: stable/diablo

 tag in-stable-diablo
 done

commit f186d3c051e118181ce52f112b8586e80a4577d9
Author: Jay Pipes <email address hidden>
Date: Thu Oct 13 11:56:19 2011 -0400

    Fixes LP Bug#844618 - SQLAlchemy errors not logged

    Logs any import errors or SQLAlchemy connection failures
    to the glance registry log so that there is some indication
    that a driver module is not installed or there is a problem
    with the sql_connection configuration string.

    Adds test case that verifies log output and error raised.

    (cherry picked from commit 56e15f6993e85376eb6e3fb4928b0cb8f6df1fda)

    Change-Id: Ib86c353350530d6de62e577df57602d1762879f9

Thierry Carrez (ttx)
Changed in glance:
milestone: essex-1 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.