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 Image Problems with 0.11.1 #124

Open
ekristen opened this issue Mar 24, 2021 · 3 comments
Open

Docker Image Problems with 0.11.1 #124

ekristen opened this issue Mar 24, 2021 · 3 comments

Comments

@ekristen
Copy link

Attempting to build a docker image that contains this tool, however looks like 0.11.1 with the updated terraform provider runs into errors not being able to download the terraform provider even though there are no problems with the network.

failed to install provider (aws): registry service is unreachable

If the terraform provider is downloaded manually the following error occurs ...

failed to install provider (aws): open /root/.awsweeper/terraform-provider-aws_v3.16.0_x5: text file busy
Error: failed to launch provider (): fork/exec : no such file or directory

If I run 0.11.0 instead, everything works as expected.

@ekristen
Copy link
Author

Scratch that, can't get it to work with 0.11.0, I end up getting the following error even with the provider pre-downloaded

failed to install provider (aws): registry service is unreachable, check https://status.hashicorp.com/ for status updates
Error: failed to launch provider (): fork/exec : no such file or directory

@jckuester
Copy link
Owner

Hi @ekristen,

thanks for opening this issue.

can't get it to work with 0.11.0

v0.11.0 has a bug of using the wrong Terraform AWS Provider version v2.68.0; that's why I created v0.11.0 as a fix. This means that's awsweeper is not working with your pre-downloaded provider version v3.16.0, as it tries to download v2.68.0.

Using awsweeper v0.11.1 is correct and the error failed to install provider (aws): open /root/.awsweeper/terraform-provider-aws_v3.16.0_x5 is a current bug that I need to fix. It occurs as awsweeper doesn't close the running provider plugin binary properly in some cases so that it keeps running in the background. The current workaround is to kill the process manually with pkill terraform and then run awsweeper again.

TL;DR

  • use awsweeper v0.11.1
  • pre-download provider v3.16.0 to /root/.awsweeper/terraform-provider-aws_v3.16.0_x5
  • use pkill terraform if /root/.awsweeper/terraform-provider-aws_v3.16.0_x5: text file busy error occurs

Let me know if this helps!

@showerlee
Copy link

showerlee commented Mar 31, 2021

Hi @jckuester, looks I got this failed to install provider (aws): open /root/.awsweeper/terraform-provider-aws_v3.16.0_x5
intermittently for a few aws regions since I make a loop to perform the awsweeper v0.11.1 to each of specific regions in my Dockerfile.

for region in ${SWEEP_REGION[@]}
do
    echo ">>> Start sweeping in $region  <<<" 2>&1 | tee -a ${AWSWEEPER_LOG}
    ./bin/awsweeper --region $region ${!ACTION_MODE} ${AWSWEEPER_CFG} 2>&1 | tee -a ${AWSWEEPER_LOG}
    echo ">>> Finished sweeping in $region <<<" 2>&1 | tee -a ${AWSWEEPER_LOG}
done
>>> Start sweeping in ap-east-1  <<<

failed to install provider (aws): open /home/appuser/.awsweeper/terraform-provider-aws_v3.16.0_x5: text file busy
Error: failed to launch provider (): fork/exec : no such file or directory

>>> Finished sweeping in ap-east-1 <<<
>>> Start sweeping in ap-south-1  <<<

failed to install provider (aws): open /home/appuser/.awsweeper/terraform-provider-aws_v3.16.0_x5: text file busy
Error: failed to launch provider (): fork/exec : no such file or directory

>>> Finished sweeping in ap-south-1 <<<
...

Use pkill terraform would break the loop with exit 1, not sure if any alternative would fit my parttern.

Hope it gets fixed soon in the next release

Thanks in advance.

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

3 participants