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

Cannot replace API key through Amplify CLI #3113

Open
2 tasks done
andylim0221 opened this issue Jan 12, 2025 · 11 comments
Open
2 tasks done

Cannot replace API key through Amplify CLI #3113

andylim0221 opened this issue Jan 12, 2025 · 11 comments
Labels
pending-community-response Issue is pending a response from the author or community. question Further information is requested

Comments

@andylim0221
Copy link

How did you install the Amplify CLI?

npm

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

v20.18.0

Amplify CLI Version

12.14.0

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

I removed the expired API key and created a new one.

Describe the bug

I then tried to make some changes in the schema. First, the error is Event Type: update, Reason: API key not found. Then, I added "CreateAPIKey": 0 in api/<API>/parameter.json and run amplify push again. It generates new error Name: Table (AWS::DynamoDB::Table), Event Type: update, Reason: Resource handler returned message: "Cannot update GSI's properties other than Provisioned Throughput and Contributor Insights Specification. You can create a new GSI with a different name." (RequestToken: e442268c-da90-cbb5-c806-fe540682df4b, HandlerErrorCode: InvalidRequest), IsCustomResource: false

Expected behavior

Able to push from Amplify CLI

Reproduction steps

  1. Remove AppSync API key manually and create a new one
  2. Make some changes in the schema
  3. Push the changes

Project Identifier

No response

Log output

No response

Additional information

No response

Before submitting, please confirm:

  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
  • I have removed any sensitive information from my code snippets and submission.
@AnilMaktala AnilMaktala added the question Further information is requested label Jan 13, 2025
@AnilMaktala
Copy link
Member

Hi @andylim0221, Thank you for bringing this up. To better understand the issue, could you confirm if a new API key was created in the AppSync console after adding "CreateAPIKey": 0 and running amplify push? Additionally, could you clarify the specific changes you are trying to make in the schema?

@AnilMaktala AnilMaktala added the pending-community-response Issue is pending a response from the author or community. label Jan 13, 2025
@andylim0221
Copy link
Author

andylim0221 commented Jan 14, 2025

Hi @AnilMaktala, the sequence is as below:

  1. Run amplify pull to pull the latest state and roll back local changes.
  2. Add "CreateAPIKey": 0 in backend/api/<API>/parameters.json.
  3. Run ampllify push. The error occurs.
Name: Table (AWS::DynamoDB::Table), Event Type: update, Reason: Resource handler returned message: "Cannot update GSI's properties other than Provisioned Throughput and Contributor Insights Specification. You can create a new GSI with a different name." (RequestToken: 849ffb33-45a2-562b-9d04-7c7b778b813f, HandlerErrorCode: InvalidRequest), IsCustomResource: false

In this case, I did not update the schema and still the error happens. This issue is blocking me from pushing changes to the schema

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 14, 2025
@AnilMaktala
Copy link
Member

Hi @andylim0221, Thank you for the response. Based on the error message, Cannot update GSI's properties other than Provisioned Throughput and Contributor Insights Specification. You can create a new GSI with a different name, it seems the issue is related to an update to the index. It looks like the changes that were rolled back locally are still present in the current-cloud-backup.

Could you try the following steps:

  1. Run amplify pull in a new folder.
  2. Add "CreateAPIKey": 0 to the backend/api/<API>/parameters.json file.
  3. Then, run amplify push.

Let me know if that resolves the issue.

@AnilMaktala AnilMaktala added pending-community-response Issue is pending a response from the author or community. and removed pending-maintainer-response Issue is pending a response from the Amplify team. pending-triage labels Jan 14, 2025
@andylim0221
Copy link
Author

Hi @AnilMaktala, yes I tried the steps from the last comment:

Could you try the following steps:

  1. Run amplify pull in a new folder.
  2. Add "CreateAPIKey": 0 to the backend/api//parameters.json file.
  3. Then, run amplify push.

It's not working as well:
Reason: Resource handler returned message: "Cannot update GSI's properties other than Provisioned Throughput and Contributor Insights Specification. You can create a new GSI with a different name." (RequestToken: c892ce0f-4ea0-5201-4892-7b99c62ffa1e, HandlerErrorCode: InvalidRequest)

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 15, 2025
@AnilMaktala
Copy link
Member

Hi  @andylim0221 👋 . Could you please run below command and send us the project identifer?
amplify diagnose --send-report. please refer here

@AnilMaktala AnilMaktala added pending-community-response Issue is pending a response from the author or community. and removed pending-maintainer-response Issue is pending a response from the Amplify team. labels Jan 16, 2025
@andylim0221
Copy link
Author

@AnilMaktala Hi, the project identifier is 9e21f4c90c8900e61aab6bb6ad4208ae

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 18, 2025
@AnilMaktala
Copy link
Member

AnilMaktala commented Jan 21, 2025

Hi @andylim0221, Thank you for sharing the diagnosis report. Could you please download the [#current-cloud-backend.zip] file from the deployment bucket in the S3 console, compare the local schema with the schema in the current-cloud-backend folder, and let me know if you notice any differences? Also, by any chance, are you on Discord?

@AnilMaktala AnilMaktala added pending-community-response Issue is pending a response from the author or community. and removed pending-maintainer-response Issue is pending a response from the Amplify team. labels Jan 21, 2025
@andylim0221
Copy link
Author

@AnilMaktala Yes I'm in that Discord channel. There's no difference between the local schema and the schema in the current-cloud-backend folder.

To be fair, this is quite urgent from our end since we have to deploy the schema changes to make the production, and this is hindering us from doing so.

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 22, 2025
@AnilMaktala
Copy link
Member

Hey @andylim0221, Could you please share your Discord username?

@AnilMaktala AnilMaktala added pending-community-response Issue is pending a response from the author or community. and removed pending-maintainer-response Issue is pending a response from the Amplify team. labels Jan 22, 2025
@andylim0221
Copy link
Author

My Discord username - yareyaredaze0709

@github-actions github-actions bot added pending-maintainer-response Issue is pending a response from the Amplify team. and removed pending-community-response Issue is pending a response from the author or community. labels Jan 23, 2025
@AnilMaktala
Copy link
Member

Hey @andylim0221, Thanks for sharing your username! I’ll reach out to you on Discord, and we can coordinate there.

@AnilMaktala AnilMaktala added pending-community-response Issue is pending a response from the author or community. and removed pending-maintainer-response Issue is pending a response from the Amplify team. labels Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-community-response Issue is pending a response from the author or community. question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants