glance-api.log permission error when using upstart script

Bug #784837 reported by Dan Prince on 2011-05-18
This bug affects 1 person
Affects Status Importance Assigned to Milestone
glance (Ubuntu)

Bug Description

I get the following error in /var/log/glance/api.log when using 'service glance-api start':

Traceback (most recent call last):
  File "/usr/bin/glance-api", line 60, in <module>
    conf, app = config.load_paste_app('glance-api', options, args)
  File "/usr/lib/pymodules/python2.6/glance/common/", line 279, in load_paste_app
    setup_logging(options, conf)
  File "/usr/lib/pymodules/python2.6/glance/common/", line 168, in setup_logging
    logfile = logging.FileHandler(logfile)
  File "/usr/lib/python2.6/logging/", line 827, in __init__
    StreamHandler.__init__(self, self._open())
  File "/usr/lib/python2.6/logging/", line 846, in _open
    stream = open(self.baseFilename, self.mode)
IOError: [Errno 13] Permission denied: '/var/log/glance/api.log'


If I touch /var/log/glance/api.log and chown it to the glance user the issue goes away.

Related branches

Jay Pipes (jaypipes) wrote :

Hmm, is this an issue with our packaging? I mean, if the user running glance-api has write permissions to /var/log/glance, then everything is perfectly fine.

Changed in glance:
status: New → Incomplete
Thierry Carrez (ttx) on 2011-06-01
Changed in glance:
status: Incomplete → New
status: New → Incomplete
Matt Thompson (mattt416) wrote :

I'm seeing this also. I've got the following packages installed on an Ubuntu 10.10 host:

ii glance 2011.3~d3~20110701.151-0ubuntu0ppa1~maverick1 OpenStack Image Registry and Delivery Service - Daemons
ii python-glance 2011.3~d3~20110701.151-0ubuntu0ppa1~maverick1 OpenStack Image Registry and Delivery Service - Python library

I suspect this may be a packaging issue, specifically around the glance-api and glance-registry upstart scripts in /etc/init. Perhaps you could do this:

exec su -c "glance-api >> /var/log/glance/api.log 2>&1" glance

... instead of:

exec su -c "glance-api" glance >> /var/log/glance/api.log 2>&1


Tim Lawrence (tim-lawrence-d) wrote :

Brilliant! Thanks Matt. Not sure I fully understand what difference this made but it worked. In case anyone else is as stupid as me the upstart script you need to edit is /etc/init/glance-api.conf

Thanks again!


Thierry Carrez (ttx) on 2011-07-05
Changed in glance:
status: Incomplete → Invalid
Changed in glance (Ubuntu):
status: New → Triaged
importance: Undecided → High
Martin Pitt (pitti) wrote :

glance (2011.3~d2-0ubuntu1) oneiric; urgency=low

  [Chuck Short]
  * New upstream release.

  [Adam Gandelman]
  * Remove shell redirects in upstart jobs to ensure correct permissions
    on logfiles. (LP: #784837)

 -- Chuck Short <email address hidden> Thu, 30 Jun 2011 17:20:19 +0100

Changed in glance (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers