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

Docker file uploader generates unknown error with "pty": true #2581

Closed
avishefi opened this issue Aug 11, 2015 · 3 comments
Closed

Docker file uploader generates unknown error with "pty": true #2581

avishefi opened this issue Aug 11, 2015 · 3 comments

Comments

@avishefi
Copy link

Trying to upload a folder to a Docker builder using the following configuration (using "pty": true in builder config) generates an error during the upload step. Using packer -debug and PACKER_LOG=1 doesn't generate additional information that allows interrogating what's the real error.

With "pty": true

2015/08/11 16:44:13 packer-builder-docker: 2015/08/11 16:44:13 Executing in container eda3e9302bd9f7ce7db2fb49338954f5d264d0c9223a78ea0be5f22d6d0ccd56: "(set -e; mkdir -p /user/installer; command cp -R /packer-files/dirupload278569253/* /user/installer) >/packer-files/cmd578545728 2>&1; echo $? >/packer-files/cmd578545728-exit"
2015/08/11 16:44:15 ui: ==> docker: Killing the container: eda3e9302bd9f7ce7db2fb49338954f5d264d0c9223a78ea0be5f22d6d0ccd56
2015/08/11 16:44:16 ui error: Build 'docker' errored: Upload failed with non-zero exit status: 
2015/08/11 16:44:16 Builds completed. Waiting on interrupt barrier...
2015/08/11 16:44:16 machine readable: error-count []string{"1"}
2015/08/11 16:44:16 ui error: 
==> Some builds didn't complete successfully and had errors:
2015/08/11 16:44:16 machine readable: docker,error []string{"Upload failed with non-zero exit status: 1"}
2015/08/11 16:44:16 ui error: --> docker: Upload failed with non-zero exit status: 1
2015/08/11 16:44:16 ui: 

Without "pty": true

2015/08/11 16:41:37 packer-builder-docker: 2015/08/11 16:41:37 Executing in container 417994d683f9f9730adb0813a8a287df0a0ae9423270c59f3e33150469ee844a: "(set -e; mkdir -p /user/installer; command cp -R /packer-files/dirupload183934075/* /user/installer) >/packer-files/cmd639900062 2>&1; echo $? >/packer-files/cmd639900062-exit"
2015/08/11 16:41:39 packer-builder-docker: 2015/08/11 16:41:39 Waiting for exit code to appear for remote command...
2015/08/11 16:41:39 packer-builder-docker: 2015/08/11 16:41:39 Executed command exit status: 0

Packer template

{
    "builders": [{
        "type": "docker",
        "image": "...",
        "commit": true,
        "pty": true
    }],
    "provisioners": [
        {
            "type": "file",
            "source": "installer",
            "destination": "/user"
        },
        {
            "type": "shell",
            "script": "provision.sh"
        }
    ]
}
@cbednarski
Copy link
Contributor

Thanks for the report! I have not looked into this yet but I have a funny feeling we may need to suppress the pty option for this operation.

@iroller
Copy link

iroller commented Jul 19, 2016

Same issue here.

@mwhooker mwhooker added this to the v1.0 milestone Jan 22, 2017
@mwhooker
Copy link
Contributor

I think this will be resolved by #4186. After that gets merged, please open a new issue if you continue to see this

@ghost ghost locked and limited conversation to collaborators Apr 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants