Docker Image Pull Failure When Deploying n8n v2.4.4 on Cloud Run

Hello everyone,

I have been using Google Cloud Build to deploy the n8n project to Google Cloud Run without issues previously.

Recently, while preparing to upgrade n8n to version 2.4.4, the deployment process started failing during the Docker image pull step. Cloud Build is unable to pull the latest n8n image, causing the build and deployment to fail.

Previously, older versions of the image could be pulled and deployed successfully using the same Cloud Build configuration. No intentional changes were made to the pipeline or permissions prior to this issue.

Describe the problem/error/question

The error message is :

failed to register layer: Error processing tar file(exit status 1): archive/tar: invalid tar header

Share the output returned by the last node

starting build "da2c2d04-e88f-4cd2-9f10-a496ea645d1f"

FETCHSOURCE
From https://source.developers.google.com/p/project-id/r/n8n-image-v2
 * branch            e1ed204774e6f7b66aff08d2bfc1f7a517b8b627 -> FETCH_HEAD
HEAD is now at e1ed204 Change image version
GitCommit:
e1ed204774e6f7b66aff08d2bfc1f7a517b8b627
BUILD
Starting Step #0 - "Build"
Step #0 - "Build": Already have image (with digest): gcr.io/cloud-builders/docker
Step #0 - "Build": Sending build context to Docker daemon  3.072kB

Step #0 - "Build": Step 1/6 : FROM docker.n8n.io/n8nio/n8n:2.4.4
Step #0 - "Build": 2.4.4: Pulling from n8nio/n8n
Step #0 - "Build": bc0cdc8ecc2f: Pulling fs layer
Step #0 - "Build": 66d634619c1c: Pulling fs layer
Step #0 - "Build": f860243118e9: Pulling fs layer
Step #0 - "Build": 7ebb9aff85fe: Pulling fs layer
Step #0 - "Build": 218829d6d7f2: Pulling fs layer
Step #0 - "Build": 9cd9f54f6da2: Pulling fs layer
Step #0 - "Build": e628b015b66d: Pulling fs layer
Step #0 - "Build": 4f4fb700ef54: Pulling fs layer
Step #0 - "Build": fe3ed9201cc5: Pulling fs layer
Step #0 - "Build": ed1c5559bf52: Pulling fs layer
Step #0 - "Build": b5611758afce: Pulling fs layer
Step #0 - "Build": 4f4fb700ef54: Waiting
Step #0 - "Build": fe3ed9201cc5: Waiting
Step #0 - "Build": ed1c5559bf52: Waiting
Step #0 - "Build": b5611758afce: Waiting
Step #0 - "Build": e628b015b66d: Waiting
Step #0 - "Build": 9cd9f54f6da2: Download complete
Step #0 - "Build": f860243118e9: Verifying Checksum
Step #0 - "Build": f860243118e9: Download complete
Step #0 - "Build": bc0cdc8ecc2f: Verifying Checksum
Step #0 - "Build": bc0cdc8ecc2f: Download complete
Step #0 - "Build": 218829d6d7f2: Verifying Checksum
Step #0 - "Build": 218829d6d7f2: Download complete
Step #0 - "Build": 66d634619c1c: Verifying Checksum
Step #0 - "Build": 66d634619c1c: Download complete
Step #0 - "Build": 7ebb9aff85fe: Verifying Checksum
Step #0 - "Build": 7ebb9aff85fe: Download complete
Step #0 - "Build": 4f4fb700ef54: Verifying Checksum
Step #0 - "Build": 4f4fb700ef54: Download complete
Step #0 - "Build": ed1c5559bf52: Verifying Checksum
Step #0 - "Build": ed1c5559bf52: Download complete
Step #0 - "Build": b5611758afce: Verifying Checksum
Step #0 - "Build": b5611758afce: Download complete
Step #0 - "Build": e628b015b66d: Verifying Checksum
Step #0 - "Build": e628b015b66d: Download complete
Step #0 - "Build": fe3ed9201cc5: Verifying Checksum
Step #0 - "Build": fe3ed9201cc5: Download complete
Step #0 - "Build": failed to register layer: Error processing tar file(exit status 1): archive/tar: invalid tar header
Finished Step #0 - "Build"
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1

Dockerfile

FROM docker.n8n.io/n8nio/n8n:latest

USER root
RUN apk update && apk add --no-cache tzdata
ENV TZ=Asia/Bangkok
USER node

EXPOSE 5678

The error “archive/tar: invalid tar header” during the Docker image pull suggests an issue with the image itself or the way it’s being pulled. This can sometimes happen with corrupted image layers.

You could try pulling the image manually using `docker pull docker.n8n.io/n8nio/n8n:2.4.4` to see if that works. If that fails, it could indicate a problem with the n8n image on Docker Hub. If the manual pull works, then the issue might be in your Cloud Build configuration.

You might also want to check the n8n Docker Hub repository for any reported issues related to the 2.4.4 image.

Hi @Phraiphet_Hitakarun, welcome!

I’ve seen this error before, and the solution was to update Docker to the latest version:

Another note regarding youur Dockerfile, you are adding apk and this is no longer supported in the latest versions of n8n,

The solution is explained here:

Hi, I got the exact same problem as yours. And it’s solved.

It seems like this is not an issue with the n8n Docker image, but with the Cloud Build environment.
I tried building the image locally and it worked fine.

So I changed the Container Builder in Cloud Build configuration to Kaniko and it’s works for me.

Hope this help.

I changed the Cloud Run configuration in the image below.

It works!!!

1 Like

I had same problem with docker pull. I tried few PC/servers - and it worked on some of them. In my case update docker-ce resolved the issue.

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