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:
    10,784
    Likes Received:
    3,766
    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 Member

    Joined:
    Sep 26, 2013
    Messages:
    30
    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 Member

    Joined:
    Sep 26, 2013
    Messages:
    30
    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 I am confused: Can someone summarize what linux docker is ? Feb 11, 2018
Docker and Containers USB Docker image Dec 13, 2017
Docker and Containers cpuset-cpus to Constrain Docker Containers Nov 4, 2017
Docker and Containers Best way to stop all docker containers on a host Oct 11, 2017
Docker and Containers PSA docker system prune Jul 29, 2017

Share This Page