Skip to content

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

Open
@eherot

Description

@eherot

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions