twilio/twilio-cli

ngrok agent is not supported without an account - ERR_NGROK_120 - phone-numbers:update fails

brleinad opened this issue · 13 comments

Issue Summary

Running the twilio phone-numbers:update command doesn't work because of this issue.

I fixed the issue locally by cloning this repo and upgraded the ngrok dependency to 5.0.0-beta.1. It then works when I run ./bin/run phone-numbers:update .... I can open a PR with this fix but I don't know if the team is ok with a beta version for that package.

Steps to Reproduce

  1. Download the latest version of twilio and try following the instruction here

Exception/Log

> twilio --version
twilio-cli/5.8.1 darwin-x64 node-v18.16.0

> twilio phone-numbers:update "<phone-number>" --sms-url="http://localhost:1337/sms" -l debug
[DEBUG] Config File: /Users/danielrb/.twilio-cli/config.json
[DEBUG] Using profile: twi
[DEBUG] -- BEGIN Twilio API Request --
[DEBUG] get https://api.twilio.com/2010-04-01/Accounts/AC4a08610abcb955463aa8b52843d46f3b/IncomingPhoneNumbers.json
[DEBUG] Querystring:
[DEBUG] {"PhoneNumber":"+13512137601"}
[DEBUG] Custom HTTP Headers:
[DEBUG] User-Agent: twilio-cli/5.8.1 @twilio/cli-core/7.10.1 (darwin x64) twilio-node/4.11.1 node/v18.16.0 phone-numbers:update
[DEBUG] -- END Twilio API Request --
[DEBUG] response.statusCode: 200
[DEBUG] response.headers: {"date":"Mon, 29 May 2023 01:29:48 GMT","content-type":"application/json; charset=utf-8","content-length":"1786","connection":"close","twilio-request-id":"RQd1e223aed3f26d6612b8d691b0fb7ba9","twilio-request-duration":"0.177","access-control-allow-origin":"*","access-control-allow-headers":"Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, Idempotency-Key","access-control-allow-methods":"GET, POST, DELETE, OPTIONS","access-control-expose-headers":"ETag","access-control-allow-credentials":"true","x-powered-by":"AT-5000","twilio-concurrent-requests":"1","x-shenanigans":"none","x-home-region":"us1","x-api-domain":"api.twilio.com","strict-transport-security":"max-age=31536000"}
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=info msg="no configuration paths supplied"
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=info msg="ignoring default config path, could not stat it" path=/Users/danielrb/.ngrok2/ngrok.yml err="stat /Users/danielrb/.ngrok2/ngrok.yml: no such file or directory"
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=info msg="starting web service" obj=web addr=127.0.0.1:4040
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=info msg=start pg=/api/tunnels id=bd15aed6bd93618a
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=warn msg="ngrok is not yet ready to start tunnels" pg=/api/tunnels id=bd15aed6bd93618a err="a successful ngrok tunnel session has not yet been established"
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=info msg=end pg=/api/tunnels id=bd15aed6bd93618a status=503 dur=1.912605ms
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=info msg=start pg=/api/tunnels id=f0b896c43fde63c5
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=warn msg="ngrok is not yet ready to start tunnels" pg=/api/tunnels id=f0b896c43fde63c5 err="a successful ngrok tunnel session has not yet been established"
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=info msg=end pg=/api/tunnels id=f0b896c43fde63c5 status=503 dur=361.379µs
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=info msg=start pg=/api/tunnels id=3e983f64909b0999
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=warn msg="ngrok is not yet ready to start tunnels" pg=/api/tunnels id=3e983f64909b0999 err="a successful ngrok tunnel session has not yet been established"
t=2023-05-28T21:29:48-0400 lvl=info msg=end pg=/api/tunnels id=3e983f64909b0999 status=503 dur=179.238µs
[DEBUG] ngrok: t=2023-05-28T21:29:48-0400 lvl=info msg=start pg=/api/tunnels id=2496a5e5b856ad3d
[DEBUG] ngrok: t=2023-05-28T21:29:49-0400 lvl=warn msg="failed to start tunnel" pg=/api/tunnels id=2496a5e5b856ad3d err="session closed"
[DEBUG] ngrok: t=2023-05-28T21:29:49-0400 lvl=info msg=end pg=/api/tunnels id=2496a5e5b856ad3d status=502 dur=363.706367ms
t=2023-05-28T21:29:49-0400 lvl=eror msg="failed to auth" obj=tunnels.session err="Your ngrok agent version \"2\" is no longer supported. Only the most recent version of the ngrok agent is supported without an account.\nUpdate to a newer version with `ngrok update` or by downloading from https://ngrok.com/download.\nSign up for an account to avoid forced version upgrades: https://ngrok.com/signup.\r\n\r\nERR_NGROK_120\r\n"
t=2023-05-28T21:29:49-0400 lvl=eror msg="failed to reconnect session" obj=csess id=a97006975261 err="Your ngrok agent version \"2\" is no longer supported. Only the most recent version of the ngrok agent is supported without an account.\nUpdate to a newer version with `ngrok update` or by downloading from https://ngrok.com/download.\nSign up for an account to avoid forced version upgrades: https://ngrok.com/signup.\r\n\r\nERR_NGROK_120\r\n"
[DEBUG] Found command "phone-numbers:update" plugin: twilio-cli
 » twilio-cli encountered an unexpected error. To report this issue, execute the command with the "-l debug" flag, then copy the output to a new issue here: "https://github.com/twilio/twilio-cli/issues"
[DEBUG] Converting circular structure to JSON
    --> starting at object with constructor 'Socket'
    |     property '_httpMessage' -> object with constructor 'ClientRequest'
    --- property 'socket' closes the circle
[DEBUG] TypeError: Converting circular structure to JSON
    --> starting at object with constructor 'Socket'
    |     property '_httpMessage' -> object with constructor 'ClientRequest'
    --- property 'socket' closes the circle
    at JSON.stringify (<anonymous>)
    at NumberUpdate.createTunnel (/usr/local/Cellar/twilio/5.8.1/libexec/src/commands/phone-numbers/update.js:94:51)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async NumberUpdate.run (/usr/local/Cellar/twilio/5.8.1/libexec/src/commands/phone-numbers/update.js:48:9)
    at async NumberUpdate._run (/usr/local/Cellar/twilio/5.8.1/libexec/node_modules/@oclif/core/lib/command.js:80:22)
    at async Config.runCommand (/usr/local/Cellar/twilio/5.8.1/libexec/node_modules/@oclif/core/lib/config/config.js:301:25)
[DEBUG] ngrok: t=2023-05-28T21:29:49-0400 lvl=eror msg="session closing" obj=tunnels.session err="Your ngrok agent version \"2\" is no longer supported. Only the most recent version of the ngrok agent is supported without an account.\nUpdate to a newer version with `ngrok update` or by downloading from https://ngrok.com/download.\nSign up for an account to avoid forced version upgrades: https://ngrok.com/signup.\r\n\r\nERR_NGROK_120\r\n"
t=2023-05-28T21:29:49-0400 lvl=info msg="received stop request" obj=app stopReq="{err:0xc00017a0c0 restart:false}"
t=2023-05-28T21:29:49-0400 lvl=eror msg="terminating with error" obj=app err="Your ngrok agent version \"2\" is no longer supported. Only the most recent version of the ngrok agent is supported without an account.\nUpdate to a newer version with `ngrok update` or by downloading from https://ngrok.com/download.\nSign up for an account to avoid forced version upgrades: https://ngrok.com/signup.\r\n\r\nERR_NGROK_120\r\n"
t=2023-05-28T21:29:49-0400 lvl=crit msg="command failed" err="Your ngrok agent version \"2\" is no longer supported. Only the most recent version of the ngrok agent is supported without an account.\nUpdate to a newer version with `ngrok update` or by downloading from https://ngrok.com/download.\nSign up for an account to avoid forced version upgrades: https://ngrok.com/signup.\r\n\r\nERR_NGROK_120\r\n"
Your ngrok agent version "2" is no longer supported. Only the most recent version of the ngrok agent is supported without an account.
Update to a newer version with `ngrok update` or by downloading from https://ngrok.com/download.
Sign up for an account to avoid forced version upgrades: https://ngrok.com/signup.

ERR_NGROK_120

Technical details:

  • twilio-cli version: twilio-cli/5.8.1 darwin-x64
  • node version: node-v18.16.0
  • Command output with debug logging enabled (adding -l debug to the end of the command): see above ^^

Hi @brleinad, Thanks for the heads up!
This issue has been added to our internal backlog to be prioritised. Pull requests and +1s on the issue summary will help it move up the backlog.

@AsabuHere I'll open a pull request with my fix using version 5.0.0-beta.1 for the ngrok package.

@brleinad Can you please try running this command on Ngrok v3 version ?

@charan678 the way I understand it is that the Ngrok npm package version 4 uses the ngrok agent version 2 and to use the ngrok agent version 3 we need to use the ngrok npm package verion 5.0.0-beta.1. This is what I tried. The naming is confusing so I could be wrong.

See the issue here.

And see the package README:

This project is the Node.js wrapper for the ngrok client. Version 5 of this project uses ngrok client version 3. For ngrok client version 2, check out version 4.

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

+1

Also relabel: ngrok agent is not supported for TEST accounts - ERR_NGROK_120 - phone-numbers:update fails

I don't understand why you closed the PR if it works. At the very least it should have a comment as to why you closed it.

It seems like something that blocks people from deciding whether to buy your product would have a certain amount of priority. Failing demos tend to hurt sales.

@charan678 any update on this? It doesn't look like ngrok will be updating to a non-beta version any time soon and the CLI is broken without that update

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

+1 same issue here.

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.