Failed to register layer: Error processing tar file(exit status 1): Container ID 249512 cannot be mapped to a host ID


I’m unable to get my build to spin up and do it’s job. I’m using a custom public image, but every time I trigger a build, this error appears:

84b2f0957c8d: Verifying Checksum
84b2f0957c8d: Download complete
0c4b22baa4ab: Verifying Checksum
0c4b22baa4ab: Download complete
9eb42bc7d3af: Pull complete
8a585d4e5abf: Pull complete
failed to register layer: Error processing tar file(exit status 1): Container ID 249512 cannot be mapped to a host ID

I tried a couple of things, including using a different registry, removing all VOLUMEs, played around with chmod and other tweaks. Right now I have no clue what is wrong, maybe someone can give me a hint?

Error processing tar file(exit status 1): Container ID XXXXXX cannot be mapped to a host ID

As an example, using cpanm install Perl::Critic will break your container with our namespacing at this time. The best way to debug this is to incrementally build a container to see which command causes this error.

If you can share your Dockerfile (you can PM me), I can help you investigate.


I’m seeing the same issue with a pretty basic Dockerfile at



Line 13 is probably the culprit. I’ve started seeing issues installing global node modules that isn’t run with sudo. Using sudo will change the ownership to something acceptable in the system, like your own user or the node user.


Hey guys, I’ve invested some nerves and time into this.

The problem popped up when I was assembling a Docker image for the CI build process. One step was to download the Android SDK ZIP file from google, unzip/tar it and move it to /opt.

What I didn’t notice was that the tar command restored the uid and gids (it set them to 1000/1000 instead of root/root). After finding this out, I added a “chown -R root:root /opt” to the Dockerfile and the pull/build problem went away.

I’m not sure how this causes the problem in CircleCI, but having files set to the wrong uid/gid (possibly anything else than root) will confuse the spin up step as described in my initial post.

Here’s a Dockerfile snippet if someone at CircleCI feels like debugging it:


RUN cd /opt && wget -q -O android-sdk.tgz
RUN cd /opt && tar -xvzf android-sdk.tgz
RUN cd /opt && rm -f android-sdk.tgz


RUN cd /opt \
  && wget -q -O android-sdk.tgz \
  && tar -xvzf android-sdk.tgz \
  && rm -f android-sdk.tgz \
  && chown -R root:root /opt

If possible, I’d be curious/interested in some technical details in what is involved here so I can fully understand how this issue causes such a weird error and behavior during spinup.

Edit: Please note that this error seems to also appear (in a different form) when I use a simple vanilla docker setup and try to pull the affected image to a machine. Docker will pull a few of the images, then abort with an “authentication error” - which totally makes even less sense than what CircleCI says.

Hope that helps!



Hey, I’m seeing the same issue, can you give me permissions to PM you so I can send my build/dockerfile :slight_smile:


For others who run into this issue, we’ve added a page to our docs that describes it in more detail:

The end result will be that the image has to be rebuilt, with high UID/GID files corrected.

#8 is the correct link I believe.


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.