Zun

Inspected docker start time is not the required format

Bug #1670964 reported by Shunli Zhou
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zun
Fix Committed
Undecided
Shunli Zhou

Bug Description

When create container, there is exception in code:

2017-03-08 15:54:22.275 TRACE zun.container.docker.driver Traceback (most recent call last):
2017-03-08 15:54:22.275 TRACE zun.container.docker.driver File "/opt/stack/zun/zun/container/docker/driver.py", line 141, in format_status_detail
2017-03-08 15:54:22.275 TRACE zun.container.docker.driver try:
2017-03-08 15:54:22.275 TRACE zun.container.docker.driver File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime
2017-03-08 15:54:22.275 TRACE zun.container.docker.driver (data_string, format))
2017-03-08 15:54:22.275 TRACE zun.container.docker.driver ValueError: time data '0001-01-01T00:00' does not match format '%Y-%m-%dT%H:%M:%S.%f'
2017-03-08 15:54:22.275 TRACE zun.container.docker.driver

The inspected docker start time using docker-py is not the required format.

The start time returned by docker cli is correct.
/opt/stack/zun$ docker inspect 2a737621afca
[
    {
        "Id": "2a737621afca8d3f751946ee7421b5080edef0750abfc13119c68ea1c88f147e",
        "Created": "2017-03-08T08:01:11.997641105Z",
        "Path": "/pause",
        "Args": [],
        "State": {
            "Status": "exited",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 0,
            "ExitCode": 2,
            "Error": "",
            "StartedAt": "2017-03-08T08:03:25.48321852Z",
            "FinishedAt": "2017-03-08T08:03:26.401369336Z"
        },

docker version info as below:
/opt/stack/zun$ docker version
Client:
 Version: 17.03.0-ce
 API version: 1.26
 Go version: go1.7.5
 Git commit: 60ccb22
 Built: Thu Feb 23 11:02:43 2017
 OS/Arch: linux/amd64

Server:
 Version: 17.03.0-ce
 API version: 1.26 (minimum version 1.12)
 Go version: go1.7.5
 Git commit: 60ccb22
 Built: Thu Feb 23 11:02:43 2017
 OS/Arch: linux/amd64
 Experimental: false

docker-py info:

/opt/stack/zun$ cat /usr/local/lib/python2.7/dist-packages/docker_py-1.10.6.dist-info/metadata.json
{"generator": "bdist_wheel (0.26.0)", "summary": "Python client for Docker.", "classifiers": ["Development Status :: 4 - Beta", "Environment :: Other Environment", "Intended Audience :: Developers", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Utilities", "License :: OSI Approved :: Apache Software License"], "extensions": {"python.details": {"project_urls": {"Home": "https://github.com/docker/docker-py/"}, "contacts": [{"email": "<email address hidden>", "name": "Joffrey F", "role": "author"}], "document_names": {"description": "DESCRIPTION.rst"}}}, "metadata_version": "2.0", "name": "docker-py", "run_requires": [{"requires": ["backports.ssl-match-hostname (>=3.5)"], "environment": "python_version < \"3.5\""}, {"requires": ["docker-pycreds (>=0.2.1)", "requests (>=2.5.2,!=2.11.0)", "six (>=1.4.0)", "websocket-client (>=0.32.0)"]}, {"requires": ["ipaddress (>=1.0.16)"], "environment": "python_version < \"3.3\""}], "extras": [], "version": "1.10.6", "test_requires": [{"requires": ["coverage (==3.7.1)", "flake8 (==2.4.1)", "mock (==1.0.1)", "pytest (==2.9.1)", "pytest-cov (==2.1.0)"]}]}

Shunli Zhou (shunliz)
Changed in zun:
assignee: nobody → Shunli Zhou (shunliz)
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/443017

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

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

commit f5c2f0da75afa155ee70e1dbb022281d0c1d8ea1
Author: ShunliZhou <email address hidden>
Date: Wed Mar 8 17:10:51 2017 +0800

    Fix inspect time do not match required format

    When execute zun list, docker-py inspect may return start
    time not in required format, container.docker.driver:
    format_status_detail throw exception.

    Since we do not need the micro seconds field, trim the time
    string to [:19] and discard the microseconds field in the format
    string.

    Change-Id: Ib3da2551d65d67d18ab8293ead0de34818a4f301
    Close-bug: #1670964

Shunli Zhou (shunliz)
Changed in zun:
status: New → Fix Committed
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.