[Openstack] Cannot setup network: Cannot find any PID under container

Raimon Bosch raimon.bosch at gmail.com
Mon Feb 22 14:35:08 UTC 2016


Ok,

Again answering myself my questions. This particular docker container was
not supposed to be running permanently. The nova-docker driver somehow
tries to look for a pid associated to this container. If the container has
already finished his job to do, then it can't be registered to Openstack.

So my dirty solution was to add something like that on my
docker-entrypoint.sh:

if [ "$@" ]
then
    exec "$@"
else
    echo "Container running!"
    sleep 3h
fi

So when I start this container without parameters (which is the case of
nova-docker), I just sleep so everyone knows that this container has to be
registered on OpenStack and nothing fails.

I guess that it would be good to give support to this kind of containers on
nova-docker. If not, it is necessary to perform hacks like this in all your
containers.

Cheers,

2016-02-22 13:13 GMT+01:00 Raimon Bosch <raimon.bosch at gmail.com>:

>
> Hi,
>
> I am using nova-docker to run docker containers from Openstack. Some of my
> containers are not able to setup network and they give this error: *Cannot
> setup network: Cannot find any PID under container*
>
> I have already tried to set *tty:True* on the driver.py and it still
> fails. When I fire up those docker by using "docker run -it --net *bridge*
> ..." everything works fine. I guess that there is a problem assigning the
> correct network on nova-docker.
>
> Thanks in advance,
> 2016-02-22 12:03:19.470 8997 WARNING novadocker.virt.docker.driver
> [req-2f3068fa-bc72-48f6-abc6-cfee0675e95a bdc8aedaf84b4ed8a8d2659928a3d0af
> 3407b066d1f542668f70715d5597a680 - - -] [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734] Cannot setup network: Cannot find any
> PID under container
> "12a1a788b37dba2701942f0517236d608582a33d55f577737a20b5e23317fb78"
> 2016-02-22 12:03:19.470 8997 TRACE novadocker.virt.docker.driver
> [instance: 84e06276-aa7a-4789-844a-ef34e6259734] Traceback (most recent
> call last):
> 2016-02-22 12:03:19.470 8997 TRACE novadocker.virt.docker.driver
> [instance: 84e06276-aa7a-4789-844a-ef34e6259734]   File
> "/usr/local/lib/python2.7/dist-packages/novadocker/virt/docker/driver.py",
> line 453, in _start_container
> 2016-02-22 12:03:19.470 8997 TRACE novadocker.virt.docker.driver
> [instance: 84e06276-aa7a-4789-844a-ef34e6259734]
> self._attach_vifs(instance, network_info)
> 2016-02-22 12:03:19.470 8997 TRACE novadocker.virt.docker.driver
> [instance: 84e06276-aa7a-4789-844a-ef34e6259734]   File
> "/usr/local/lib/python2.7/dist-packages/novadocker/virt/docker/driver.py",
> line 237, in _attach_vifs
> 2016-02-22 12:03:19.470 8997 TRACE novadocker.virt.docker.driver
> [instance: 84e06276-aa7a-4789-844a-ef34e6259734]     raise
> RuntimeError(msg.format(container_id))
> 2016-02-22 12:03:19.470 8997 TRACE novadocker.virt.docker.driver
> [instance: 84e06276-aa7a-4789-844a-ef34e6259734] RuntimeError: Cannot find
> any PID under container
> "12a1a788b37dba2701942f0517236d608582a33d55f577737a20b5e23317fb78"
> 2016-02-22 12:03:19.470 8997 TRACE novadocker.virt.docker.driver
> [instance: 84e06276-aa7a-4789-844a-ef34e6259734]
> 2016-02-22 12:03:19.476 8997 ERROR nova.compute.manager
> [req-2f3068fa-bc72-48f6-abc6-cfee0675e95a bdc8aedaf84b4ed8a8d2659928a3d0af
> 3407b066d1f542668f70715d5597a680 - - -] [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734] Instance failed to spawn
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734] Traceback (most recent call last):
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734]   File
> "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2473, in
> _build_resources
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734]     yield resources
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734]   File
> "/usr/lib/python2.7/dist-packages/nova/compute/manager.py", line 2345, in
> _build_and_run_instance
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734]
> block_device_info=block_device_info)
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734]   File
> "/usr/local/lib/python2.7/dist-packages/novadocker/virt/docker/driver.py",
> line 495, in spawn
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734]
> self._start_container(container_id, instance, network_info)
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734]   File
> "/usr/local/lib/python2.7/dist-packages/novadocker/virt/docker/driver.py",
> line 461, in _start_container
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734]     instance_id=instance['name'])
> 2016-02-22 12:03:19.476 8997 TRACE nova.compute.manager [instance:
> 84e06276-aa7a-4789-844a-ef34e6259734] InstanceDeployFailure: Cannot setup
> network: Cannot find any PID under container
> "12a1a788b37dba2701942f0517236d608582a33d55f577737a20b5e23317fb78"
>
> pd: I posted also this question here:
> https://ask.openstack.org/en/question/88743/cannot-setup-network-cannot-find-any-pid-under-container/
> --
> Raimon Bosch
>
> This message and any attachment are confidential and transmitted for
>     the exclusive use of the intended recipient. It is prohibited for
>     anyone other than the recipient to read, copy, duplicate and/or
>     disclose the content to any third-person. Should you receive this
>     message by mistake, please delete it and contact the sender by
>     return e-mail.
>



-- 
Raimon Bosch

This message and any attachment are confidential and transmitted for
    the exclusive use of the intended recipient. It is prohibited for
    anyone other than the recipient to read, copy, duplicate and/or
    disclose the content to any third-person. Should you receive this
    message by mistake, please delete it and contact the sender by
    return e-mail.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20160222/66b78632/attachment.html>


More information about the Openstack mailing list