Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to update base path mapping #612

Closed
varad11 opened this issue Jan 21, 2024 · 8 comments 路 Fixed by #615
Closed

Unable to update base path mapping #612

varad11 opened this issue Jan 21, 2024 · 8 comments 路 Fixed by #615
Labels

Comments

@varad11
Copy link

varad11 commented Jan 21, 2024

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Bug Report

Error Description
An error displayed telling V2 base path mapping update failed for my custom domain.
But I have actually configured HTTP(V1) api instead of REST(V2),

Command Run
sls deploy

Console Output

Error:
Error: V2 - Unable to update base path mapping for 'prefix.mydomain.com':
Invalid stage identifier specified
at APIGatewayV2Wrapper.<anonymous> (/usr/local/lib/node_modules/serverless-domain-manager/dist/src/aws/api-gateway-v2-wrapper.js:163:23)
at Generator.throw (<anonymous>)
at rejected (/usr/local/lib/node_modules/serverless-domain-manager/dist/src/aws/api-gateway-v2-wrapper.js:6:65)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Domain Manager Configuration
Replace this with your own serverless.yml file (anonymized, of course) to help us better resolve your issue.

custom:
  customDomain:
    domainName: 'prefix.mydomain.com'
    basePath: ''
    certificateName: 'mydomain.com'
    createRoute53Record: true
    stage: 'production'
    endpointType: 'regional'
    apiType: http
    autoDomain: true

Versions

  • Domain Manager version(s): v7.3.3
  • Node/npm version: Node 14/npm 6
  • Serverless Version: v3.26.0
  • Lambda Code: Javascript

Possible Solution

Additional context/Screenshots
I am using aws/codebuild/standard:6.0 Linux EC2

@varad11 varad11 added the bug label Jan 21, 2024
@varad11
Copy link
Author

varad11 commented Jan 21, 2024

A workaround temporarily is to revert back to an older serverless-domain-manager version 6.4.4

@rddimon
Copy link
Collaborator

rddimon commented Feb 2, 2024

Hi @varad11

Could you please also provide a function configuration?

Note:
The quick fix for your case will be changing the customDomain.stage to $default.

It looks like not a good solution but I'm not quite sure what should be the right solution based on the next article:
https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-stages.html

It looks like we should always have $default stage before deploying anyone else

@rsi-mrobinson
Copy link

rsi-mrobinson commented Feb 5, 2024

I ran into this as well during a migration from gitlab to github for CI. We do not use a $default stage and would prefer not to have one. Rolling back to 6.4.4 was a viable workaround, but I think if we can deploy successfully to aws using an earlier version with no $default stage, that indicates an issue with the plugin rather than a missing AWS requirement. Maybe I'm misreading this line though You can create a $default stage that is served from the base of your API's URL鈥攆or example, https://{api_id}.execute-api.{region}.amazonaws.com/. You use this URL to invoke an API stage.

tbh, we don't much care about the stage at all for apigateway as our environments are logically separated by accounts/vpcs and we are never invoking api's from the amazonaws.com endpoint, but I'd rather not have to add a dummy stage just to deploy.

@rddimon
Copy link
Collaborator

rddimon commented Feb 6, 2024

Hi @varad11 @rsi-mrobinson

Could you please try our latest version v7.3.5 ?
And provide us the result

@varad11
Copy link
Author

varad11 commented Feb 6, 2024

@rddimon the latest version works without error for me. Thank you.

@rsi-mrobinson
Copy link

I've had the version pinned to 6.4.4 and must have missed this. I'm still seeing the issue on 7.3.5:

脳 Stack dev-proto-test-api failed to deploy (12s)
Error:
Error: V1 - Unable to fetch information about 'api.dev.my.endpoint.com':
Environment: linux, node 18.19.1, framework 3.38.0 (local) 3.37.0v (global), plugin 7.2.2, SDK 4.5.1
Credentials: Local, environment variables
Docs:        docs.serverless.com
Support:     forum.serverless.com
Bugs:        github.com/serverless/serverless/issues

The security token included in the request is invalid.
    at APIGatewayV1Wrapper.<anonymous> (/__w/dev-proto-test-api/dev-proto-test-api/node_modules/serverless-domain-manager/dist/src/aws/api-gateway-v1-wrapper.js:77:27)
    at Generator.throw (<anonymous>)
    at rejected (/__w/dev-proto-test-api/dev-proto-test-api/node_modules/serverless-domain-manager/dist/src/aws/api-gateway-v1-wrapper.js:6:65)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

@rddimon
Copy link
Collaborator

rddimon commented Mar 5, 2024

Hi @rsi-mrobinson

  1. Error: V1 - Unable to fetch information about 'api.dev.my.endpoint.com'
  2. The security token included in the request is invalid.

Looks like there is an issue with your credentials and it's not related to the current issue Invalid stage identifier specified

@rsi-mrobinson
Copy link

rsi-mrobinson commented Mar 5, 2024

Theres nothing wrong with the credentials being used, I rolled back package.json and package-lock.json to 6.4.4 and deployed the service with that version of the domain manager without issue. However, it does look like this may be an unrelated issue to this ticket. Let me know if you'd like me to spin off a fresh issue.

It looks like my implementation is using v1 of the wrapper as opposed to v2 as seen in varad's original ticket as well.

edit: created a new issue #621

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants