atlantis icon indicating copy to clipboard operation
atlantis copied to clipboard

`atlantis testdrive` failed to create a tunnel even though `ngrok` is authenticated

Open thisjdzhang opened this issue 7 months ago • 2 comments

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Overview of the Issue

atlantis testdrive fails to create a secure tunnel even though ngrok is authenticated and configured with a valid token.

Reproduction Steps

ngrok config add-authtoken {your_token} then atlantis testdrive

Logs

solis-venv ❯ atlantis testdrive
Welcome to Atlantis testdrive!

This mode sets up Atlantis on a test repo so you can try it out. We will
- fork an example terraform project to your username
- install terraform (if not already in your PATH)
- install ngrok so we can expose Atlantis to GitHub
- start Atlantis

Press Ctrl-c at any time to exit


github.com username: {redacted}

To continue, we need you to create a GitHub personal access token
with "repo" scope so we can fork an example terraform project.

Follow these instructions to create a token (we don't store any tokens):
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-fine-grained-personal-access-token
- use "atlantis" for the token description
- add "repo" scope
- copy the access token

GitHub access token (will be hidden):
=> forking repo
=> fork completed!
=> terraform found in $PATH at /usr/local/bin/terraform
=> ngrok found in $PATH at /usr/local/bin/ngrok
=> creating secure tunnel
Error: creating ngrok tunnel: timeout, logs:
t=2025-05-20T16:49:47-0400 lvl=info msg="open config file" path=/var/folders/8c/7r9h5zl90yq4jd12zbt5k5z40000gp/T/atlantis-testdrive-ngrok-config3555034180 err=nil
t=2025-05-20T16:49:47-0400 lvl=info msg="starting web service" obj=web addr=localhost:41414 allow_hosts=[]
t=2025-05-20T16:49:48-0400 lvl=eror msg="failed to reconnect session" obj=tunnels.session err="authentication failed: Usage of ngrok requires a verified account and authtoken.\n\nSign up for an account: https://dashboard.ngrok.com/signup\nInstall your authtoken: https://dashboard.ngrok.com/get-started/your-authtoken\r\n\r\nERR_NGROK_4018\r\n"
t=2025-05-20T16:49:48-0400 lvl=eror msg="session closing" obj=tunnels.session err="authentication failed: Usage of ngrok requires a verified account and authtoken.\n\nSign up for an account: https://dashboard.ngrok.com/signup\nInstall your authtoken: https://dashboard.ngrok.com/get-started/your-authtoken\r\n\r\nERR_NGROK_4018\r\n"
t=2025-05-20T16:49:48-0400 lvl=info msg="received stop request" obj=app stopReq="{err:{Remote:true Inner:{Inner:0xc00069e1e0}} restart:false}"
t=2025-05-20T16:49:48-0400 lvl=eror msg="terminating with error" obj=app err="authentication failed: Usage of ngrok requires a verified account and authtoken.\n\nSign up for an account: https://dashboard.ngrok.com/signup\nInstall your authtoken: https://dashboard.ngrok.com/get-started/your-authtoken\r\n\r\nERR_NGROK_4018\r\n"
t=2025-05-20T16:49:48-0400 lvl=warn msg="failed to check for update" obj=updater err="Post \"https://update.equinox.io/check\": context canceled"
t=2025-05-20T16:49:48-0400 lvl=info msg="no more state changes" obj=tunnels.session
t=2025-05-20T16:49:48-0400 lvl=crit msg="command failed" err="authentication failed: Usage of ngrok requires a verified account and authtoken.\n\nSign up for an account: https://dashboard.ngrok.com/signup\nInstall your authtoken: https://dashboard.ngrok.com/get-started/your-authtoken\r\n\r\nERR_NGROK_4018\r\n"
ERROR:  authentication failed: Usage of ngrok requires a verified account and authtoken.
ERROR:
ERROR:  Sign up for an account: https://dashboard.ngrok.com/signup
ERROR:  Install your authtoken: https://dashboard.ngrok.com/get-started/your-authtoken
ERROR:
ERROR:  ERR_NGROK_4018
ERROR:  https://ngrok.com/docs/errors/err_ngrok_4018
ERROR:

Environment details

Additional Context

thisjdzhang avatar May 20 '25 21:05 thisjdzhang

Hello @thisjdzhang! I'm Dosu, a bot here to help you solve bugs, answer questions, and assist you in becoming a contributor. I'm ready to help while you wait for a human maintainer. Let's tackle your issue together!

To resolve the issue with atlantis testdrive failing to create a secure tunnel, ensure that the NGROK_AUTH_TOKEN environment variable is correctly set before running the command. You can do this by exporting the variable in your shell session:

export NGROK_AUTH_TOKEN=your_token_here

Additionally, make sure that your ngrok account is verified and that the authtoken is correctly installed. You can verify this by running:

ngrok config add-authtoken your_token_here

If the problem persists, check the logs for both Atlantis and ngrok for any error messages that might provide more insight into the issue [1].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

dosubot[bot] avatar May 20 '25 21:05 dosubot[bot]

Yea I ran ngrok config add-authtoken your_token_here and double checked I'm authorized with it.

thisjdzhang avatar May 22 '25 15:05 thisjdzhang

Same problem here -- ngrok is installed and authorized, and it works to create tunnels on my cli, but atlantis testdrive misses that

b- avatar Jul 13 '25 05:07 b-