Unexpected environment preparation error


#1

I’m getting this error on the branch I created to test circle 2.0. I probably did something wrong in the config file :sweat_smile:

Unexpected environment preparation error: Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"process_linux.go:245: running exec setns process for init caused \\\"exit status 16\\\"\"\n"

https://circleci.com/gh/elegantthemes/submodule-builder/2671#tests/containers/0


#2

@lots0logs It seems related to your custom images. Could you share your Dockerfile(s)?

More specifically, it looks like your primary container is not accepting being the primary container.


#3

More specifically, it looks like your primary container is not accepting being the primary container.

Hmm…is there anything special that needs to be done in the container to ensure it will work properly? The images are on Docker Hub (autobuilds from github):


#4

@lots0logs I actually just proved myself wrong. I will keep looking.


#5

I think it might have something to do with my mariadb image. The container expects a data volume to be provided when its created with docker run. Is it possible to configure a data volume in the circle.yml for 2.0?


#6

No, data volumes are not supported at this time. Why does it need a volume? Alternatively, if we can not resolve this specific issue, we can add you to the Docker beta and you could try orchestrating the boxes as you would locally.


#7

That’s how the image I based it off of is set up. I should be able do without a volume. I’ll take a look at it later today. Thanks!


#8

I made some changes to the image but build still fails. I think what is happening is that the first container is exiting right away due to some error (which causes the other containers to fail with the weird error message from my first post). Is there any way to see the logs of the first container to determine what’s causing it to exit early?

Btw, here is the latest build that I tried: https://circleci.com/gh/elegantthemes/submodule-builder/2696


#9

Maybe the MariaDB startup time is causing a timing issue with your app. The MariaDB container seems to take a bit before it is accessible.


#10

You were right on the money. I added a sleep line to the first container’s startup script and it seems to have resolved this issue. I have a new issue now but I’ll start a new topic for it since its not related. Thanks! :slight_smile:


#11

Excellent news! Would it be possible to add a sample of the solution for others to reference?


#12

Well the solution is kind of specific to the docker image I’m using. Not sure if it will be helpful to anyone else but here’s the link just incase: https://github.com/lots0logs/circleci-wordpress/blob/master/Dockerfile#L10


#13

Thanks! :fireworks:


#14