serverless-dynamodb-local icon indicating copy to clipboard operation
serverless-dynamodb-local copied to clipboard

0.2.38 breaking change: DynamoDB Local is not available for stage

Open aaronjensen opened this issue 5 years ago • 12 comments

It looks like you released a new patch version and I don't see any release notes or instructions. This change was a breaking change for us in CI. We now get:

Actual Behaviour

When running:

serverless dynamodb migrate --stage test

We get:

Serverless: Skipping migration: DynamoDB Local is not available for stage: test

Expected Behaviour

It would work as it did before or be released as a new minor or major version with migration instructions.

Steps to reproduce it

See above

LogCat for the issue

See above

Screenshots of the issue

None

Would you like to work on the issue?

No thank you

aaronjensen avatar May 31 '19 14:05 aaronjensen

Same problem when starting serverless offline with dynamodb custom config:

dynamodb:
    start:
      port: 8002
      inMemory: true
      migrate: true

When serverless offline start I get the error Serverless: Skipping start: DynamoDB Local is not available for stage: dev

Thanks!

jacqueslorentz avatar May 31 '19 18:05 jacqueslorentz

looks like this pr: https://github.com/99xt/serverless-dynamodb-local/commit/5e53d7622d901bc05515135cd91de04a6680d38e

@rehrumesh any ideas?

karticus avatar May 31 '19 18:05 karticus

Solved it by adding the stage to the stages whitelist.

custom:
  dynamodb:
    stages:
      - test

rhnorskov avatar Jun 02 '19 11:06 rhnorskov

stages: direction works

manoj-bandara avatar Jun 04 '19 07:06 manoj-bandara

seems this bug has bitten our developers as well.

So we now have to whitelist all of our stages or just our local ones?

mlg-rbalhorn avatar Jun 04 '19 22:06 mlg-rbalhorn

I started getting this error with 0.2.37 this morning, and the whitelist strategy from @rhnorskov worked for me. One slight difference from the OP is that I'm running sls offline start and was getting Skipping start: DynamoDB Local is not available for stage: dev.

samscarsella avatar Jun 05 '19 15:06 samscarsella

@99xt - there is nothing in this repo about the commit that caused 0.2.38 - can you advise ?

davecarlson avatar Jun 10 '19 09:06 davecarlson

custom:
  dynamodb:
    stages:
      - test

works but in my case, had to remove and reinstall dynamodb.

honasassa avatar Jun 27 '19 10:06 honasassa

custom:
  dynamodb:
    stages:
      - test

works for me, thanks

liorsuperquery avatar Jul 08 '19 13:07 liorsuperquery

For all stages:

custom:
  dynamodb:
    stages:
      - ${self:provider.stage}

cecton avatar Aug 04 '19 08:08 cecton

Unfortunately the solution with whitelisting a stage does not work if your custom key is included from a file.

In our case:

custom:
  ${file(serverless/custom.yml)}

is enough to prevent DynamoDB from starting up when on 0.2.38. The core of the issue stems in my opinion from the fact that this.config is assigned in constructor(serverless, options) {...} where the actual content of the file has not been processed by Serverless and, thus, custom is properly defined yet.

BTW. It looks like this is already reported as #229

For us the solution was to revert to 0.2.37 which checked the whitelist in a different manner and did not prevent DynamoDB from running (though the bug with reading config too early already exists there).

gwynnarth avatar Oct 31 '19 11:10 gwynnarth

The stage whitelisting worked for me. I just added the two stages i'm going to use it at. I don't think it is worth using a wildcard. Thank you very much, I was starting from an official sls tutorial and this was driving me crazy

danielo515 avatar Jan 10 '20 08:01 danielo515