serverless: Missing required key 'restApiId' in params in 1.42.0

This is a Bug Report

Description

  • What went wrong?

After upgrading to 1.42.0, I can no longer deploy. I get:

  Serverless Error ---------------------------------------
 
  Missing required key 'restApiId' in params
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     OS:                     linux
     Node Version:           8.11.4
     Serverless Version:     1.42.0
  • What did you expect should have happened?

It should have worked like the previous version did.

  • What was the config you used?
`serverless.yml`
service: my-app-consent

cors: &cors
  origins:
    - '${file(../../packages/dev/config/env.js):env.POWER_UP_URL}'
  headers:
    - Content-Type
    - X-Amz-Date
    - Authorization
    - X-Api-Key
    - X-Amz-Security-Token
    - X-Amz-User-Agent
    - SPOOF
  allowCredentials: false

provider:
  name: aws
  runtime: nodejs8.10
  memorySize: 256
  logRetentionInDays: 14
  apiGateway:
    restApiId: '${file(../../packages/dev/config/env.js):env.REST_API_ID}'
    restApiRootResourceId: '${file(../../packages/dev/config/env.js):env.REST_API_ROOT_RESOURCE_ID}'
  deploymentBucket:
    serverSideEncryption: AES256
  environment:
    AWS_ACCOUNT_ID: '${file(../../packages/dev/config/env.js):env.AWS_ACCOUNT_ID}'
    ENV_NAMESPACE: ${self:custom.namespace}
  iamRoleStatements:
    - Effect: 'Allow'
      Resource: 'arn:aws:dynamodb:${opt:region, self:provider.region}:*:table/${self:custom.namespace}-userConsents'
      Action:
        - dynamodb:PutItem

plugins:
  - serverless-sentry
  - serverless-webpack
  - serverless-offline

package:
  individually: true

custom:
  stage: ${opt:stage, self:provider.stage}
  namespace: my-app-${self:custom.stage}
  webpack:
    webpackConfig: ./webpack.config.js
    includeModules: false
    packager: 'yarn'
  serverless-offline:
    httpsProtocol: '../../config/localhost'
    port: 8003
  sentry:
    dsn: ${file(../../packages/dev/config/env.js):env.SENTRY_FUNCTIONS_DSN}
    captureTimeoutWarnings: false

functions:
  record-consent:
    handler: src/handlers/recordConsent.lambda
    events:
      - http:
          path: /consent
          method: post
          cors: *cors
  • What stacktrace or error message from your provider did you see?

See above

Similar or dependent issues:

None

Additional Data

  • Serverless Framework Version you’re using: 1.42.0
  • Operating System: any
  • Stack Trace: none
  • Provider Error messages: see above

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 16
  • Comments: 33 (8 by maintainers)

Most upvoted comments

v1.42.3 was just released and that should fix this issue for all cases.

If you still happen to observe some problems, please report with details needed for us to reproduce on our side.

Thank you!

Just tried to deploy with 1.42.2:

Serverless Error ---------------------------------------
 
  Missing required key 'restApiId' in params
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     OS:                     linux
     Node Version:           10.15.3
     Serverless Version:     1.42.2

Fixed indeed.

You guys are the best!

Jérôme / Blog http://provensal.com/lbb/ / FB https://www.facebook.com/jerome.provensal / LinkedIn http://www.linkedin.com/in/jeromeprovensal / IG http://instagram.com/jeromeig / Tumblr http://creativejp.tumblr.com/ / INTP http://www.mypersonality.info/personality-types/intp/

On Tue, May 14, 2019 at 12:52 AM Mariusz Nowak notifications@github.com wrote:

v1.42.3 was just released and that should fix this issue for all cases.

If you still happen to observe some problems, please report with all needed details, needed for us to reproduce on our side.

Thank you!

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/serverless/serverless/issues/6100?email_source=notifications&email_token=AAEG3PSW63UMSJAAT2VZR6TPVJVSTA5CNFSM4HL3WRO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVKSOKA#issuecomment-492119848, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEG3PXH2DKR7XMLTZQHWMDPVJVSTANCNFSM4HL3WROQ .

We were running into another problem here and we decided to delete stack and redeploy, but after that we have this error too. Our deploy runs through circle CI and I did already changed the version to the 1.42.2 but the problem still happening.

Serverless Error ---------------------------------------
 
  Missing required key 'restApiId' in params
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     OS:                     linux
     Node Version:           8.15.1
     Serverless Version:     1.42.2 

I rolled back to version v1.41.1 and everything worked just fine.

npm i -g serverless@v1.41.1

Fixed and published with v1.42.2

@medikoo can you please look at https://github.com/serverless/serverless/blob/49650a199cb5cb315fa6c20f6475949215019aa3/lib/plugins/aws/package/compile/events/apiGateway/lib/hack/updateStage.js#L50 I don’t think that API name will alway be ${this.options.stage}-${this.serverless.service.service}

👍 I’m getting this too after upgrading from v1.36.1 to v1.42.1. I’ll try downgrading to v1.41.1.

After downgrading to v1.41.1 I get another problem: (Update: turned out to be due to serverless-domain-manager v3.2.1, after downgrading to v2.6.13 I can now deploy successfully using serverless v1.41.x or earlier, but not with v1.42.1)

  Error: Failed to find CloudFormation resources for x.xyz.com

argh, bad time to upgrade 😦