Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kompose build fails: unable to create tarball #656

Closed
surajssd opened this issue Jun 20, 2017 · 25 comments
Closed

kompose build fails: unable to create tarball #656

surajssd opened this issue Jun 20, 2017 · 25 comments
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@surajssd
Copy link
Member

kompose build fails: unable to create tarball

my kompose version

$ kompose version
0.7.0 (ee79612)

when doing local builds on repo https://github.com/pranavgore09/classico/tree/nodejs-service

~/git/classico [:9f03f9e|✚ 1] 
12:08 $ git branch 
* (HEAD detached at origin/nodejs-service)
  master

I have made changes to the docker-compose file to have my docker hub repo name, docker-compose file looks like this:

✔ ~/git/classico [:9f03f9e|✚ 1] 
12:03 $ cat docker-compose.yaml 
version: '2'
services:
  backend:
    image: docker.io/surajd/backend
    build:
      context: ./backend
  gateway:
    image: docker.io/surajd/pranav/gateway
    build:
      context: ./gateway
    ports:
      - "1111:1111"
  daily:
    image: docker.io/surajd/daily-backend
    build:
      context: ./daily-backend

running the kompose build command

~/git/classico [:9f03f9e|✚ 1] 
12:04 $ kompose up --provider openshift 
INFO Building image 'docker.io/surajd/backend' from directory 'backend' 
INFO Image 'docker.io/surajd/backend' from directory 'backend' built successfully 
INFO Pushing image 'surajd/backend:latest' to registry 'docker.io' 
INFO Multiple authentication credentials detected. Will try each configuration. 
INFO Attempting authentication credentials 'https://index.docker.io/v1/ 
INFO Successfully pushed image 'surajd/backend:latest' to registry 'docker.io' 
INFO Building image 'docker.io/surajd/daily-backend' from directory 'daily-backend' 
FATA Unable to build Docker container for service daily: Unable to create a tarball: archive/tar: write too long 

Since the build is big, so i cannot know what is happening in background whether it is stuck or going on.

@kadel
Copy link
Member

kadel commented Jun 20, 2017

It looks like this problem is caused by symlinks in the build directory. They are not handled properly

@surajssd
Copy link
Member Author

@kadel just a note this works if we use buildconfigs to do builds

@kadel
Copy link
Member

kadel commented Jun 20, 2017

yes, That makes sense as buildconfig is not creating tar.

The problem is with creating tar that gets sent to docker daemon, it doesn't handle symlinks properly

@kadel
Copy link
Member

kadel commented Jun 20, 2017

one of the possible solutions is described here https://stackoverflow.com/questions/38454850/getting-write-too-long-error-when-trying-to-create-tar-gz-file-from-file-and-d

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or @fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Dec 29, 2017
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jan 28, 2018
@cdrage cdrage closed this as completed Jan 29, 2018
@pvsousalima
Copy link

Hi guys I'm having the same issue as well. Here is my docker-compose.yml:

version: '2'

services:

    mongo:
        image: mongo:latest
        restart: always
        environment:
         - MONGO_INITDB_ROOT_USERNAME=user
         - MONGO_INITDB_ROOT_PASSWORD=password
        ports:
         - "27017:27017"

    notifier:
        restart: always
        build:
          context: ./Notifier
        image: staterecordsnotifications_notifier
        volumes:
          - ./Notifier:/opt/app
        ports:
          - "3001:3001"
        links:
          - mongo

and it returns
INFO Build key detected. Attempting to build and push image 'staterecordsnotifications_notifier'
INFO Building image 'staterecordsnotifications_notifier' from directory 'Notifier'
FATA Error while deploying application: k.Transform failed: Unable to build Docker image for service notifier: Unable to create a tarball: archive/tar: write too long

@GregSilverman
Copy link

I too am having the same issue. I do not have any symlinks, either.

@cdrage cdrage reopened this Apr 12, 2018
@Toflar
Copy link

Toflar commented Apr 24, 2018

Same here.

@kevinlmadison
Copy link

kevinlmadison commented May 18, 2018

No symlinks in my project, but still getting the same error. Anyone find another solution?
/remove-lifecycle rotten

@abhi608
Copy link

abhi608 commented Jun 2, 2018

Did any of you guys find a solution to this problem?

@Oliboy50
Copy link

Oliboy50 commented Jun 4, 2018

I was trying to do it in a nuxt project (javascript project) and got the same error

but after removing the node_modules and the .nuxt built directories, this worked like a charm

(on Mac OS X 10.11.6)

@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@alxvallejo
Copy link

@Oliboy50 Move where? Why would you move your node_modules dir

@Oliboy50
Copy link

@alxvallejo I said "remove" not "move", I just had to rm -rf node_modules and rebuild the docker image to let docker rebuild the node_modules itself

my issue seemed to be symlinks indeed

@skamansam
Copy link

skamansam commented Aug 27, 2018

Can anyone tell me WHY this is still an issue? I am getting the following, slightly-more-helpful-but-not-really kind of error:

WARN Volume mount on the host "...ux/data" isn't supported - ignoring path on the host
INFO Build key detected. Attempting to build and push image 'web:latest'
INFO Building image 'web:latest' from directory 'ux'
FATA Error while deploying application: k.Transform failed: Unable to build Docker image for service web: Unable to create a tarball: archive/tar: write too long

How long is this expected to wait, and how can I change it?

@iancrowther
Copy link

as @Oliboy50 has said.. remove your node_modules and build dirs and the tar will build.

In my case I had to rm -rf node_modules && rm -rf dist

@Bulletninja
Copy link

I don't even use node (i'm using django rest framework) and have the same error.

@oneguynick
Copy link

I don't even use node (i'm using django rest framework) and have the same error.

Had a similar issue and it was due to a .gitignore including .venv, but somehow the .venv still hanging out. Deleting it from the top level directory fixed it.

@juanjomarcal
Copy link

Same for me on a Ruby on Rails project.

@glacials
Copy link

You can run this to see if your directory has any symlinks:

ls -laR . | grep -B 5 " -> "

@darrylsepeda
Copy link

as @Oliboy50 has said.. remove your node_modules and build dirs and the tar will build.

In my case I had to rm -rf node_modules && rm -rf dist

I tried to remove node_modules and build dir, reinstall dependencies and rebuild the app then run kompose up, still got same error.

I'm using docker-compose v3, but even after I change to v2, still got same error.
I ran this command ls -laR . | grep -B 5 " -> " and found many dependencies from node_modules folder are using symlinks.

@hangyan
Copy link
Contributor

hangyan commented Jan 1, 2020

related to #1093

@tiadams
Copy link

tiadams commented Jun 19, 2020

Same issue, I am not building a node.js project nor do I have any symlinks in the build folder:

FATA Error while deploying application: k.Transform failed: Unable to build Docker image for service base: Unable to create a tarball: archive/tar: write too long 

@hubgit
Copy link

hubgit commented Jun 25, 2020

This may be exacerbated by #1278, which would explain why removing the node_modules and dist directories fixes it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests