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

Can no longer terragrunt apply with latest version inside a docker container #72

Open
imavroukakis opened this issue Jan 3, 2025 · 0 comments

Comments

@imavroukakis
Copy link

imavroukakis commented Jan 3, 2025

I am running plan inside our CI container in the latest version of the module (4.2.1) and I am getting a Python runtime not found error.

╷
│ Error: External Program Execution Failed
│ 
│   with module.tunnel-open-alert.module.cloudtrail-to-slack.module.lambda.data.external.archive_prepare[0],
│   on .terraform/modules/tunnel-open-alert.cloudtrail-to-slack.lambda/package.tf line 10, in data "external" "archive_prepare":
│   10:   program = [local.python, "${path.module}/package.py", "prepare"]
│ 
│ The data source received an unexpected error while attempting to execute
│ the program.
│ 
│ Program: /usr/bin/python3
│ Error Message: Traceback (most recent call last):
│   File "/builds/alerts/envs/sandbox/.terragrunt-cache/pBKM1yebe01OCi_wMCkS_mT1Myg/3j-9NBSYy0zYCrfs0LXAX1ZEi9M/modules/.terraform/modules/tunnel-open-alert.cloudtrail-to-slack.lambda/package.py", line 1628, in <module>
│     main()
│   File "/builds/alerts/envs/sandbox/.terragrunt-cache/pBKM1yebe01OCi_wMCkS_mT1Myg/3j-9NBSYy0zYCrfs0LXAX1ZEi9M/modules/.terraform/modules/tunnel-open-alert.cloudtrail-to-slack.lambda/package.py", line 1624, in main
│     exit(args.command(args))
│          ^^^^^^^^^^^^^^^^^^
│   File "/builds/alerts/envs/sandbox/.terragrunt-cache/pBKM1yebe01OCi_wMCkS_mT1Myg/3j-9NBSYy0zYCrfs0LXAX1ZEi9M/modules/.terraform/modules/tunnel-open-alert.cloudtrail-to-slack.lambda/package.py", line 1423, in prepare_command
│     build_plan = bpm.plan(source_path, query)
│                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
│   File "/builds/alerts/envs/sandbox/.terragrunt-cache/pBKM1yebe01OCi_wMCkS_mT1Myg/3j-9NBSYy0zYCrfs0LXAX1ZEi9M/modules/.terraform/modules/tunnel-open-alert.cloudtrail-to-slack.lambda/package.py", line 801, in plan
│     pip_requirements_step(pip_requirements, prefix,
│   File "/builds/alerts/envs/sandbox/.terragrunt-cache/pBKM1yebe01OCi_wMCkS_mT1Myg/3j-9NBSYy0zYCrfs0LXAX1ZEi9M/modules/.terraform/modules/tunnel-open-alert.cloudtrail-to-slack.lambda/package.py", line 675, in pip_requirements_step
│     raise RuntimeError(
│ RuntimeError: Python interpreter version equal to defined lambda runtime
│ (python3.10) should be available in system PATH
│ 
│ State: exit status 1
╵

I am 100% certain that the container has the correct Python runtime and is accessible via PATH

953eab93b4a5:/usr/app/deployment# python --version
Python 3.11.8

953eab93b4a5:/usr/app/deployment# which python
/usr/bin/python
953eab93b4a5:/usr/app/deployment# which python3
/usr/bin/python3
953eab93b4a5:/usr/app/deployment# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

Bizarrely, if I set the variable lambda_build_in_docker to true , plan passes, but naturally, apply fails

@imavroukakis imavroukakis changed the title Can no longer terraform apply with latest version , using a docker container Can no longer terragrunt apply with latest version , using a docker container Jan 3, 2025
@imavroukakis imavroukakis changed the title Can no longer terragrunt apply with latest version , using a docker container Can no longer terragrunt apply with latest version inside a docker container Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant