twilio / twilio-cli

Unleash the power of Twilio from your command prompt
MIT License
162 stars 79 forks source link

ngrok tunnel errors #362

Closed cwalko closed 2 years ago

cwalko commented 2 years ago

Issue Summary

I'm a new trial user. Trying to work my way through your examples to send and reply to new text. The "send text" example worked great, the "Receive and reply to inbound SMS message is where things went wrong. I tried to open a ngrok tunnel. First, ngrok told me I had to upgrade to version 7 (done). Then I used the example CLI and got this message, after adding the debug: C:\WINDOWS\system32>twilio phone-numbers:update "+13343759320" --sms-url="https://localhost:5001/sms" -1 debug » Error: Unexpected arguments: -1, debug » See more help with --help

The tunnel will not open, I assume. I am trying to develop a "curbside pick up" app and the Texting replay by customers will be critical.

kridai commented 2 years ago

Hi @cwalko thanks for reaching out. Seeing the command and the error, it seems like debug command you added is incorrect. its -l (the alphabet) for logs instead of -1. Try running this twilio phone-numbers:update "+13343759320" --sms-url="https://localhost:5001/sms" -l debug. PS you can always run --help command like twilio phone-numbers:update --help to know about different args you can pass.

cwalko commented 2 years ago
    I’ll try that. Unfortunately my internet is down. 🤬
    Carl ***@***.***@roadrunner.com

 From: kridai @.***>Sent: Friday, January 7, 2022 3:33 AMTo: twilio/twilio-cliCc: cwalko; MentionSubject: Re: [twilio/twilio-cli] ngrok tunnel errors (Issue #362)  Hi @cwalko thanks for reaching out. Seeing the command and the error, it seems like debug command you added is incorrect. its -l (the alphabet) for logs instead of -1. Try running this twilio phone-numbers:update "+13343759320" --sms-url="https://localhost:5001/sms" -l debug. PS you can always run --help command like twilio phone-numbers:update --help to know about different args you can pass.

—Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android. You are receiving this because you were mentioned.Message ID: @.***>

cwalko commented 2 years ago

Kridai

Sorry, it took all day to get my internet back.

I did what you said and the debugger gave me this:

C:\Users\Administrator>twilio phone-numbers:update "+13343759320" --sms-url=https://localhost:5001/sms -l debug

[DEBUG] Config File: C:\Users\Administrator.twilio-cli\config.json

[DEBUG] Using profile: ${TWILIO_ACCOUNT_SID}/${TWILIO_AUTH_TOKEN}

[DEBUG] -- BEGIN Twilio API Request --

[DEBUG] GET https://api.twilio.com/2010-04-01/Accounts/AC6f5e17e7d600a07db8fa670ee01b60d 4/IncomingPhoneNumbers.json

[DEBUG] Querystring:

[DEBUG] {"PhoneNumber":"+13343759320"}

[DEBUG] Custom HTTP Headers:

[DEBUG] User-Agent: twilio-cli/2.36.1 @twilio/cli-core/5.33.0 (win32 x64) twilio-node/3.72.0 node/v17.3.0 phone-numbers:update

[DEBUG] -- END Twilio API Request --

[DEBUG] response.statusCode: 200

[DEBUG] response.headers: {"date":"Sat, 08 Jan 2022 02:13:59 GMT","content-type":"application/json; charset=utf-8","content-length":"1595","connection":"close","twilio-concurre nt-requests":"1","twilio-request-id":"RQcb77b25b72cfef67bbafb001e2d4434b","t wilio-request-duration":"0.113","access-control-allow-origin":"*","access-co ntrol-allow-headers":"Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since","access-control-allow-methods":"GET, POST, DELETE, OPTIONS","access-control-expose-headers":"ETag","access-control-allow-creden tials":"true","x-powered-by":"AT-5000","x-shenanigans":"none","x-home-region ":"us1","x-api-domain":"api.twilio.com","strict-transport-security":"max-age =31536000"}

[DEBUG] Found command "phone-numbers:update" plugin: twilio-cli

[DEBUG] ngrok response: {"errno":-4094,"code":"UNKNOWN","syscall":"spawn"}

[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] Cannot read properties of undefined (reading 'err')

[DEBUG] TypeError: Cannot read properties of undefined (reading 'err')

at NumberUpdate.createTunnel

(C:\Users\Administrator\AppData\Roaming\npm\node_modules\twilio-cli\src\comm ands\phone-numbers\update.js:95:38)

at processTicksAndRejections (node:internal/process/task_queues:96:5)

at async NumberUpdate.run

(C:\Users\Administrator\AppData\Roaming\npm\node_modules\twilio-cli\src\comm ands\phone-numbers\update.js:48:9)

at async NumberUpdate._run

(C:\Users\Administrator\AppData\Roaming\npm\node_modules\twilio-cli\node_mod @.***\command\lib\command.js:43:20)

at async Config.runCommand

(C:\Users\Administrator\AppData\Roaming\npm\node_modules\twilio-cli\node_mod @.***\config\lib\config.js:173:24)

at async Main.run

(C:\Users\Administrator\AppData\Roaming\npm\node_modules\twilio-cli\node_mod @.***\command\lib\main.js:27:9)

at async Main._run

(C:\Users\Administrator\AppData\Roaming\npm\node_modules\twilio-cli\node_mod @.***\command\lib\command.js:43:20)

Also, I've been following your Twilio Doc examples for C# Net Core. When I finished the "Created the a new controller" section, nothing shows up on my browser as a 'reply'. I went on to the next section (Configure you Webhook URL) thinking that maybe that was needed and got the error message above. Not sure it's related but thought I would share this info.

Please help as I'm excited to use this tool but my time frame for implementation is very short, less than a month. Thank you.

Carl Walko

Saint Mary Men's Club

From: kridai @.> Sent: Friday, January 7, 2022 3:34 AM To: twilio/twilio-cli @.> Cc: cwalko @.>; Mention @.> Subject: Re: [twilio/twilio-cli] ngrok tunnel errors (Issue #362)

Hi @cwalko https://github.com/cwalko thanks for reaching out. Seeing the command and the error, it seems like debug command you added is incorrect. its -l (the alphabet) for logs instead of -1. Try running this twilio phone-numbers:update "+13343759320" --sms-url="https://localhost:5001/sms" -l debug. PS you can always run --help command like twilio phone-numbers:update --help to know about different args you can pass.

- Reply to this email directly, view it on GitHub https://github.com/twilio/twilio-cli/issues/362#issuecomment-1007228110 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AMQ35QKKGZBKW3WPHNAONPLUU 2QPDANCNFSM5LNWQ52A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&m t=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=u tm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AMQ35QIZOSUYKNV6B6TX67LUU2QPDA5CNFS M5LNWQ52KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHQERJTQ .gif Message ID: @. @.> >

kridai commented 2 years ago

[DEBUG] ngrok response: {"errno":-4094,"code":"UNKNOWN","syscall":"spawn"} Is what I am looking at. Could be some config issue with ngrok. To give some detail here, when users provide localhost url for sms-url twilio-cli uses ngrok to generate a public url to expose the server. Which seems to be causing issue here for you. Could you try this step manually

cwalko commented 2 years ago

I’m slow I guess…

I rub the ngrok http https://localhost:5001 and this is what I get:

My problem comes in that I’m not sure what "http://example-url-123-123-13.ngrok.io/sms" in step two of you instructions are.?????

Carl

From: kridai @.> Sent: Saturday, January 8, 2022 12:23 PM To: twilio/twilio-cli @.> Cc: cwalko @.>; Mention @.> Subject: Re: [twilio/twilio-cli] ngrok tunnel errors (Issue #362)

[DEBUG] ngrok response: {"errno":-4094,"code":"UNKNOWN","syscall":"spawn"} Is what I am looking at. Could be some config issue with ngrok. To give some detail here, when users provide localhost url for sms-url twilio-cli uses ngrok to generate a public url to expose the server. Which seems to be causing issue here for you. Could you try this step manually

— Reply to this email directly, view it on GitHub https://github.com/twilio/twilio-cli/issues/362#issuecomment-1008070522 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AMQ35QKR7DP7RW5HYAETUTDUVBXILANCNFSM5LNWQ52A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AMQ35QOGNSQ5XVO24HGXFBDUVBXILA5CNFSM5LNWQ52KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOHQK666Q.gif Message ID: @. @.> >

kridai commented 2 years ago

To check the ngrok external address. run command ngrok http 5001 the output would be something like this

Session Expires               1 hour, 59 minutes
Version                       2.3.40
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://7303-183-83-46-138.ngrok.io -> http://localhost:5001
Forwarding                    https://7303-183-83-46-138.ngrok.io -> http://localhost:5001

Connections                   ttl     opn     rt1     rt5     p50     p90
                              0       0       0.00    0.00    0.00    0.00 

here you would need the forwarding address which is https://7303-183-83-46-138.ngrok.io in the above example. This is what I meant by http://example-url-123-123-13.ngrok.io This we need to replace in --sms-url. you could ref to this : https://www.youtube.com/watch?v=oy13mDsXC4s this talks about Localhost Tunneling with Ngrok on Mac OS X. Process should be similar for windows env as well.

JenniferMah commented 2 years ago

Closing due to inactivity. Please open a new github issue if you still need help.