Zun

Show status reason for container

Bug #1614398 reported by Eli Qiao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zun
Fix Released
High
Pradeep Kumar Singh

Bug Description

As an operation, I would like to know the container's status and reason, but ....

2016-08-18 07:18:32.147 ERROR zun.compute.manager [req-f19034a3-9805-43f2-8603-5d2b174ba37e None None] Unexpected exception: 409 Client Error: Conflict ("Conflict. The name "/test" is already in use by container a3e7998d064edd45cb9839a2a8a32e20f64a7bd01e66de7687b51c8f2ecdca42. You have to remove (or rename) that container to be able to reuse that name.")2016-08-18 07:18:32.147 TRACE zun.compute.manager Traceback (most recent call last):
2016-08-18 07:18:32.147 TRACE zun.compute.manager File "/opt/stack/higgins/zun/compute/manager.py", line 55, in _do_container_create
2016-08-18 07:18:32.147 TRACE zun.compute.manager container = self.driver.create(container)
2016-08-18 07:18:32.147 TRACE zun.compute.manager File "/opt/stack/higgins/zun/container/docker/driver.py", line 61, in create
2016-08-18 07:18:32.147 TRACE zun.compute.manager response = docker.create_container(image, **kwargs)
2016-08-18 07:18:32.147 TRACE zun.compute.manager File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 119, in create_container
2016-08-18 07:18:32.147 TRACE zun.compute.manager return self.create_container_from_config(config, name)
2016-08-18 07:18:32.147 TRACE zun.compute.manager File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 130, in create_container_from_config
2016-08-18 07:18:32.147 TRACE zun.compute.manager return self._result(res, True)
2016-08-18 07:18:32.147 TRACE zun.compute.manager File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 150, in _result
2016-08-18 07:18:32.147 TRACE zun.compute.manager self._raise_for_status(response)
2016-08-18 07:18:32.147 TRACE zun.compute.manager File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 146, in _raise_for_status
2016-08-18 07:18:32.147 TRACE zun.compute.manager raise errors.APIError(e, response, explanation=explanation)
2016-08-18 07:18:32.147 TRACE zun.compute.manager APIError: 409 Client Error: Conflict ("Conflict. The name "/test" is already in use by container a3e7998d064edd45cb9839a2a8a32e20f64a7bd01e66de7687b51c8f2ecdca42. You have to remove (or rename) that container to be able to reuse that name.")

ubuntu@ubuntu16:/opt/stack/higgins$ zun container-show test
+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Property | Value |
+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| status | Error |
| uuid | 62aa813f-296f-4411-8e80-41b8fd62e97e |
| links | ["{u'href': u'http://192.168.2.209:9517/v1/containers/62aa813f-296f-4411-8e80-41b8fd62e97e', u'rel': u'self'}", "{u'href': u'http://192.168.2.209:9517/containers/62aa813f-296f-4411-8e80-41b8fd62e97e', u'rel': u'bookmark'}"] |
| image | cirros:latest |
| environment | {} |
| command | sleep 10000 |
| memory | None |
| task_state | None |
| name | test |
+-------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

See Magnum's implementation as a reference: https://github.com/openstack/magnum/commit/9a373a48ebe60cefc881b6934b3a86b173a84e76

Tags: api
Eli Qiao (taget-9)
Changed in zun:
status: New → Confirmed
tags: added: api
Revision history for this message
hongbin (hongbin034) wrote :

Yes, need a 'status_reason' field at container.

Changed in zun:
importance: Undecided → High
summary: - sdf
+ Show status reason for container
Changed in zun:
assignee: nobody → Arun Dhiman (arundhiman86)
hongbin (hongbin034)
Changed in zun:
status: Confirmed → Triaged
description: updated
Changed in zun:
assignee: Arun Dhiman (arundhiman86) → bharaththiruveedula (bharath-ves)
Changed in zun:
assignee: bharaththiruveedula (bharath-ves) → Pradeep Kumar Singh (pradeep-singh-u)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to zun (master)

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

Changed in zun:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to zun (master)

Reviewed: https://review.openstack.org/392428
Committed: https://git.openstack.org/cgit/openstack/zun/commit/?id=694ea48d0d33c885bc158791860d8799c33d7289
Submitter: Jenkins
Branch: master

commit 694ea48d0d33c885bc158791860d8799c33d7289
Author: Pradeep Kumar Singh <email address hidden>
Date: Wed Nov 2 06:30:06 2016 +0000

    Set status_reason when container creation fails

    If Container creation fails, this patch updates the
    status_reason field so that operator can know the reason
    of container creation failure.

    Closes-Bug: #1614398
    Change-Id: I5571517c909b3fe4f45947fc89676de5352584de

Changed in zun:
status: In Progress → Fix Released
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.