-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I'm using Azure Functions on macOS to build a Twilio app and I run it using func start (Azure Functions CLI), with the following output
...
Functions:
IncomingMessage: [POST] http://localhost:7071/api/IncomingMessage
MessageStatus: [POST] http://localhost:7071/api/MessageStatus
When I try to emulate a webhook request like this:
twilio webhook:invoke http://localhost:7071/api/IncomingMessage --no-signature
I get the following error:
» connect ECONNREFUSED ::1:7071
» 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-labs/plugin-webhook/issues"
Here's the output with debug logs:
[DEBUG] Config File: /Users/nswimberghe/.twilio-cli/config.json
[DEBUG] Using profile: Corp
[DEBUG] Signature: ""
[DEBUG] {"message":"connect ECONNREFUSED ::1:7071","name":"Error","stack":"Error: connect ECONNREFUSED ::1:7071\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1247:16)","config":{"transitional":{"silentJSONParsing":true,"forcedJSONParsing":true,"clarifyTimeoutError":false},"transformRequest":[null],"transformResponse":[null],"timeout":0,"xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"headers":{"Accept":"*/*","Content-Type":"application/x-www-form-urlencoded","Accept-Encoding":"gzip","I-Twilio-Idempotency-Token":"aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee","User-Agent":"TwilioProxy/1.1","X-Home-Region":"us1","X-Twilio-Signature":"","Content-Length":560},"method":"post","url":"http://localhost:7071/api/IncomingMessage","data":"AccountSid=[REDACTED]&AddOns=%7B+%22status%22%3A+%22successful%22%2C+%22message%22%3A+null%2C+%22code%22%3A+null%2C+%22results%22%3A+%7B+%7D+%7D&ApiVersion=2010-04-01&From=%2B15017122661&FromCity=SAN+FRANCISCO&FromCountry=US&FromState=CA&FromZip=94903&To=%2B15558675310&ToCity=SAN+FRANCISCO&ToCountry=US&ToState=CA&ToZip=94105&Body=Ahoy&MessageSid=SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&NumMedia=0&NumSegments=1&ReferralNumMedia=0&SmsMessageSid=SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&SmsSid=SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&SmsStatus=received"},"code":"ECONNREFUSED","status":null}
» connect ECONNREFUSED ::1:7071
[DEBUG] Found command "webhook:invoke" plugin: @twilio-labs/plugin-webhook
» 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-labs/plugin-webhook/issues"
[DEBUG] REQUEST_ERROR
[DEBUG] Error: REQUEST_ERROR
at InvokeCommand.run (/Users/nswimberghe/.twilio-cli/node_modules/@twilio-labs/plugin-webhook/src/commands/webhook/invoke.js:48:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async InvokeCommand._run (/Users/nswimberghe/.twilio-cli/node_modules/@oclif/core/lib/command.js:81:22)
at async Config.runCommand (/usr/local/lib/node_modules/twilio-cli/node_modules/@oclif/config/lib/config.js:173:24)
at async Main.run (/usr/local/lib/node_modules/twilio-cli/node_modules/@oclif/command/lib/main.js:27:9)
at async Main._run (/usr/local/lib/node_modules/twilio-cli/node_modules/@oclif/command/lib/command.js:43:20)
Manually sending an HTTP request using PowerShell works fine:
Invoke-WebRequest http://localhost:7071/api/IncomingMessage `
-Method POST `
-Body @{Body="Hello world!"} `
-ContentType "application/x-www-form-urlencoded"response is:
<?xml version="1.0" encoding="utf-8"?>
<Response>
<Message action="/api/MessageStatus" method="POST">You sent: Hello world!</Message>
</Response>Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working