serverless-api-stage icon indicating copy to clipboard operation
serverless-api-stage copied to clipboard

Deploy fails with "pathmapping - Invalid stage identifier specified"

Open aneilbaboo opened this issue 6 years ago • 4 comments

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

aneilbaboo avatar Apr 21 '18 02:04 aneilbaboo

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

leftclickben avatar Jun 19 '18 17:06 leftclickben

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.

aneilbaboo avatar Jun 19 '18 19:06 aneilbaboo

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.

ghost avatar Aug 29 '18 02:08 ghost

@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

KikeMendez avatar Feb 24 '19 11:02 KikeMendez