1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Docker Multiple IDs found with provided prefix

Discussion in 'Docker and Containers' started by Patrick, Aug 1, 2017.

  1. Patrick

    Patrick Administrator
    Staff Member

    Joined:
    Dec 21, 2010
    Messages:
    9,562
    Likes Received:
    3,032
    Has anyone ever seen "Error response from daemon: Multiple IDs found with provided prefix" before? I have run tens of thousands of Docker containers and never ran into that before.

    Here is where it happened:
    Code:
    [root@testf ~]# docker run -itd -e threads=6 servethehome/monero_dwarfpool:nproc
    de4c6f81b30f8b270440e54497667e226bd9f2f7455a62261b78d81874621d46
    [root@testf ~]# docker attach de4
    Error response from daemon: Multiple IDs found with provided prefix: de4c6f81b30f8b270440e54497667e226bd9f2f7455a62261b78d81874621d46
    [root@testf ~]# docker ps
    CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS              PORTS               NAMES
    de4c6f81b30f        servethehome/monero_dwarfpool:nproc   "/usr/local/bin/mo..."   19 seconds ago      Up 18 seconds                           tender_perlman
    
     
    #1
  2. sean

    sean New Member

    Joined:
    Sep 26, 2013
    Messages:
    28
    Likes Received:
    5
    Were there any stopped containers with the same prefix? "de4" is only three characters so I estimate after 75 containers, you will likely (>50%) have a collision between at least two containers.
     
    #2
  3. sean

    sean New Member

    Joined:
    Sep 26, 2013
    Messages:
    28
    Likes Received:
    5
    I wrote a quick script to start containers, seen below. I ran it four times and saw collisions after 42, 55, and 26 tries. One time I didn't get any collisions after 101 tries so I upped the maximum count. There's a 30% chance of not seeing it after 100 containers but less than 1% to not see it after 200 container.

    Code:
    #!/bin/sh
     
    for i in $(seq 200); do
        id=$(docker run -d docker.io/hello-world)
        short_id=${id:0:3}
        if ! docker inspect $short_id > /dev/null; then
            echo "$short_id collision; $i tries"
            break
        fi
    done
    Example output:
    Code:
    Error response from daemon: Multiple IDs found with provided prefix: 04c8331b22e144676b029305fe8a07790003d2abff00b45c9d428d8ee76f240a
    04c collision; 26 tries
     
    #3
Similar Threads: Docker Multiple
Forum Title Date
Docker and Containers PSA docker system prune Jul 29, 2017
Docker and Containers Does anyone use Kubernetes for their docker homelab setup? Jun 30, 2017
Docker and Containers Docker on different platforms, running containers differently? Jun 27, 2017
Docker and Containers Docker pause / unpause groups of containers based on Image May 24, 2017
Docker and Containers What are the best methods to work with Docker ? May 23, 2017

Share This Page