Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: Container xxxxxx does not have a com.docker.compose.container-number label #1697

Closed
stefanocog opened this issue Jul 15, 2015 · 11 comments

Comments

@stefanocog
Copy link

Hi, i tried to push/pull my image from/to my registry repositories, after pushed an image i tried to pull with docker-compose and i have this error after pushing:

# docker-compose up -d    
.
Traceback (most recent call last):
  File "<string>", line 3, in <module>
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 31, in main
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 21, in sys_dispatch
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 34, in dispatch
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.docopt_command", line 24, in dispatch
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.command", line 66, in perform_command
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.cli.main", line 460, in up
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.project", line 230, in up
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 332, in execute_convergence_plan
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 380, in recreate_container
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 213, in create_container
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.service", line 435, in _next_container_number
  File "/code/build/docker-compose/out00-PYZ.pyz/compose.container", line 70, in number
ValueError: Container 8bb1102da4 does not have a com.docker.compose.container-number label

I use docker-compose 1.3.1

@aanand
Copy link

aanand commented Jul 15, 2015

Could you paste the output of docker inspect 8bb1102da4?

@hossam-fares
Copy link

I'm facing same issue my output:

[{
    "AppArmorProfile": "",
    "Args": [],
    "Config": {
        "AttachStderr": false,
        "AttachStdin": false,
        "AttachStdout": false,
        "Cmd": [
            "/start-db.sh"
        ],
        "CpuShares": 0,
        "Cpuset": "",
        "Domainname": "",
        "Entrypoint": null,
        "Env": [
            "password=root",
            "user=root",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "importdb=no"
        ],
        "ExposedPorts": {
            "3306/tcp": {}
        },
        "Hostname": "605920adbf7a",
        "Image": "namshi/mysql",
        "MacAddress": "",
        "Memory": 0,
        "MemorySwap": 0,
        "NetworkDisabled": false,
        "OnBuild": null,
        "OpenStdin": false,
        "PortSpecs": null,
        "StdinOnce": false,
        "Tty": false,
        "User": "",
        "Volumes": {
            "/var/lib/mysql": {}
        },
        "WorkingDir": ""
    },
    "Created": "2015-07-21T11:30:48.349192482Z",
    "Driver": "aufs",
    "ExecDriver": "native-0.2",
    "ExecIDs": null,
    "HostConfig": {
        "Binds": [
            "/home/hossam/local/namshi/mysql:/var/lib/mysql:rw"
        ],
        "CapAdd": null,
        "CapDrop": null,
        "ContainerIDFile": "",
        "Devices": null,
        "Dns": null,
        "DnsSearch": null,
        "ExtraHosts": [],
        "IpcMode": "",
        "Links": null,
        "LxcConf": null,
        "NetworkMode": "",
        "PidMode": "",
        "PortBindings": {
            "3306/tcp": [
                {
                    "HostIp": "",
                    "HostPort": "3306"
                }
            ]
        },
        "Privileged": false,
        "PublishAllPorts": false,
        "ReadonlyRootfs": false,
        "RestartPolicy": {
            "MaximumRetryCount": 0,
            "Name": ""
        },
        "SecurityOpt": null,
        "VolumesFrom": []
    },
    "HostnamePath": "/var/lib/docker/containers/605920adbf7a3f4ef6ae66e89a7893f84e922bde992bdaaa1ddccaa0f246fb5f/hostname",
    "HostsPath": "/var/lib/docker/containers/605920adbf7a3f4ef6ae66e89a7893f84e922bde992bdaaa1ddccaa0f246fb5f/hosts",
    "Id": "605920adbf7a3f4ef6ae66e89a7893f84e922bde992bdaaa1ddccaa0f246fb5f",
    "Image": "46af73ad0ae842e0682587155c330c10072036c875266fa04d4ddaf7e7735daa",
    "LogPath": "/var/lib/docker/containers/605920adbf7a3f4ef6ae66e89a7893f84e922bde992bdaaa1ddccaa0f246fb5f/605920adbf7a3f4ef6ae66e89a7893f84e922bde992bdaaa1ddccaa0f246fb5f-json.log",
    "MountLabel": "",
    "Name": "/cerberus_mysql_1",
    "NetworkSettings": {
        "Bridge": "docker0",
        "Gateway": "172.17.42.1",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "IPAddress": "172.17.0.33",
        "IPPrefixLen": 16,
        "IPv6Gateway": "",
        "LinkLocalIPv6Address": "fe80::42:acff:fe11:21",
        "LinkLocalIPv6PrefixLen": 64,
        "MacAddress": "02:42:ac:11:00:21",
        "PortMapping": null,
        "Ports": {
            "3306/tcp": [
                {
                    "HostIp": "0.0.0.0",
                    "HostPort": "3306"
                }
            ]
        }
    },
    "Path": "/start-db.sh",
    "ProcessLabel": "",
    "ResolvConfPath": "/var/lib/docker/containers/605920adbf7a3f4ef6ae66e89a7893f84e922bde992bdaaa1ddccaa0f246fb5f/resolv.conf",
    "RestartCount": 0,
    "State": {
        "Error": "",
        "ExitCode": 0,
        "FinishedAt": "0001-01-01T00:00:00Z",
        "OOMKilled": false,
        "Paused": false,
        "Pid": 16308,
        "Restarting": false,
        "Running": true,
        "StartedAt": "2015-07-21T11:30:48.531799593Z"
    },
    "Volumes": {
        "/var/lib/mysql": "/home/hossam/local/namshi/mysql"
    },
    "VolumesRW": {
        "/var/lib/mysql": true
    }
}
]

@aanand
Copy link

aanand commented Jul 21, 2015

Your container doesn't seem to have any labels set. What's the output of docker version?

@hossam-fares
Copy link

Docker version 1.5.0-dev, build a78ce5c

@stefanocog
Copy link
Author

After repulling image i not have more this error

Il 21/07/2015 15:23, Aanand Prasad ha scritto:

Your container doesn't seem to have any labels set. What's the output
of |docker version|?


Reply to this email directly or view it on GitHub
#1697 (comment).

@stefanocog
Copy link
Author

sorry...wrong post

Il 21/07/2015 15:25, Hossam Fares ha scritto:

Docker version 1.5.0-dev, build a78ce5c


Reply to this email directly or view it on GitHub
#1697 (comment).

@aanand
Copy link

aanand commented Jul 21, 2015

@hossam-fares Compose 1.3 requires Docker 1.6 or newer.

@hossam-fares
Copy link

Yeh, I update my docker version and it solved the issue 👍

@xeor
Copy link

xeor commented Sep 28, 2015

I got the same error, but before I updated dockerd, I wanted to see if there was any temporary solutions out there. I only got the error because I sat COMPOSE_API_VERSION=1.18. Maybe docker-compose should show a warning if you are trying to use an API version older than what it supports?

@dnephin
Copy link

dnephin commented Jan 15, 2016

We warn that using COMPOSE_API_VERSION can cause unexpected issues in the docs: https://docs.docker.com/compose/reference/overview/#compose-api-version

Looks like this issue was solved, so closing.

@dnephin dnephin closed this as completed Jan 15, 2016
@erielmejias99
Copy link

Happening to me because JetBrains IDE runs some containers when the IDE starts and running docker compose -d after that. So close the IDE and run the projects with the IDEs closed, and open them later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants