All of our builds started failing this morning with this error - We haven’t made any recent adjustments to our circleci configs
"CircleCI was unable to run the job runner because we were unable to execute commands in build container.
This typically means that the build container entrypoint or command is terminating the container prematurely, or interfering with executed commands. Consider clearing entrypoint/command values and try again."
I have tried a few things.
For my environment
If I disable the /sbin/init command the generic error message goes away, but my build still fails as the infrastructure is not up.
I believe that the problem lies with setting up of container.
I did try different containers but no luck yet. If i initiate all the processes the build fails.
Out of curiosity, did you all use the automated migration for the Circle v1 to v2 configuration? The two projects in different orgs running into this were both migrated that way, and I’m wondering if the images are still valid.
Yes I have exactly that image. It was working perfectly fine till yesterday.
The image in itself works fine. There is something funny going on when you initiate all the processes using
/sbin/init
If you remove that command the container will spin up correctly.
We use the same image (circleci/build-image:ubuntu-14.04-XXL-upstart-1189-5614f37) and started running into the same error today.
Removing the /sbin/init command allowed the container to spin up. The tests initially failed because Postgresql was no longer running, but we were able to manually start it with run: sudo service postgresql start. After this our tests passed again.
I don’t know why the container stopped running all of a sudden this morning, despite us having made no changes. But at least we’ve been able to work around the problem.
Unfortunately the reply from CircleCI wasn’t as helpful to identifying the root cause.
Thanks for your patience while we investigate this issue. In looking at your build link, it appears the image you are using circleci/build-image:ubuntu-14.04-XXL-* has not been updated in two years. This image was created to help users easily migrate from 1.0 to 2.0, but is bloated and does not offer the best performance as it is not maintained.
For better performance and regular updates, we suggest using one of the CircleCI prebuilt images (https://circleci.com/docs/2.0/circleci-images/). These images actively maintained and always updated with the latest releases and fixes.
Anyone have any luck with this yet? We have removed the /sbin/init command and manually started mysql but a few things aren’t working then like phpunit and behat testing.
I’m having the same problem… removing /sbin/init command makes the container start, but then the built-in services that we need to have running aren’t running.
It sounds like Circle is trying to encourage people to switch to one of their new pre-built images, but I’m trying to avoid that because our production server runs Ubuntu and I don’t see any pre-built images running Ubuntu on Circle’s list, and my CI suite would be less dependable running on a different OS from my application.
This was caused by a change to fix a bug with the mongodb service image, which was running into a problem with zombie processes.
The fix in this case was to run docker containers with the --init flag enabled, which causes docker to run a tini init process as PID1. We expected this not to cause any issues, but as it turns out, more people run init daemons inside their containers than we expected.
In most cases, your best bet for long term stability and upgrades will be to use a list of individually versioned containers that run the same versions of each dependency as your production system. CircleCI produces a number of pre-built containers for use, but we don’t restrict you to using those.
We will be looking into a way to support the mongodb container as well as containers which need to run their own init daemon, but until then I would recommend the following:
I removed the command: /sbin/init and now I am getting error for Redis. Please look at the image attached. As a workaround I tried command: ‘sudo redis-cli ping >/dev/null 2>&1 || sudo redis-server --daemonize yes’ and it sort of worked.
However, I am not sure using daemonize yes has any severe downside effects?
Please check the config file attached too.
Another option is to use a background step which runs redis without daemonizing - that has the added advtantage of making the stdout logs available to you.