dawson-org / dawson-cli

A serverless web framework for Node.js on AWS (CloudFormation, CloudFront, API Gateway, Lambda)
https://dawson.sh
GNU General Public License v3.0
712 stars 25 forks source link

Error when "path: false" in dawson 0.4+ #65

Closed lcasartelli closed 7 years ago

lcasartelli commented 7 years ago

The deploy command fails If you try with a non alphanumeric string or boolean (for example path: false).

lusentis commented 7 years ago

Can you provide a detailed error message? Thanks

lcasartelli commented 7 years ago
✔ running pre-deploy hook
 ✔ updating support stack
 ✔ creating bundle
 ✔ generating template
 ↓ removing stack policy [skipped]
 ✖ requesting changeset
   waiting for stack update to complete
   setting stack policy
   running post-deploy hook
[{ ValidationError: Template format error: Unresolved resource dependencies [MethodRootundefined] in the Resources block of the template
    at Request.extractError (/home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/protocol/query.js:40:29)
    at Request.callListeners (/home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/sequential_executor.js:105:20)
    at Request.emit (/home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/sequential_executor.js:77:10)
    at Request.emit (/home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/request.js:668:14)
    at Request.transition (/home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/request.js:22:10)
    at AcceptorStateMachine.runTo (/home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/state_machine.js:14:12)
    at /home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/state_machine.js:26:10
    at Request.<anonymous> (/home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/request.js:38:9)
    at Request.<anonymous> (/home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/request.js:670:12)
    at Request.callListeners (/home/luca/.nvm/versions/node/v7.1.0/lib/node_modules/dawson/node_modules/aws-sdk/lib/sequential_executor.js:115:18)
  message: 'Template format error: Unresolved resource dependencies [MethodRootundefined] in the Resources block of the template',
  code: 'ValidationError',
  time: 2016-11-25T15:45:50.330Z,
  requestId: '3ccf5ab1-b326-11e6-af41-47b4e4d9f758',
  statusCode: 400,
  retryable: false,
  retryDelay: 16.638128907077522,
  context: 
   { cloudfrontSettings: true,
     dangerDeleteResources: false,
     defs: 
      [ [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object],
        [Object] ],
     hostedZoneId: null,
     skip: false,
     stackName: 'pigeonapp-apiLuca',
     stageName: 'prod',
     appStage: 'luca',
     supportStackName: 'pigeonapp-apiSupport',
     acmCertificateArn: undefined,
     supportBucketName: '',
     bucketName: '',
     excludeList: [],
     indexFileContents: undefined,
     tempZipFile: '/tmp/danilo-zip1161025-22176-1lycxhw.ejfp4d9529',
     uuid: 'luca-bundle',
     tempZipFileSize: '12MB',
     zipS3Location: 
      { Bucket: '',
        Key: 'lambda-sources/luca-bundle.zip',
        VersionId: 'X8rp.cOa4NoWnKQiac2mn.rJm9ueZGIK' },
     cfParams: 
      { StackName: 'pigeonapp-apiLuca',
        Capabilities: [Object],
        Parameters: [],
        Tags: [Object],
        TemplateURL: '',
        StackPolicyBody: '{"Statement":[{"Effect":"Deny","Principal":"*","Action":["Update:Replace","Update:Delete"],"Resource":"*","Condition":{"StringEquals":{"ResourceType":["AWS::DynamoDB::Table","AWS::ApiGateway::RestApi","AWS::CloudFront::Distribution","AWS::S3::Bucket"]}}},{"Effect":"Allow","Principal":"*","Action":"Update:*","Resource":"*"}]}' } } }
]
lusentis commented 7 years ago

Found a bug: a empty method definition was being added to the DependsOn attribute of the deployment. I've implemented a fix and it's being published as 0.4.3.