leftclickben / serverless-api-stage

AWS API Gateway stage plugin for serverless framework
MIT License
47 stars 16 forks source link

Deploy fails with "pathmapping - Invalid stage identifier specified" #12

Open aneilbaboo opened 6 years ago

aneilbaboo commented 6 years ago

I can't seem to add serverless-api-stage to a project which contains the serverless-domain-manager plugin. Deployment fails with the error:

...
Serverless: Uploading CloudFormation file to S3...
Serverless: Uploading artifacts...
Serverless: Uploading service .zip file to S3 (15.76 MB)...
Serverless: Validating template...
Serverless: Updating Stack...
Serverless: Checking Stack update progress...
..........................................
Serverless: Operation failed!

  Serverless Error ---------------------------------------

  An error occurred: pathmapping - Invalid stage identifier specified.

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless

  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           9.3.0
     Serverless Version:     1.26.1

I've narrowed it down to an interaction between the two plugins.

Here's a repo which demonstrates the issue:

https://github.com/aneilbaboo/serverless-api-stage-issue

leftclickben commented 6 years ago

Thanks a lot for this @aneilbaboo , and apologies for the delay responding; I'll take a look.

aneilbaboo commented 6 years ago

Hi @leftclickben - There might be a solution in this comment: https://github.com/serverless/serverless/issues/4029#issuecomment-386045929

I'm not sure whether the change is best made here or in https://github.com/amplify-education/serverless-domain-manager

FWIW, I'm using serverless-api-stage mainly to get APIGateway logging working. I'm using serverless-domain-manager to automate deployment of stage-specific subdomains.

ghost commented 6 years ago

Just to add my findings here, I was TRYING to use both of these plugins together as well. But after testing different combos and parameters, it seems as though its this plugin thats causing the issues. When i ran domain-manager by itself without this plugin being registered in serverless.yml, everything ran fine. But when I disabled domain manager and enabled this plugin, it failed with above message. I created a APIGW deployment and BasePathMapping with custom resources and set the basepathmapping to DependsOn the deployment resource. However, i noticed this plugin running intermingled with the CREATE_IN_PROGRESS and CREATE_COMPLETE for the custom resources being created which ended up throwing the same error since stage was not complete yet.

KikeMendez commented 5 years ago

@aneilbaboo @leftclickben I have solved the issue on this PR I can now use domain manager and api key and usage plans all together. https://github.com/leftclickben/serverless-api-stage/pull/25