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

autopilot:deploy errors out with "Cannot read property 'startsWith' of undefined" #33

Open
yvesonline opened this issue Sep 21, 2020 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@yvesonline
Copy link

First of all great work with the autopilot plugin, I find it already very useful doing my first steps with Twilio Autopilot!

I'm running into an issue where autopilot:deploy gives me consistently a Cannot read property 'startsWith' of undefined.

The redacted (confidential information removed) output of twilio autopilot:deploy -l debug --override-existing-project --target function is:

  twilio-run:config:credentials Override value with .env ACCOUNT_SID value +0ms
  twilio-run:config:credentials Override value with .env AUTH_TOKEN value +1ms
  twilio-run:deploy Deploy Config %P {
  cwd: '/home/yves/****/function',
  envPath: '/home/yves/****/function/.env',
  username: 'AC****',
  password: '****',
  env: {},
  serviceSid: undefined,
  pkgJson: {
    name: '****',
    version: '0.0.0',
    private: true,
    scripts: { test: 'echo "Error: no test specified" && exit 1' },
    engines: { node: '8.10.0' },
    dependencies: { moment: '^2.24.0' }
  },
  overrideExistingService: true,
  force: undefined,
  serviceName: '****',
  functionsEnv: 'dev',
  functionsFolderName: undefined,
  assetsFolderName: undefined,
  noAssets: false,
  noFunctions: false,
  region: undefined,
  edge: undefined
} +0ms
⠋ Deploying Function  twilio-serverless-api:client Deploy config {
  twilio-serverless-api:client   cwd: '/home/yves/****/function',
  twilio-serverless-api:client   envPath: '/home/yves/****/function/.env',
  twilio-serverless-api:client   username: '[REDACTED]',
  twilio-serverless-api:client   password: '[REDACTED]',
  twilio-serverless-api:client   env: {},
  twilio-serverless-api:client   pkgJson: {
  twilio-serverless-api:client     name: '[REDACTED]',
  twilio-serverless-api:client     version: '[REDACTED]',
  twilio-serverless-api:client     private: '[REDACTED]',
  twilio-serverless-api:client     scripts: '[REDACTED]',
  twilio-serverless-api:client     engines: '[REDACTED]',
  twilio-serverless-api:client     dependencies: '[REDACTED]'
  twilio-serverless-api:client   },
  twilio-serverless-api:client   overrideExistingService: true,
  twilio-serverless-api:client   serviceName: '****',
  twilio-serverless-api:client   functionsEnv: 'dev',
  twilio-serverless-api:client   noAssets: false,
  twilio-serverless-api:client   noFunctions: false
  twilio-serverless-api:client } +0ms
  twilio-serverless-api:fs Search for directory. Options: "functions,src" +0ms
  twilio-serverless-api:fs Found Functions Directory "/home/yves/****/function/functions" +0ms
  twilio-serverless-api:fs Search for directory. Options: "assets,static" +0ms
  twilio-serverless-api:fs Found Assets Directory "undefined" +0ms
⠴ Creating Service
  twilio-serverless-api:services ClientApiError [TwilioApiError]: Service with this UniqueName already exists.
  twilio-serverless-api:services     at Object.<anonymous> (/home/yves/.twilio-cli/node_modules/@twilio-labs/serverless-api/dist/api/services.js:43:23)
  twilio-serverless-api:services     at Generator.throw (<anonymous>)
  twilio-serverless-api:services     at rejected (/home/yves/.twilio-cli/node_modules/@twilio-labs/serverless-api/dist/api/services.js:7:65)
  twilio-serverless-api:services     at processTicksAndRejections (internal/process/task_queues.js:97:5) {
  twilio-serverless-api:services   code: 20409,
  twilio-serverless-api:services   details: {
  twilio-serverless-api:services     code: 20409,
  twilio-serverless-api:services     message: 'Service with this UniqueName already exists.',
  twilio-serverless-api:services     more_info: 'https://www.twilio.com/docs/errors/20409',
  twilio-serverless-api:services     status: 409,
  twilio-serverless-api:services     request_url: 'https://serverless.twilio.com/v1/Services'
  twilio-serverless-api:services   }
⠋ Creating 1 Functions
  twilio-serverless-api:functions Uploading asset via form data with content-type "application/javascri✔ Serverless function successfully deployed
  twilio-run:deploy TypeError: Cannot read property 'startsWith' of undefined
  twilio-run:deploy     at /home/yves/.twilio-cli/node_modules/@dabblelab/plugin-autopilot/src/lib/serverless/deploy.js:92:104
  twilio-run:deploy     at Generator.next (<anonymous>)
  twilio-run:deploy     at fulfilled (/home/yves/.twilio-cli/node_modules/@dabblelab/plugin-autopilot/src/lib/serverless/deploy.js:4:58)
  twilio-run:deploy     at processTicksAndRejections (internal/process/task_queues.js:97:5) +16s
✖ Failed Deployment

│ ERROR 
│ 
│ Cannot read property 'startsWith' of undefined

What I have tried so far:

  • Running only twilio autopilot:deploy -l debug --override-existing-project --target model, works 🎉
  • Doing an twilio autopilot:init specifying account sid and auth token via -u and --auth-token, didn't change anything
  • Marking my current Twilio profile as active, didn't change anything

I'm a bit lost, what could be the issue? It looks like my account sid can't be found and as a matter of fact it's not in the config but this is just after a fresh twilio autopilot:init.

@tingiris
Copy link
Member

Hi @yvesonline, thanks for bringing this to our attention. We've are able to reproduce the error and we're working on a patch. Thanks again!

@tingiris tingiris added the bug Something isn't working label Sep 29, 2020
Mohammad-Khalid added a commit that referenced this issue Sep 30, 2020
Mohammad-Khalid added a commit that referenced this issue Sep 30, 2020
Mohammad-Khalid added a commit that referenced this issue Sep 30, 2020
Mohammad-Khalid added a commit that referenced this issue Sep 30, 2020
Mohammad-Khalid added a commit that referenced this issue Oct 1, 2020
Mohammad-Khalid added a commit that referenced this issue Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants