Docker run command is failing with "Container ID 20159 cannot be mapped to a host ID."

  • 9 September 2022
  • 0 replies
  • 22 views

Userlevel 3
Badge

Environment:

  • Data Collector Docker Image.

 

Issue: 

This has been observed that docker run command with any version of data collector image is failing with following error when the user has restrictions from OS side to, not to use higher UIDs.

#docker run -d -e datacollector:4.4.1
Unable to find image 'datacollector:4.4.1' locally
4.4.1: Pulling from datacollector
801bfaa63ef2: Pull complete
755713f1a3c1: Pull complete
eb3cc996a4d2: Pull complete
cc65d2e08110: Pull complete
a78edd797c42: Pull complete
2837f4f48b17: Extracting [==================================================>] 425.6 MB/425.6 MB
fb4a45fc2613: Download complete
ee56bb53e5ce: Download complete
47f24455e547: Download complete
e0e00f796eb2: Download complete
b134ff785401: Download complete
/usr/bin/docker-current: failed to register layer: Error processing tar file(exit status 1): Container ID 20159 cannot be mapped to a host ID.
See '/usr/bin/docker-current run --help'.

In the Data Collector v4.4.1 docker image, we’ve hardcoded the SDC_UID=20159 & SDC_GID=20159 and the user(schadmin is the user in this case) who is running the docker command does not have access to launch the image with such higher UID’s.

 

Resolution:

 

There are different ranges reserved in the Linux system and along with that Hadoop cluster services take some extra UIDs for the service users. The reason we use the 20159 is that it is above the default range and it should not conflict with any other service user UID in the cluster. 

This was easily reproducible and resolved by changing the uid and gid in the Linux configuration to the higher values.

Here is the configuration to fix the issue: 

 

  • Updated the subgid + subuid with correct values.
$ cat /etc/subgid
group1:984020:20200
schadmin:697679:20200
$ cat /etc/subuid
schadmin:697679:20200
schadmin:4200000:20200
  • Restart the docker service.
  • Pull the docker images with the same command.

This is more of an environment specific issue and needs to be look into from the Linux/docker side. All the data collector docker files are running fine if these UID’s are open.

Note: The recommended way is to check with the Linux/docker engineers internally before making any changes in configuration.


0 replies

Be the first to reply!

Reply