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

atlantis testdrive does not work with ngrok paid account #5174

Open
gladykov opened this issue Dec 16, 2024 · 1 comment
Open

atlantis testdrive does not work with ngrok paid account #5174

gladykov opened this issue Dec 16, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gladykov
Copy link

gladykov commented Dec 16, 2024

When running atlantis testdrive with credentials for ngrok paid acocunt, it will fail:

> sudo NGROK_AUTHTOKEN=<token> ./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: <username>

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/bin/ngrok
=> creating secure tunnel
=> started tunnel!
Error: getting tunnel url: Get "http://localhost:41414/api/tunnels": dial tcp [::1]:41414: connect: connection refused

Underlying error:

ERROR: failed to start tunnel: Your account is on the 'Pay-as-you-go' plan, which requires you to register a Domain or TCP Address through the ngrok Dashboard before starting an Endpoint. Visit https://dashboard.ngrok.com/domains, for HTTP and TLS endpoints, or https://dashboard.ngrok.com/tcp-addresses, for TCP endpoints, to register a domain or address. Then use the `--domain` flag when starting an HTTP or TLS tunnel with your Agent. For TCP tunnels, use `--remote_addr`.

@gladykov gladykov added the bug Something isn't working label Dec 16, 2024
Copy link

dosubot bot commented Dec 16, 2024

Hey there, @gladykov! I'm here to help you out with any bugs, questions, or contributions you need assistance with. Let's tackle this issue together!

The error you're encountering is due to the requirements of ngrok's "Pay-as-you-go" plan, which mandates registering a domain or TCP address before starting a tunnel. To resolve this, you need to modify the atlantis testdrive command to include the necessary ngrok flags for your paid account.

Here's what you can do:

  1. Register a Domain or TCP Address: Go to the ngrok dashboard and register a domain or TCP address as required by your plan.

  2. Modify the Atlantis Code: You will need to adjust the code in testdrive/testdrive.go to pass the --domain or --remote_addr flag when starting the ngrok tunnel. This involves editing the part of the code where the ngrok command is executed:

    cancelNgrok, ngrokErrors, err := execAndWaitForStderr(&wg, tunnelReadyLog, tunnelTimeout,
        ngrokPath, "start", "atlantis", "--config", ngrokConfigFile.Name(), "--log", "stderr", "--log-format", "term", "--domain", "<your-registered-domain>")

    Replace "<your-registered-domain>" with the domain you registered.

  3. Rebuild and Test: After making these changes, rebuild the Atlantis binary and test the atlantis testdrive command again.

This should allow you to use your ngrok paid account with Atlantis by specifying the required domain or TCP address.

To continue talking to Dosu, mention @dosu.


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant