0

i am trying to deploy a portainer/agent stack with the recommended docker compose configuration as suggested in the official documentation (https://portainer.readthedocs.io/en/stable/agent.html), and it deploys and runs correctly on all the nodes except for 1.

on the node that fails, i check the error and it says:

starting container failed: error creating external connectivity network: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network

this is strange because this is a latest installation of raspbian. and i have just installed docker using the script from the official raspberry pi website (https://www.raspberrypi.org/blog/docker-comes-to-raspberry-pi/). this is how docker has been set up on the other raspberry pi's too (the other raspberry pi's are working fine).

the docker compose file is:

version: '3.2'

services:
  agent:
    image: portainer/agent
    environment:
      AGENT_CLUSTER_ADDR: tasks.agent
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    ports:
      - target: 9001
        published: 9001
        protocol: tcp
        mode: host
    networks:
      - portainer_agent
    deploy:
      mode: global

networks:
  portainer_agent:
    driver: overlay

2 Answers 2

0

I think that this is a Docker issue, last time I hitted this error I had to reboot my Docker host to fix it and be able to create a container.

I was using an old version of Docker though, might have been fixed since.

1
  • i have rebooted many times and tried upgrading my docker version many times trying to figure this out.
    – X0r0N
    Jun 26, 2018 at 7:25
0

This will happen if you have used all the available networks in your pool of subnet spaces. For overlay networks, you can limit the available address pools with the --default-addr-pool option on docker swarm init which you'll see under the Swarm section of docker info. Once docker has allocated all the subnets from that pool, you'll need to delete networks to free up space in the pool (or create your swarm with a bigger pool, I'm not aware of a way to change this setting after creating the swarm).

Note that if a subnet is routeable, docker will treat it like an allocated network, so beware of things like VPN's that create a large route that includes all the private networks.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .