question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AWS API Gateway: Error when renaming path variable

See original GitHub issue

This is a Bug Report

Description

Tried to rename a path variable and got the error. Deployed a service with the following yml config:

service: aws-nodejs

provider:
    name: aws
    runtime: nodejs6.10

functions:
    hello:
        handler: handler.hello
        events:
            - http:
                path: /{pathvar}
                method: put

Then changed it to

service: aws-nodejs

provider:
    name: aws
    runtime: nodejs6.10

functions:
    hello:
        handler: handler.hello
        events:
            - http:
                path: /{pathVar} # Changed this variable
                method: put

Then tried to redeploy the service to update the variable name and got the error.

For bug reports:

  • What went wrong? An error occurred while provisioning your stack: ApiGatewayResourcePathvarVar. A sibling ({pathvar}) of this resource already has a variable path part -- only one is allowed.
  • What did you expect should have happened? Expected the service to deploy the new route over the old one. Renaming the path variable from pathvar to pathVar.
  • What stacktrace or error message from your provider did you see? An error occurred while provisioning your stack: ApiGatewayResourcePathvarVar - A sibling ({pathvar}) of this resource already has a variable path part -- only one is allowed

Similar or dependent issues:

Additional Data

  • Serverless Framework Version you’re using: 1.15.3
  • Operating System: WIN 10
  • Provider Error messages: An error occurred while provisioning your stack: ApiGatewayResourcePathvarVar. A sibling ({pathvar}) of this resource already has a variable path part -- only one is allowed.

If more information is needed, just let me know.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:94
  • Comments:67 (3 by maintainers)

github_iconTop GitHub Comments

325reactions
pettyalexcommented, Oct 31, 2017

Workaround for now: Comment out the function from your serverless.yml, run a full deployment. This will delete the API gateway endpoint entirely, and then you can uncomment the function and run a deployment to deploy the new function with the new pathParam.

47reactions
avi2021commented, Jan 28, 2019

Is any solution available?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Resolve "Illegal character" errors from API Gateway APIs with ...
I'm using an AWS CloudFormation template (or OpenAPI API definition) to create an Amazon API Gateway API with a proxy resource. When I...
Read more >
Transforming API requests and responses
Learn how to set up parameter mapping to modify API requests and responses for Amazon API Gateway HTTP APIs.
Read more >
Tutorial: Build a REST API with HTTP non-proxy integration
Learn how to create an API Gateway API with the HTTP custom integration using the API Gateway console.
Read more >
How can I troubleshoot 5xx errors for API Gateway? - AWS
500 error: internal server error · Errors in the AWS Lambda function code. · Missing permissions for using a stage variable. · Incorrect...
Read more >
API Gateway similar routes different methods problem
An error occurred: ApiGatewayResourceChecksIdVar - A sibling ({status}) of this resource already has a variable path part -- only one is ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found