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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amplify Studio throws error - Resource name should be alphanumeric #1051

Closed
4 tasks done
MitchellNeill opened this issue Oct 12, 2023 · 5 comments
Closed
4 tasks done
Labels
data Data modelling pending-triage An issue that is pending triage

Comments

@MitchellNeill
Copy link

Before opening, please confirm:

App Id

d1bryg0uoopcub

Region

ap-southeast-2

Environment name

dev

Figma File Version (if applicable)

na

Amplify CLI Version

12.6.0

If applicable, what version of Node.js are you using?

v19.9.0

What operating system are you using?

Windows (WSL2 Ubuntu)

Browser type?

Firefox, Chrome

Describe the bug

On loading amplify Studio, I can no longer see any of my data models displayed. Looking at the console and refreshing the page while on a tab that is not the data models page (such as the content tab), I can see a number of 400 errors in the console:

POST
https://amplifybackend.ap-southeast-2.amazonaws.com/backend/d1bryg0uoopcub/api/dev/details
{"message":"An error occurred while processing your request: Resource name should be alphanumeric and have a length between 1 and 80 characters","code":"ValidationException"}
POST
https://amplifybackend.ap-southeast-2.amazonaws.com/backend/d1bryg0uoopcub/api/dev/getModels
{"message":"An error occurred while processing your request: Resource name should be alphanumeric and have a length between 1 and 80 characters","code":"ValidationException"}

I don't believe my project name has changed, request payload for each of the above was:
{"resourceName":"crewedmaritime-dev"}
Which looks accurate. I believe the -dev is added to my project name as it is in the dev environment.

Expected behavior

Expect the console to be free of error messages and for the Data tab in amplify studio to display the data models.

Reproduction steps

unsure, creating a new application "test" results in the following payload being sent:
"{"resourceName":"staging"}" and results in no 400 errors as it does not contain a -

Project Identifier

6a01204c2bcf8a9af3d686724cc4b974

Additional information

This all ocured after adding a graphql API for the first time and may have to do with permissions. I can see a number of warnings Source map error: Error: request failed with status 403 but I cannot be sure they are related. Either way the 400 error is strange.

@MitchellNeill MitchellNeill added the pending-triage An issue that is pending triage label Oct 12, 2023
@ykethan
Copy link
Member

ykethan commented Oct 12, 2023

Hey @MitchellNeill, thank you for reaching out. The resourceName normally should not have the -dev in the API call. Tried reproducing the behaviour but did not observe this. Could you provide some additional information,
was the API created on Amplify studio or using Amplify CLI?
Could you provide us any reproduction steps that would assist in diving into this, for example: resources created or deploys with API changes?

@ykethan ykethan added pending-response An issue is pending response from the issue requestor data Data modelling labels Oct 12, 2023
@MitchellNeill
Copy link
Author

Hi @ykethan this was the first time adding an API to the project and It was added from the CLI and pushed. I don't believe I picked a custom name or anything. I can see that the text "crewedmaritime-dev" in my .gpaphqlconfig file:
projects:
crewedmaritime-dev:
schemaPath: src/graphql/schema.json

The above file should be the new file created from the amplify CLI, and I also used the amplify codegen to generate some of the files while adding it, if that impacts anything.

I can also see some occurrences in my team-provider-info.json file, but this file is an old file that has not recently changed, other than an S3 key.

When I run "amplify upgrade api" it prints the following:
General information

  • Name: crewedmaritime

I haven't been able to reproduce it so far.

@github-actions github-actions bot removed the pending-response An issue is pending response from the issue requestor label Oct 12, 2023
@MitchellNeill
Copy link
Author

Hmm I deleted my functions, and apis to try to fix it and it took my data models and database tables with it. The problem has stopped since there aren't any apis now. I'll try and recreate them slowly to see if I can reproduce the issue before closing.

@ykethan
Copy link
Member

ykethan commented Oct 13, 2023

@MitchellNeill thank you for the information. Try re-creating this in a windows environment and changes to the API files but did not observe this behavior.
Glad to hear that you were able to mitigate the issue. For now i will be closing this issue, please do not hesitate to reach out if this reoccurs or if you are able to reproduce this.

@ykethan ykethan closed this as not planned Won't fix, can't repro, duplicate, stale Oct 13, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data Data modelling pending-triage An issue that is pending triage
Projects
None yet
Development

No branches or pull requests

2 participants