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

Template Validation Failing with v1.60.3 #7133

Closed
justinrcs opened this issue Dec 23, 2019 · 3 comments · Fixed by mikaelvesavuori/serverless-graphql-api-gcp#4
Closed

Template Validation Failing with v1.60.3 #7133

justinrcs opened this issue Dec 23, 2019 · 3 comments · Fixed by mikaelvesavuori/serverless-graphql-api-gcp#4
Assignees
Labels

Comments

@justinrcs
Copy link

Bug Report

Description

  1. What did you do?
    Updated deploy container to use serverless version 1.60.3
    Deploy serverless application via CI/CD process

  2. What happened?
    Deploy fails validation step:

Error: The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [0] in the Resources block of the template
at provider.request.catch.error (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/validateTemplate.js:20:13)

  1. What should've happened?
    API should have passed validation and been deployed.
    Previous versions (1.60.0 was the last release tested) have worked.
    No code or configuration changes were made when the error occurred.
    Reverting back to 1.60.0 succeeds without any modifications
    Attempted to disable (comment-out) all plugins being used, same error occurs.

  2. What's the content of your serverless.yml file?

service:
  name: RaptorOrganizationAPI
plugins:
- serverless-offline
- serverless-openapi-documentation
- serverless-newrelic-lambda-layers
- serverless-api-gateway-caching
custom:
  base_path: /organization
  stage: ${opt:stage, self:provider.stage}
  apiGatewayCaching:
    enabled: false
  newRelic:
    cloudWatchFilter:
      - "NR_LAMBDA_MONITORING"
      - "Task timed out"
  envProfile:
    build:
      region: us-east-1
      dbnotify: *redacted*
      consulUrl: *redacted*
      consulUriKey: *redacted*
      consulDbKey: *redacted*
      consulDbReleaseCountKey: *redacted*
      oktaApplicationID:*redacted*
      docbucket: *redacted*
      secondary: us-west-2
    local:
      region: us-east-1
      dbnotify: *redacted*
      consulUrl: *redacted*
      consulUriKey: *redacted*
      consulDbKey: *redacted*
      consulDbReleaseCountKey:*redacted*
      oktaApplicationID:*redacted*
      docbucket: *redacted*
    dev:
      region: us-east-1
      cluster: dev
      role: *redacted*
      bucket: *redacted*
      docbucket: rcs-raptor-schema-dev
      dbnotify: *redacted*
      deployUrl: *redacted*
      ecr:*redacted*
      consulUrl: *redacted*
      oktaApplicationID: *redacted*
      stationDeploy: dev
      consulUriKey: *redacted*
      consulDbKey: *redacted*
      consulDbReleaseCountKey: *redacted*
      proxy_url: *redacted*
      get_job_lambda: RaptorJobAPI-dev-getJob
      create_job_lambda: RaptorJobAPI-dev-createJob
      replay_job_lambda: RaptorJobAPI-dev-replayJob
      put_job_lambda: RaptorJobAPI-dev-putJob
      patch_job_lambda: RaptorJobAPI-dev-patchJob
      get_asset_lambda: RaptorAssetAPI-dev-getAsset
      get_org_lambda: RaptorOrganizationAPI-dev-getOrganization
      get_all_org_lambda: RaptorOrganizationAPI-dev-getAllOrganizations
      update_org_lambda: RaptorOrganizationAPI-dev-updateOrganization
      import_asset_lambda: RaptorImportAPI-dev-importAssetJob
      get_storage_lambda: RaptorContentManagementAPI-dev-fileStoreInfo
      import_bucket: *redacted*
      import_asset_bucket: *redacted*
      import_assetevent_bucket: *redacted*
      chartRepo: *redacted*
      apiUrl: *redacted*
      concurrency_standard: 1
      concurrency_high: 2
      apiProxy: *redacted*
      secondary: us-west-2
      secondary_domain: *redacted*
      secondary_ecr: *redacted*
      secondary_deployUrl: *redacted*
      import_image: *redacted*
      filler_image: *redacted*
      gssync_image: *redacted*
      copyplaylist_job_image: *redacted*
      copyplaylist:latest
      host: *redacted*
      subnetIds:
      - subnet-*redacted*
      securityGroupIds:
      - sg-*redacted*
  documentation:
    version: '1'
    title: RCS Raptor Organization API
    description: 'Serverless API Documentation, Raptor Organization'
    models:
    - name: OrganizationModel
      description: 'Organization Schema: https://s3.amazonaws.com/${self:custom.envProfile.${opt:stage, self:provider.stage}.docbucket}/v1/RaptorComplete.schema.json#/definitions/RaptorOrganization'
      contentType: application/json
      schema:
        $schema: https://s3.amazonaws.com/${self:custom.envProfile.${opt:stage, self:provider.stage}.docbucket}/v1/RaptorComplete.schema.json#/definitions/RaptorOrganization
    - name: MessageResponseModel
      description: 'Error response from API calls: https://s3.amazonaws.com/${self:custom.envProfile.${opt:stage, self:provider.stage}.docbucket}/v1/RaptorComplete.schema.json#/definitions/RaptorAPIMessageResponse'
      contentType: application/json
      schema:
        $schema:https://s3.amazonaws.com/${self:custom.envProfile.${opt:stage, self:provider.stage}.docbucket}/v1/RaptorComplete.schema.json#/definitions/RaptorAPIMessageResponse
    - name: IntegerModel
      description: integer
      contentType: application/json
      schema:
        type: integer
provider:
  name: aws
  logs:
    restApi:
      accessLogging: false
      executionLogging: true
      level: INFO
      fullExecutionData: true
  runtime: nodejs10.x
  versionFunctions: false
  region: ${self:custom.envProfile.${opt:stage, self:provider.stage}.region}
  role: ${self:custom.envProfile.${opt:stage, self:provider.stage}.role}
  deploymentBucket:
    name: ${self:custom.envProfile.${opt:stage, self:provider.stage}.bucket}
  vpc:
    securityGroupIds: ${self:custom.envProfile.${opt:stage, self:provider.stage}.securityGroupIds}
    subnetIds: ${self:custom.envProfile.${opt:stage, self:provider.stage}.subnetIds}
  stage: local
  environment:
    CONSUL_TOKEN: ${env:CONSUL_TOKEN}
    CONSUL_URL: ${self:custom.envProfile.${opt:stage, self:provider.stage}.consulUrl}
    CONSUL_URI_KEY: ${self:custom.envProfile.${opt:stage, self:provider.stage}.consulUriKey}
    CONSUL_DB_KEY: ${self:custom.envProfile.${opt:stage, self:provider.stage}.consulDbKey}
    CONSUL_DB_RELEASE_COUNT_KEY: ${self:custom.envProfile.${opt:stage, self:provider.stage}.consulDbReleaseCountKey}
    DOCBUCKET: ${self:custom.envProfile.${opt:stage, self:provider.stage}.docbucket}
    OKTA_APPLICATION_ID: ${self:custom.envProfile.${opt:stage, self:provider.stage}.oktaApplicationID}
    DBNOTIFY_SERVER: ${self:custom.envProfile.${opt:stage, self:provider.stage}.dbnotify}
    K8_API_PROXY: ${self:custom.envProfile.${opt:stage, self:provider.stage}.apiProxy}
    PRIMARY: ${self:custom.envProfile.${opt:stage, self:provider.stage}.region}
    SECONDARY: ${self:custom.envProfile.${opt:stage, self:provider.stage}.secondary}
    ROLE: ${self:custom.envProfile.${opt:stage, self:provider.stage}.role}
  memory_validation: 384
  memory_no_validation: 320
  timeout: 10
functions:
  createOrganization:
    handler: create.createOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_validation, self:provider.memory_validation}
    timeout: 15
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_standard}
    events:
    - http:
        path: /
        method: POST
        private: true
        documentation:
          summary: 'Create new organization, Requires: OrgName'
          tags:
          - Organization
          requestBody:
            description: 'Create new organization. Requires: OrgName'
          queryParams:
          - name: inhibitAssetTypes
            description: Inhibits the creation of the pre-canned asset types, mostly because Zetta likes to do it for itself.
            schema:
              type: boolean
              default: false
          requestModels:
            application/json: OrganizationModel
          methodResponses:
          - statusCode: 200
            responseBody:
              description: Returns the created organization. NOTE a generated OrganizationID, if no OrganizationID was passed when called
            responseModels:
              application/json: OrganizationModel
          - statusCode: 400
            responseBody:
              description: Missing Required Fields
            responseModels:
              application/json: MessageResponseModel
          - statusCode: default
            responseBody:
              description: Error response, see message for reason
            responseModels:
              application/json: MessageResponseModel
  updateOrganization:
    handler: update.updateOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_validation, self:provider.memory_validation}
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_standard}
    events:
    - http:
        path: /{id}
        method: PUT
        private: true
        documentation:
          summary: 'Updates and existing organization, Requires: OrgId, OrgName'
          tags:
          - Organization
          pathParams:
          - name: id
            description: organization id
            required: true
            schema:
              type: string
          requestBody:
            description: The organization will be only include all data passed in the update call
          requestModels:
            application/json: OrganizationModel
          methodResponses:
          - statusCode: 200
            responseBody:
              description: Returns the created organization. NOTE a generated OrganizationID, if no OrganizationID was passed when called
            responseModels:
              application/json: OrganizationModel
          - statusCode: 400
            responseBody:
              description: Missing Required Fields
            responseModels:
              application/json: MessageResponseModel
          - statusCode: default
            responseBody:
              description: Error response, see message for reason
            responseModels:
              application/json: MessageResponseModel
  patchOrganization:
    handler: patch.patchOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_validation, self:provider.memory_validation}
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_standard}
    events:
    - http:
        path: /{id}
        method: PATCH
        private: true
        documentation:
          summary: 'patches an existing organization, Requires: OrgId'
          tags:
          - Organization
          pathParams:
          - name: id
            description: organization id
            required: true
            schema:
              type: string
          requestBody:
            description: The organization will be only include all data passed in the update call
          requestModels:
            application/json: OrganizationModel
          methodResponses:
          - statusCode: 200
            responseBody:
              description: Returns the created organization.
            responseModels:
              application/json: OrganizationModel
          - statusCode: 400
            responseBody:
              description: Missing Required Fields
            responseModels:
              application/json: MessageResponseModel
          - statusCode: default
            responseBody:
              description: Error response, see message for reason
            responseModels:
              application/json: MessageResponseModel
  deleteOrganization:
    handler: delete.deleteOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_no_validation, self:provider.memory_no_validation}
    provisionedConcurrency: 0
    events:
    - http:
        path: /{id}
        method: DELETE
        private: true
        documentation:
          summary: Delete organization by id
          tags:
          - Organization
          pathParams:
          - name: id
            description: organization id
            required: true
            schema:
              type: string
          methodResponses:
          - statusCode: 200
            responseBody:
              description: Delete completed successfully
            responseModels:
              application/json: EmptyResponseModel
          - statusCode: default
            responseBody:
              description: Error response, see message for reason
            responseModels:
              application/json: MessageResponseModel
  getOrganization:
    handler: get.getOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_no_validation, self:provider.memory_no_validation}
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_high}
    events:
    - http:
        path: /{id}
        method: GET
        private: true
        caching:
            enabled: false
            cacheKeyParameters:
              - name: request.path.id
        documentation:
          summary: Get a organization by ID
          tags:
          - Organization
          pathParams:
          - name: id
            description: organization ID
            required: true
            schema:
              type: string
          queryParams:
          - name: IncludeStations
            description: Should the get org call return the org's station list, defaults to TRUE
            schema:
              type: boolean
              default: true
          methodResponses:
          - statusCode: 200
            responseBody:
              description: Returns an organization
            responseModels:
              application/json: OrganizationModel
          - statusCode: 404
            responseBody:
              description: Event not found, see message for reason
            responseModels:
              application/json: MessageResponseModel
          - statusCode: default
            responseBody:
              description: Error response, see message for reason
            responseModels:
              application/json: MessageResponseModel
  getAllOrganizations:
    handler: query.mongoGetAllOrganizations
    runtime: nodejs10.x
    # No validation but needs more memory:
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_validation, self:provider.memory_validation}
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_standard}
    events:
    - http:
        path: /all
        method: GET
        private: true
        caching:
            enabled: false
  1. What's the output you get when you use the SLS_DEBUG=* environment variable (e.g. SLS_DEBUG=* serverless deploy)
/app/rcs.raptor.api.organization # sls deploy --stage dev
Serverless: Load command interactiveCli
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command config:tabcompletion
Serverless: Load command config:tabcompletion:install
Serverless: Load command config:tabcompletion:uninstall
Serverless: Load command create
Serverless: Load command install
Serverless: Load command package
Serverless: Load command deploy
Serverless: Load command deploy:function
Serverless: Load command deploy:list
Serverless: Load command deploy:list:functions
Serverless: Load command invoke
Serverless: Load command invoke:local
Serverless: Load command info
Serverless: Load command logs
Serverless: Load command metrics
Serverless: Load command print
Serverless: Load command remove
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command slstats
Serverless: Load command plugin
Serverless: Load command plugin
Serverless: Load command plugin:install
Serverless: Load command plugin
Serverless: Load command plugin:uninstall
Serverless: Load command plugin
Serverless: Load command plugin:list
Serverless: Load command plugin
Serverless: Load command plugin:search
Serverless: Load command config
Serverless: Load command config:credentials
Serverless: Load command rollback
Serverless: Load command rollback:function
Serverless: Load command upgrade
Serverless: Load command uninstall
Serverless: Load command login
Serverless: Load command logout
Serverless: Load command generate-event
Serverless: Load command test
Serverless: Load command dashboard
Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Invoke aws:common:validate
Serverless: Invoke aws:common:cleanupTempDir
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Invoke aws:package:finalize
Serverless: Invoke aws:common:moveArtifactsToPackage
Serverless: Invoke aws:common:validate
Serverless: [AWS s3 200 0.379s 0 retries] getBucketLocation({ Bucket: '*redacted*' })
Serverless: Invoke aws:deploy:deploy
Serverless: [AWS cloudformation 200 0.393s 0 retries] describeStacks({ StackName: 'RaptorOrganizationAPI-dev' })
Serverless: [AWS s3 200 0.308s 0 retries] listObjectsV2({ Bucket: ''*redacted*',
  Prefix: 'serverless/RaptorOrganizationAPI/dev' })
Serverless: [AWS s3 200 0.298s 0 retries] headObject({ Bucket: ''*redacted*',
  Key: 'serverless/RaptorOrganizationAPI/dev/1577128805762-2019-12-23T19:20:05.762Z/RaptorOrganizationAPI.zip' })
Serverless: [AWS s3 200 0.309s 0 retries] headObject({ Bucket: ''*redacted*',
  Key: 'serverless/RaptorOrganizationAPI/dev/1577128805762-2019-12-23T19:20:05.762Z/compiled-cloudformation-template.json' })
Serverless: [AWS lambda 200 0.341s 0 retries] getFunction({ FunctionName: 'RaptorOrganizationAPI-dev-createOrganization' })
Serverless: [AWS lambda 200 0.348s 0 retries] getFunction({ FunctionName: 'RaptorOrganizationAPI-dev-updateOrganization' })
Serverless: [AWS lambda 200 0.226s 0 retries] getFunction({ FunctionName: 'RaptorOrganizationAPI-dev-deleteOrganization' })
Serverless: [AWS lambda 200 0.241s 0 retries] getFunction({ FunctionName: 'RaptorOrganizationAPI-dev-patchOrganization' })
Serverless: [AWS lambda 200 0.26s 0 retries] getFunction({ FunctionName: 'RaptorOrganizationAPI-dev-getOrganization' })
Serverless: [AWS lambda 200 0.29s 0 retries] getFunction({ FunctionName: 'RaptorOrganizationAPI-dev-getAllOrganizations' })
Serverless: [AWS sts 200 0.311s 0 retries] getCallerIdentity({})
Serverless: Uploading CloudFormation file to S3...
Serverless: [AWS s3 200 0.731s 0 retries] putObject({ Body: <Buffer 7b 22 41 57 53 54 65 6d 70 6c 61 74 65 46 6f 72 6d 61 74 56 65 72 73 69 6f 6e 22 3a 22 32 30 31 30 2d 30 39 2d 30 39 22 2c 22 44 65 73 63 72 69 70 74 ... >,
  Bucket: ''*redacted*',
  Key: 'serverless/RaptorOrganizationAPI/dev/1577129028618-2019-12-23T19:23:48.618Z/compiled-cloudformation-template.json',
  ContentType: 'application/json',
  Metadata: { filesha256: 'TfsGBJuce4TUMYLZFEgjiZ57lb7F6qlEoPfEhJnHTYI=' } })
Serverless: Uploading artifacts...
Serverless: Uploading service RaptorOrganizationAPI.zip file to S3 (14.03 MB)...
Serverless: [AWS s3 200 0.415s 0 retries] createMultipartUpload({ Bucket: '*redacted*',
  Key: 'serverless/RaptorOrganizationAPI/dev/1577129028618-2019-12-23T19:23:48.618Z/RaptorOrganizationAPI.zip',
  ContentType: 'application/zip',
  Metadata: { filesha256: 'mtXyJGsyxolKUVB87i7nXgnls8TFN+UQA6nT23Gj4Po=' } })
Serverless: [AWS s3 200 12.232s 0 retries] uploadPart({ Body: <Buffer 50 4b 03 04 14 00 08 00 08 00 00 00 21 00 00 00 00 00 00 00 00 00 00 00 00 00 0d 00 00 00 2e 64 6f 63 6b 65 72 69 67 6e 6f 72 65 cb cb 4f 49 8d cf cd ... >,
  ContentLength: 5242880,
  PartNumber: 1,
  Bucket: '*redacted*',
  Key: 'serverless/RaptorOrganizationAPI/dev/1577129028618-2019-12-23T19:23:48.618Z/RaptorOrganizationAPI.zip',
  UploadId: 'XL0aJrKLxqG2mZ.1VJs1LFre9IHEY9hs1w9CloDGgUV8GUEWP3Ku23gzZzaM6Ii2n56J7kqqc6KRrtiEIKDr7sRtAGbRcRhrLvHVRyUZvDIo5Ff201HqTFpJgHxnqToR' })
Serverless: [AWS s3 200 12.552s 0 retries] uploadPart({ Body: <Buffer 8f b3 12 46 f9 1c 1a 1c d2 14 a8 71 20 da 41 25 19 e9 ff 3f a4 99 1c 66 fa 41 a6 38 cd 5e 22 a6 3c 80 d1 44 2b 0e da ce 6c 7c 46 03 ea 67 a4 68 3e 90 ... >,
  ContentLength: 5242880,
  PartNumber: 2,
  Bucket: '*redacted*',
  Key: 'serverless/RaptorOrganizationAPI/dev/1577129028618-2019-12-23T19:23:48.618Z/RaptorOrganizationAPI.zip',
  UploadId: 'XL0aJrKLxqG2mZ.1VJs1LFre9IHEY9hs1w9CloDGgUV8GUEWP3Ku23gzZzaM6Ii2n56J7kqqc6KRrtiEIKDr7sRtAGbRcRhrLvHVRyUZvDIo5Ff201HqTFpJgHxnqToR' })
Serverless: [AWS s3 200 13.177s 0 retries] uploadPart({ Body: <Buffer 75 58 80 7e 55 2e 15 b5 bd f1 3b fd 7c 79 be 98 1d 0e ee 4d 7b b9 5c ac 46 ab cf c4 6c 48 76 4c 27 d3 cd e7 27 23 d8 59 0b 4a d3 8f 3b a2 35 d9 c6 e2 ... >,
  ContentLength: 4223620,
  PartNumber: 3,
  Bucket: '*redacted*',
  Key: 'serverless/RaptorOrganizationAPI/dev/1577129028618-2019-12-23T19:23:48.618Z/RaptorOrganizationAPI.zip',
  UploadId: 'XL0aJrKLxqG2mZ.1VJs1LFre9IHEY9hs1w9CloDGgUV8GUEWP3Ku23gzZzaM6Ii2n56J7kqqc6KRrtiEIKDr7sRtAGbRcRhrLvHVRyUZvDIo5Ff201HqTFpJgHxnqToR' })
Serverless: [AWS s3 200 0.42s 0 retries] completeMultipartUpload({ MultipartUpload: 
   { Parts: 
      [ { ETag: '"da578976bccfb9c1a73941b5dc749e19"', PartNumber: 1 },
        { ETag: '"6cd12e32fb30589dcd38f4f57d45815e"', PartNumber: 2 },
        { ETag: '"b067166a6f1ed55e0f1059205b534047"', PartNumber: 3 },
        [length]: 3 ] },
  Bucket: '*redacted*',
  Key: 'serverless/RaptorOrganizationAPI/dev/1577129028618-2019-12-23T19:23:48.618Z/RaptorOrganizationAPI.zip',
  UploadId: 'XL0aJrKLxqG2mZ.1VJs1LFre9IHEY9hs1w9CloDGgUV8GUEWP3Ku23gzZzaM6Ii2n56J7kqqc6KRrtiEIKDr7sRtAGbRcRhrLvHVRyUZvDIo5Ff201HqTFpJgHxnqToR' })
Serverless: Validating template...
Serverless: [AWS cloudformation 400 0.684s 0 retries] validateTemplate({ TemplateURL: 'https://s3.amazonaws.com/*redacted*/serverless/RaptorOrganizationAPI/dev/1577129028618-2019-12-23T19:23:48.618Z/compiled-cloudformation-template.json' })
 
  Error --------------------------------------------------
 
  Error: The CloudFormation template is invalid: Template format error: Unresolved resource dependencies [0] in the Resources block of the template
      at provider.request.catch.error (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/validateTemplate.js:20:13)
  From previous event:
      at AwsDeploy.validateTemplate (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/lib/validateTemplate.js:16:85)
  From previous event:
      at AwsDeploy.BbPromise.bind.then (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:119:39)
  From previous event:
      at Object.aws:deploy:deploy:validateTemplate [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:115:30)
      at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:55)
  From previous event:
      at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:22)
      at PluginManager.spawn (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:510:17)
      at AwsDeploy.BbPromise.bind.then (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:93:48)
  From previous event:
      at Object.deploy:deploy [as hook] (/usr/local/lib/node_modules/serverless/lib/plugins/aws/deploy/index.js:89:30)
      at BbPromise.reduce (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:55)
  From previous event:
      at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:490:22)
      at getHooks.reduce.then (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:525:24)
  From previous event:
      at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:525:8)
      at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:132:33)
      at runCallback (timers.js:810:20)
      at tryOnImmediate (timers.js:768:5)
      at processImmediate [as _immediateCallback] (timers.js:745:5)
  From previous event:
      at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:119:74)
      at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless.js:74:30)
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:111:16
      at /usr/local/lib/node_modules/serverless/node_modules/graceful-fs/graceful-fs.js:45:10
      at FSReqWrap.oncomplete (fs.js:135:15)
  From previous event:
      at initializeErrorReporter.then (/usr/local/lib/node_modules/serverless/bin/serverless.js:74:8)
      at runCallback (timers.js:810:20)
      at tryOnImmediate (timers.js:768:5)
      at processImmediate [as _immediateCallback] (timers.js:745:5)
  From previous event:
      at Object.<anonymous> (/usr/local/lib/node_modules/serverless/bin/serverless.js:63:4)
      at Module._compile (module.js:653:30)
      at Object.Module._extensions..js (module.js:664:10)
      at Module.load (module.js:566:32)
      at tryModuleLoad (module.js:506:12)
      at Function.Module._load (module.js:498:3)
      at Function.Module.runMain (module.js:694:10)
      at startup (bootstrap_node.js:204:16)
      at bootstrap_node.js:625:3
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              8.16.2
     Framework Version:         1.60.3
     Plugin Version:            3.2.6
     SDK Version:               2.2.1
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0
@medikoo
Copy link
Contributor

medikoo commented Dec 23, 2019

@justinrcs great thanks for report.

Can you find with which version exactly this error happens? (Is it v1.60.1, v1.60.2 or v1.60.3?)

Additionally can you minimize the serverless configuration example that reproduces that. So it doesn't involve any plugins, and so functions and resources are minimal?

It might be related to you're provisioned concurrency setting. Can you confirm whether error happens when you not use it? And if it's the case, can you find minimal example that reproduces that?

@justinrcs
Copy link
Author

justinrcs commented Dec 23, 2019

This is happening with v1.60.2+ (it works with 1.60.1 and below)

I created a minimal config with no plugins:

service:
  name: RaptorTestAPI
custom:
  base_path: /organization
  stage: ${opt:stage, self:provider.stage}
  envProfile:
    dev:
      region: us-east-1
      cluster: dev
      role: *redacted*
      bucket: *redacted*
      concurrency_standard: 1
      concurrency_high: 2
      subnetIds:
      - subnet-*redacted*
      securityGroupIds:
      - sg-*redacted*
provider:
  name: aws
  runtime: nodejs10.x
  versionFunctions: false
  region: ${self:custom.envProfile.${opt:stage, self:provider.stage}.region}
  role: ${self:custom.envProfile.${opt:stage, self:provider.stage}.role}
  deploymentBucket:
    name: ${self:custom.envProfile.${opt:stage, self:provider.stage}.bucket}
  vpc:
    securityGroupIds: ${self:custom.envProfile.${opt:stage, self:provider.stage}.securityGroupIds}
    subnetIds: ${self:custom.envProfile.${opt:stage, self:provider.stage}.subnetIds}
  stage: local
  memory_validation: 384
  memory_no_validation: 320
  timeout: 10
functions:
  createOrganization:
    handler: create.createOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_validation, self:provider.memory_validation}
    timeout: 15
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_standard}
    events:
    - http:
        path: /
        method: POST
        private: true
  updateOrganization:
    handler: update.updateOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_validation, self:provider.memory_validation}
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_standard}
    events:
    - http:
        path: /{id}
        method: PUT
        private: true
  patchOrganization:
    handler: patch.patchOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_validation, self:provider.memory_validation}
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_standard}
    events:
    - http:
        path: /{id}
        method: PATCH
        private: true
  deleteOrganization:
    handler: delete.deleteOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_no_validation, self:provider.memory_no_validation}
    provisionedConcurrency: 0
    events:
    - http:
        path: /{id}
        method: DELETE
        private: true
  getOrganization:
    handler: get.getOrganization
    runtime: nodejs10.x
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_no_validation, self:provider.memory_no_validation}
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_high}
    events:
    - http:
        path: /{id}
        method: GET
        private: true
  getAllOrganizations:
    handler: query.mongoGetAllOrganizations
    runtime: nodejs10.x
    # No validation but needs more memory:
    memorySize: ${self:custom.envProfile.${opt:stage}.memory_validation, self:provider.memory_validation}
    provisionedConcurrency: ${self:custom.envProfile.${opt:stage, self:provider.stage}.concurrency_standard}
    events:
    - http:
        path: /all
        method: GET
        private: true

Confirmed, if provisionedConcurrency is present, the template fails to validate. If I remove it, the API is deployed as expected.

EDIT: This line is causing the problem:
provisionedConcurrency: 0

The serverless configs are dynamically generated at deploy time. We have three settings for concurrency per environment: 0, standard and high. Looks like this setting is invalid, we'll need to ignore it if set to 0.

Thanks for the help

@medikoo
Copy link
Contributor

medikoo commented Dec 23, 2019

Great thanks @justinrcs, will be fixed shortly with #7135

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

Successfully merging a pull request may close this issue.

2 participants