Bug 1449497

Summary: 7.4: docker fails to start stopped container
Product: Red Hat Enterprise Linux 7 Reporter: Jan Pazdziora (Red Hat) <jpazdziora>
Component: dockerAssignee: Mrunal Patel <mpatel>
Status: CLOSED ERRATA QA Contact: atomic-bugs <atomic-bugs>
Severity: high Docs Contact:
Priority: high    
Version: 7.4CC: amurdaca, cevich, dperpeet, jpazdziora, lsm5, lsu, mjenner, mnguyen, mpatel, qcai, santiago
Target Milestone: betaKeywords: Extras, Regression
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1451079 (view as bug list) Environment:
Last Closed: 2017-08-02 00:11:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1451079    

Description Jan Pazdziora (Red Hat) 2017-05-10 07:15:27 UTC
Description of problem:

When container is stopped, docker no longer starts it when docker start is run.

Version-Release number of selected component (if applicable):

docker-1.12.6-19.1.git92b10e4.el7.x86_64

How reproducible:

Deterministic.

Steps to Reproduce:
1. docker run --name date rhel7 date
2. docker start date

Actual results:

# docker run --name date rhel7 date
Wed May 10 06:04:29 UTC 2017
# docker start -a date
container with id exists: 0cca32ae5fe7c90371d98be53bec5e7cd0c9c2d2da82a51acc6ef49cb5434953
Error response from daemon: invalid header field value "oci runtime error: container with id exists: 0cca32ae5fe7c90371d98be53bec5e7cd0c9c2d2da82a51acc6ef49cb5434953\n"

Expected results:

# docker run --name date rhel7 date
Wed May 10 06:04:29 UTC 2017
# docker start -a date
Wed May 10 07:13:51 UTC 2017

Additional info:

This is a regression against released docker-1.12.6-16.el7.x86_64.

Comment 4 Qian Cai 2017-05-10 13:33:12 UTC
Some commit in docker-runc introduced this regression.

Comment 8 Qian Cai 2017-05-10 13:56:01 UTC
Bisecting indicated this is the culprit.
https://github.com/projectatomic/runc/commit/e6f0161fcd389a03f41f86746807e9a45dac050b

Comment 9 Ed Santiago 2017-05-10 20:29:19 UTC
Still present in docker-1.12.6-23.git62520c0.el7

Comment 12 Antonio Murdaca 2017-05-11 13:16:38 UTC
Mrunal do you know why that commit in runc broke this? https://github.com/projectatomic/runc/commit/e6f0161fcd389a03f41f86746807e9a45dac050b

Comment 16 Michael Nguyen 2017-05-15 19:42:14 UTC
I am seeing something that might be related to this BZ when running a private registry container with --restart=always.

# docker run -d -p 5000:5000 --restart=always --name registry registry:2
Unable to find image 'registry:2' locally
Trying to pull repository registry.access.redhat.com/registry ... 
Trying to pull repository docker.io/library/registry ... 
2: Pulling from docker.io/library/registry
79650cf9cc01: Pull complete 
70ce42745103: Pull complete 
77edd1a7fa4d: Pull complete 
432773976ace: Pull complete 
3234a47fe5a9: Pull complete 
Digest: sha256:a3551c422521617e86927c3ff57e05edf086f1648f4d8524633216ca363d06c2
6b51a64cecb9b7757d3474e34c248478470b3325cc21e91df6143d6383b1db72
# docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS              PORTS                    NAMES
6b51a64cecb9        registry:2          "/entrypoint.sh /etc/"   5 seconds ago       Up 4 seconds        0.0.0.0:5000->5000/tcp   registry
# systemctl restart docker
# docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
docker.io/registry   2                   9d0c4eabab4d        4 days ago          33.17 MB
[root@rhelah ~]# docker ps
CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
[root@rhelah ~]# docker ps -a
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
6b51a64cecb9        registry:2          "/entrypoint.sh /etc/"   32 seconds ago      Exited (2) 21 seconds ago                       registry
[root@rhelah ~]# docker start registry
Error response from daemon: invalid header field value "oci runtime error: container with id exists: 6b51a64cecb9b7757d3474e34c248478470b3325cc21e91df6143d6383b1db72\n"
Error: failed to start containers: registry

# rpm -qa docker
docker-1.12.6-26.git62520c0.el7.x86_64

Comment 17 Mrunal Patel 2017-05-15 22:26:30 UTC
Found the root cause. I am working on a fix for this.

Comment 18 Mrunal Patel 2017-05-16 19:49:46 UTC
Here is the PR for the fix: https://github.com/projectatomic/runc/pull/7

Comment 20 Antonio Murdaca 2017-05-18 13:39:58 UTC
*** Bug 1451923 has been marked as a duplicate of this bug. ***

Comment 21 Luwen Su 2017-07-08 07:31:08 UTC
Looks fine in docker-1.12.6-41.1.gitf55a118.el7.x86_64

# docker start -a date
Sat Jul  8 07:29:42 UTC 2017

Comment 23 errata-xmlrpc 2017-08-02 00:11:21 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:2344