Scrubber exits with 0 even though it didn't work

Bug #1548289 reported by Vincent Untz
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Undecided
Dharini Chandrasekar

Bug Description

glance-scrubber fails to work with:

08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client [req-3200d95d-a3d7-4347-a4a3-9e00dc2fbc53 glance service - - -] Registry client request GET /images/detail raised AuthUrlNotFound
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client Traceback (most recent call last):
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client File "/usr/lib/python2.7/site-packages/glance/registry/client/v1/client.py", line 121, in do_request
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client **kwargs)
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 71, in wrapped
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client return func(self, *args, **kwargs)
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 367, in do_request
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client self._authenticate()
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client File "/usr/lib/python2.7/site-packages/glance/common/client.py", line 345, in _authenticate
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client auth_plugin.authenticate()
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client File "/usr/lib/python2.7/site-packages/glance/common/auth.py", line 131, in authenticate
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client _authenticate(auth_url)
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client File "/usr/lib/python2.7/site-packages/glance/common/auth.py", line 125, in _authenticate
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client self._v1_auth(token_url)
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client File "/usr/lib/python2.7/site-packages/glance/common/auth.py", line 188, in _v1_auth
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client raise exception.AuthUrlNotFound(url=token_url)
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client AuthUrlNotFound: Auth service at URL http://10.164.0.2:5000/v3/tokens not found.
08:52:43 2016-02-21 07:52:43.009 16387 ERROR glance.registry.client.v1.client
08:52:43 2016-02-21 07:52:43.011 16387 ERROR glance.scrubber [req-3200d95d-a3d7-4347-a4a3-9e00dc2fbc53 glance service - - -] Can not get scrub jobs from queue: Auth service at URL http://10.164.0.2:5000/v3/tokens not found.

(this was due to using keystone v3 API -- but ignore the error itself, just consider that it failed for some reason)

However, when I run it, the exit code of the process is still 0, while it should be 1.

Revision history for this message
Cyril Roelandt (cyril-roelandt) wrote :

So I believe you'd like us to propagate the error at https://github.com/openstack/glance/blob/master/glance/scrubber.py#L277 but I'm not sure whether that is a great idea. glance-scrubber may run as a daemon, and it feels better to handle errors gracefully like this, since they might happen from time to time.

What do the others think?

Revision history for this message
Vincent Untz (vuntz) wrote :

I'd say the behavior should be different in daemon mode and non-daemon mode, then.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on glance (master)

Change abandoned by Nikhil Komawar (<email address hidden>) on branch: master
Review: https://review.openstack.org/296721
Reason: I see no movement on this patch and/or bug associated. Please reopen as/when you find appropriate.

Changed in glance:
assignee: nobody → Dharini Chandrasekar (dharini-chandrasekar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to glance (master)

Fix proposed to branch: master
Review: https://review.openstack.org/382711

Changed in glance:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/382711
Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=91434be160634759407c26c099754ae4e2353958
Submitter: Jenkins
Branch: master

commit 91434be160634759407c26c099754ae4e2353958
Author: Dharini Chandrasekar <email address hidden>
Date: Thu Oct 6 03:50:42 2016 +0000

    Handling scrubber's exit in non-daemon mode.

    Currently, Scrubber exits with a status code of zero
    upon job fetching errors both in daemon and non daemon
    mode. It is more appropriate to have scrubber exit with
    status code 1 if it is not in daemon mode.

    This patch causes scrubber to exit with status code 1
    (RuntimeError)if the scrubber is not running in daemon
    mode, facilitating accurate exits.

    Co-Authored-By: Steve Lewis <email address hidden>
    Co-Authored-By: Dharini Chandrasekar <email address hidden>

    Closes-Bug: #1548289

    Change-Id: Ib75676dc90349f008395fb118978f4e37fa876ea

Changed in glance:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/glance 15.0.0.0b1

This issue was fixed in the openstack/glance 15.0.0.0b1 development milestone.

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.