Waleed Ahmad
Waleed Ahmad

Reputation: 494

GraphQLSchema Specified key does not exist on `amplify push`

I have upgraded amplify version from 4.45.0 to 5.2.0,

Now when I do amplify push, I am getting the following error:

Following resources failed

Resource Name: ci5lt23eofhvxlc3an7db4d7veGraphQLSchema (AWS::AppSync::GraphQLSchema)
Event Type: update
Reason: The specified key does not exist. (Service: Amazon S3; Status Code: 404; Error Code: NoSuchKey; Request ID: GZQF1T9HWCCED75H; S3 Extended Request ID: qicfcwF2YUNdqMDU3EUkt+hsXIQawcirDG7TIX+peEEkAWOE1v9ee6n2L5Qc2I8uePyAXg2eJ4U=; Proxy: null)

Upvotes: 4

Views: 1474

Answers (3)

Maanli yass
Maanli yass

Reputation: 221

I faced the same issue and I found out that it was due to this part on the graphQL file :

This "input" configures a global authorization rule to enable public access to all models in this schema. Learn more about authorization rules here: https://docs.amplify.aws/cli/graphql/authorization-rules

input AMPLIFY { globalAuthRule: AuthRule = { allow: public } } # FOR TESTING ONLY!
type User @model {
    id: ID!
    username: String!
    email: String!
}

the solution is to remove everything before type then do amplify-push on your shell

Upvotes: 0

Beki
Beki

Reputation: 1746

Forcefully pushing to the cloud did not help in my case. Turns out my graphql secret key has an expiration period which i realized after running amplify update api and here it was:

Authorization modes
- Default: API key expiring Tue Oct 25 2022 ....

then I renewed my key. it worked out fine...

Upvotes: 1

Waleed Ahmad
Waleed Ahmad

Reputation: 494

Removed error after pushing it with force as: amplify push --force

Upvotes: 6

Related Questions