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

dev-phone: Failed to upload Function Sync Call History #195

Open
eherot opened this issue Feb 21, 2024 · 1 comment
Open

dev-phone: Failed to upload Function Sync Call History #195

eherot opened this issue Feb 21, 2024 · 1 comment

Comments

@eherot
Copy link

eherot commented Feb 21, 2024

The following error is thrown during startup on the twilio/twilio-cli:5.18.0 docker container:

...

πŸ’» Deploying a Functions Service to handle incoming calls and SMS...
πŸ§‘β€πŸ’» Creating Service
πŸ§‘β€πŸ’» Configuring bare environment
πŸ§‘β€πŸ’» Creating 4 Functions
πŸ§‘β€πŸ’» Uploading 4 Functions
2024-02-22T22:28:38.604Z twilio-serverless-api:functions Uploading asset via form data with content-type "application/javascript"
2024-02-22T22:28:38.606Z twilio-serverless-api:functions Uploading asset via form data with content-type "application/javascript"
2024-02-22T22:28:38.607Z twilio-serverless-api:functions Uploading asset via form data with content-type "application/javascript"
2024-02-22T22:28:38.609Z twilio-serverless-api:functions Uploading asset via form data with content-type "application/javascript"
2024-02-22T22:28:38.883Z twilio-serverless-api:functions ClientApiError [HTTPError]: Response code 401 (Unauthorized)
    at /root/.twilio-cli/node_modules/@twilio-labs/serverless-api/dist/api/functions.js:133:23
    at Generator.throw (<anonymous>)
    at rejected (/root/.twilio-cli/node_modules/@twilio-labs/serverless-api/dist/api/functions.js:7:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 401,
  url: 'https://serverless-upload.twilio.com/v1/Services/ZS239a62fb7dd57e87a5e8c633ae80a11f/Functions/ZHfb0143397df6f290aabdc64bc31c5411/Versions'
}
Error: Failed to upload Function Incoming Call Handler
    at /root/.twilio-cli/node_modules/@twilio-labs/serverless-api/dist/api/functions.js:134:19
    at Generator.throw (<anonymous>)
    at rejected (/root/.twilio-cli/node_modules/@twilio-labs/serverless-api/dist/api/functions.js:7:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
[DEBUG] Found command "dev-phone" plugin: @twilio-labs/plugin-dev-phone
 Β» 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/dev-phone/issues"
[DEBUG] Issue deploying functions. Try again later
[DEBUG] Error: Issue deploying functions. Try again later
    at /root/.twilio-cli/node_modules/@twilio-labs/plugin-dev-phone/dist/utils/create-serverless-util.js:82:19
    at Generator.throw (<anonymous>)
    at rejected (/root/.twilio-cli/node_modules/@twilio-labs/plugin-dev-phone/dist/utils/create-serverless-util.js:6:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Error: EEXIT: 1
    at Object.exit (/root/.twilio-cli/node_modules/@oclif/core/lib/errors/index.js:22:11)
    at DevPhoneServer.exit (/root/.twilio-cli/node_modules/@oclif/core/lib/command.js:95:23)
    at DevPhoneServer.catch (/root/.twilio-cli/node_modules/@twilio/cli-core/src/base-commands/base-command.js:91:12)
    at DevPhoneServer.catch (/root/.twilio-cli/node_modules/@twilio/cli-core/src/base-commands/twilio-client-command.js:76:23)
    at DevPhoneServer._run (/root/.twilio-cli/node_modules/@oclif/core/lib/command.js:84:29)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Config.runCommand (/twilio/node_modules/@oclif/core/lib/config/config.js:301:25)

But the "Incoming Call Handler" function does seem to be getting created in what appears to be its entirety (in fact if I let this run long enough it will eventually start erroring with "too many services")...

UPDATE: So after manually updating @twilio-labs/serverless-api/dist/api/functions.js in place to add a log line right after the client.request('post' what I can see is that it is never reaching that point for any uploaded function. So somehow the function is being stored in the account but the request returns 401.

@ayyrickay
Copy link
Collaborator

To be honest I'm pretty confused about what could be happening here. Have you tried doing this with different Twilio credentials? Additionally, is this a trial account? I'm not sure, but it comes to mind as something that might be an issue while creating/interacting with resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants