elastic-ci-stack-for-aws: Intermittent docker error "could not find an available predefined network"
I see these on builds occasionally:
$ docker-compose -f docker-compose.yml -p buildkite9c0e505a3f5844e4bde33ee36c928627 run node pug-lint app/assets/javascripts
Creating network "buildkite9c0e505a3f5844e4bde33ee36c928627_default" with the default driver
ERROR: failed to parse pool request for address space "LocalDefault" pool "" subpool "": could not find an available predefined network
Here’s the Dockerfile I’m using:
FROM node:4.5.0
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY package.json /usr/src/app/
RUN npm install
RUN npm install -g eslint babel-eslint pug-lint
COPY . /usr/src/app
and the pipeline.yml:
steps:
- name: ":docker:"
plugins:
docker-compose:
build: node
- wait
- name: ":eslint:"
command: "eslint --cache app/assets/javascripts spec/javascripts"
plugins:
docker-compose:
run: node
- name: ":dog:"
command: "pug-lint app/assets/javascripts"
plugins:
docker-compose:
run: node
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 30 (18 by maintainers)
To give a bit of feedback on my experience with this exact error…
I’ve come across it both in buildkite and in my local development environments. It is indeed related to too many networks. We had 1-2 custom buildkite jobs which were using our own scripts for startup/shutdown and so we were leaving behind a few networks. As soon as we fixed those custom jobs, these errors went away 100%.
The limit seems to be ~30 (at least on my local machine) + bridge/host networks as can be seen in:
The fix for this is not related to buildkite at all, but if you wanted to fix this on the buildkite side you could periodically check for all networks, see if any jobs are currently running, and if not cleanup those orphaned networks.