Hudson Worden
Hudson Worden

Reputation: 2353

docker-compose up "ERROR: Error processing tar file(archive/tar: invalid tar header)

I am unable to run docker-compose up or docker-compose build --no-cache. Both exit with ERROR: Error processing tar file(archive/tar: invalid tar header).

I got myself into this situation by running

To stop and remove the containers:

docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)

To delete all the images:

docker rmi $(docker images -q)

I've tried the following:

I am running dockerd in debug mode and I'm seeing:

DEBU[0998] Calling GET /v1.22/images/codesource_buildbot/json 
ERRO[0998] Handler for GET /v1.22/images/codesource_buildbot/json returned error: No such image: codesource_buildbot

So it seems as though as I've managed to get docker into a strange state and can't get it back to a working state.

I've tried docker-compose down and that hasn't helped either.

Docker Version:

Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:14:09 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:14:09 2017
 OS/Arch:      linux/amd64
 Experimental: false

docker-compose version: docker-compose version 1.12.0, build b31ff33

docker-compose.yml

version: '2'
services:
  buildbot:
    build: ./containers/buildbot
    ports: 
      - "8010:8010"
    volumes:
      - "./containers/buildbot/volume:/code"

Dockerfile

FROM debian:latest
WORKDIR /home
RUN ["apt-get", "update"]
RUN ["apt-get", "install", "-y", "python-dev"]
RUN ["apt-get", "install", "-y", "python-pip"]
RUN ["apt-get", "install", "-y", "git-all"]
RUN ["pip", "install", "--upgrade", "pip"]
RUN ["pip", "install", "--ignore-installed", "six"]
RUN ["pip", "install", "service_identity"]
RUN ["pip", "install", "buildbot[bundle]"]
CMD bash wait_for_master.sh

Upvotes: 3

Views: 3871

Answers (2)

Dimitrios Desyllas
Dimitrios Desyllas

Reputation: 10124

Over a similar experience I had on the very same problem I just removed all the folders I had mounted as volumes. It happened over a Ubuntu GNU/Linux running machine.

For example if I had the following docker-compose.yml (taken from a personal project):

version: '2'
services:

 phpBB_dev:
  build:
    context: .
    dockerfile: Dockerfile
    args:
      XDEBUG_HOST: 172.17.0.1
      XDEBUG_PORT: 9021
      UID: 1000
      GID: 1000
  image: 'pcmagas/phpbb_dev'
  links:
    - mariadb
    - postgresql
  volumes:
    - "$SRC_PATH:/var/www/html:Z"
    - "$SRC_PATH_3_1_10:/var/www/phpBB_3_1_10:Z"
    - "$SRC_PATH_3_0_14:/var/www/phpBB_3_0_14:Z"

 nginx:
  image: nginx
  ports:
    - "5092:5092"
    - "5093:5093"
    - "5094:5094"
  links:
    - "phpBB_dev"
  volumes:
    - './nginx.conf:/etc/nginx/nginx.conf:ro'
    - './logs/dev/nginx:/var/logs'
  volumes_from:
    - 'phpBB_dev'

 mariadb:
  image: mariadb
  volumes:
    - './db/maria:/var/lib/mysql'
  ports:
    - '5434:5432'
  environment:
    MYSQL_RANDOM_ROOT_PASSWORD: "yes"
    MYSQL_ONETIME_PASSWORD: "yes"
    MYSQL_DATABASE: 'phpBB'
    MYSQL_USER: 'phpbb'
    MYSQL_PASSWORD: 'a_dummy_passwd'

 postgresql:
  image: postgres
  volumes:
    - './db/postgresql:/var/lib/postgresql/data'
  ports:
    - '3306:3306'
  environment:
    POSTGRES_DB: 'phpbb'
    POSTGRES_USER: 'phpbb'
    POSTGRES_PASSWORD: 'a_dummy_passwd'

I would remove the folders ./db where the mariadb and the postgresql stored the data. Also I would remove the ./logs where the nginx keeps its logs.

A good rule of thumb (for GNU/Linux or similar) is to follow theese steps:

Step1:

List all files & folders mounted as VOLUME and have owner root and group with ls -l command

Step2:

Then remove them with the rm -rf command

Upvotes: 0

Ricardo Branco
Ricardo Branco

Reputation: 6079

The error message states that the codesource_buildbot image doesn't exist. You have to rebuild it or add a proper build directive to your docker-compose.yml

EDIT:

PD: Your Dockerfile is a bit too convoluted. You could use:

FROM debian:latest WORKDIR /home RUN apt-get update && \ apt-get install -y python-dev \ python-pip \ git-all && \ pip install --upgrade pip && \ pip install --ignore-installed six && \ pip install service_identity && \ pip install buildbot[bundle] CMD bash wait_for_master.sh

I would add --no-cache-dir to the pip commands so the Zip files are not cached and the image is smaller.

Upvotes: 2

Related Questions