Error: failed to register layer: Error processing tar file(exit status 1): unexpected EOF

Hi,

when pushing the project to balenaCloud an error occurs:
[Error] Some services failed to build:
[Error] Service: ab_edge
[Error] Error: failed to register layer: Error processing tar file(exit status 1): unexpected EOF

The project consists of my application, a redis container (pulled from official docker registry) and a custom image, hosted on third-party registry. This image is also the source of the problem, since I can push and build normally, if I comment out the custom image in docker-compose file.
I came across this article where it is said, that file permissions can have an effect (I checked if every file has the same user and permissions, and it seems they do) and also to prune existing images and restart docker service. Since all this is handled by balenCloud, this is not something I can do.
I have previously used this image in other application, where it built it 80% of the time (I got the same error, but I repeated the build process and it went through). In this application, it fails to build every time.
If it helps, first there was another error when getting the image:
x509: certificate has expired or is not yet valid
and was then fixed by the image maintainers. Since then, all I get is an EOF error.

hello @vidgeni,

would you mind sharing your docker-compose.yaml?

Looking into how the service should build can be a hint. You mentioned that, that service worked fine in previous applications of yours.

  • Were this projects also deployed on Balena?

  • Where you also using Docker Compose for that? If so, where there any significant differences on your .yaml file?

  • Which version of docker-compose are you using? (I’m curious because I had a case were this error was popping up, and using a compose version below 3 helped)

  • Have you tried just deploying this service on balenaCloud? (even if it doesn’t do anything on its own, but to check if it is a dependency problem, or definitely a service problem

  • Have you deployed this application locally? is there any Warnings during the build process?

Thanks for giving us as much input as possible, so we can get a better picture of what might be going on

Hi,
here is the docker-compose file:

version: '2'

services:
  app:
    privileged: true
    build: ./app
    restart: always
    depends_on: 
      - redis_global
    ports:
      - "8808:8808"
    volumes:
        - "keystore:/keystore"
    labels:
      io.balena.features.supervisor-api: '1'

  redis:
    image: arm32v7/redis
    command: ["redis-server", "--appendonly", "no", "--save", "''", "--maxmemory", "25mb", "--tcp-backlog", "128"]
    container_name: redis_db
    restart: unless-stopped

  ab_edge:
    image: hub.aceblock.com:5001/aceblock/edge-arm32v6:latest
    container_name: edge-0
    depends_on: 
      - app
    restart: always
    logging:
      options:
        max-size: "100m"
        max-file: "50"
    volumes:
      - "datastore:/storage/edge"
      - "keystore:/keystore"
      - "logs:/var/log"

volumes:
  keystore:
  datastore:
  logs:

As for your questions:

  • Were this projects also deployed on Balena?

Yes, I had another application on balena cloud as a test environment, where it run virtually the same code as the one with the problems. As said before, it ran ok, only occasionally throwing the same EOF error, but if I run the whole thing again it usually built it without errors.

  • Where you also using Docker Compose for that? If so, where there any significant differences on your .yaml file?

Yes, I was also using docker-compose, the only differences were the redis container run commands, which shouldn’t impact this problem

  • Which version of docker-compose are you using? (I’m curious because I had a case were this error was popping up, and using a compose version below 3 helped)

I had read something about version 2 being recommended, so I started with version 2 (I’ve never used anything other than v2)

  • Have you tried just deploying this service on balenaCloud? (even if it doesn’t do anything on its own, but to check if it is a dependency problem, or definitely a service problem

I will try deploying only this container, will report back as soon as I try it.

  • Have you deployed this application locally? is there any Warnings during the build process?

I have deployed manually on a raspberry pi before “containerising” everything and pushing it on balenaCloud. I’ve had some initial problems, but I’ve solved them with the image maintainers. I can try to deploy it again manually on a raspberry pi, if any errors pop up.

I will report back with results from deploying just offending container and manualy setting up the whole project locally.

Hi,

I tried deploying only the offending container via balenaCloud and the results were unsuccessful:

[Error]    Some services failed to build:=========================>  ] 94%
[Error]      Service: ab_edge
[Error]        Error: failed to register layer: Error processing tar file(exit status 1): unexpected EOF
[Info]     Built on arm02
[Error]    Not deploying release.

I also tried the deployment locally, without balena and the result is also an error, but a little different:

ERROR: filesystem layer verification failed for digest sha256:cf83b5c29e068b091b3028fc90178cebef793456b73e3ad68b08af84d96c115f 

For now it seems that there is a problem with the image itself, I will try to solve the problem with the image maintainer. I will write back here when I know more.