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

Pipeline - unable to build in docker #178

Open
mliner opened this issue Jul 15, 2021 · 2 comments
Open

Pipeline - unable to build in docker #178

mliner opened this issue Jul 15, 2021 · 2 comments

Comments

@mliner
Copy link

mliner commented Jul 15, 2021

Description

I have a CI/CD pipeline created in Bitbucket. I want to create a package (build in docker) and deploy it. However I am getting the following issue (might apply to Github actions as well):

│ Error running command
│ 'builds/b18acc5a06f2696c9788ce422024d46dd8aad9c0f34d4c5b44b66585ad81d7cd.plan.json':
│ exit status 1. Output: zip: creating
│ 'builds/b18acc5a06f2696c9788ce422024d46dd8aad9c0f34d4c5b44b66585ad81d7cd.zip'
│ archive
│ Installing python requirements:
│ modules/lambda-delete-default-resources/src/requirements.txt
│ > mktemp -d terraform-aws-lambda-XXXXXXXX #
│ /tmp/terraform-aws-lambda-2zn5r3x_
│ > cd /tmp/terraform-aws-lambda-2zn5r3x_
│ > docker run --rm -v /tmp/terraform-aws-lambda-2zn5r3x_:/var/task:z -v
│ /root/.ssh/known_hosts:/root/.ssh/known_hosts:z
│ lambci/lambda:build-python3.8 /bin/sh -c 'python3.8 -m pip install
│ --no-compile --prefix= --target=. --requirement=requirements.txt && chown
│ -R 0:0 .'
│ docker: Error response from daemon: authorization denied by plugin
│ pipelines: -v only supports $BITBUCKET_CLONE_DIR and its subdirectories.

This means that docker command is trying to access folder not available in bitbucket pipeline. Locally on my laptop it is working without any issues.
When I did a small code check I can see in package.py that you are always adding this inpiut into docker_cmd
https://github.com/terraform-aws-modules/terraform-aws-lambda/blob/master/package.py#:~:text=home%20%3D%20os.environ,%5D)

However for cases when you don't want to use SSH including .ssh/known_hosts is not required correct?

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

  • Terraform:
    1.0.1
  • Provider(s):
    provider registry.terraform.io/hashicorp/aws v3.45.0
    provider registry.terraform.io/hashicorp/external v2.1.0
    provider registry.terraform.io/hashicorp/local v2.1.0
    provider registry.terraform.io/hashicorp/null v3.1.0
    provider registry.terraform.io/hashicorp/random v3.1.0
    provider registry.terraform.io/kreuzwerker/docker v2.14.0
  • Module:
    2.7.0

Reproduction

Steps to reproduce the behavior:

NO

Code Snippet to Reproduce

Expected behavior

It should be able to build the package and deploy the software to AWS. Locally working without any issues.

Actual behavior

Terminal Output Screenshot(s)

Additional context

@Ranchman42
Copy link

I am running into a similar issue with github actions. I ran into this on localhost ubuntu 20.04 as well, but was able to work-around it by running apply twice, the first would always fail and the second would work.

@mwiede
Copy link

mwiede commented Oct 12, 2022

I created #352 which makes it possible to handle volume problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants