-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
DataStore - Sync processor retry error: {"data": {}, "errors": [[GraphQLError: Request failed with status code 401]]} #12951
Comments
Hey,👋 thanks for raising this! I'm going to transfer this over to our Amplify JS repository for better assistance 🙂 |
Hi @elkee2003 👋 it looks like your error logs mention UnuathorizedExceptions for create and update User operations, and the sync is failing with auth mode Please refer to the docs to configure MULTI_AUTH: |
@elkee2003, let us know if you had a chance to review @chrisbonifacio's comment above and if it unblocked you. |
No I haven't had the chance to try it out, once I try it out I'll let him know |
It does not work. Just to be clear after I run this: DataStore.configure({ |
Hi @elkee2003 I thought it might resolve the problem because the error says that the user is not authorized perform the query using API_KEY as an auth mode. Can you share your schema so we can confirm this is expected behavior? By default DataStore will attempt to authorize qraphql calls to AppSync only using the default auth mode mentioned in the amplifyconfiguration.json file. MULTI_AUTH allows DataStore to use additional auth modes, of which it will re-attempt calls with. If you look at the hierarchy of auith modes it retries with, API_KEY is the last one because it goes from least to most permissive auth rules. If you are still getting unauthorized errors with multi auth enabled, then we need to take a look at the schema to figure out how the auth rules are configured on the model and what auth mode DataStore should be able to authorize a user with. |
enum OrderStatus { type Order @model @auth(rules: [{allow: public}]) { type User @model @auth(rules: [{allow: public}]) { |
Before opening, please confirm:
App Id
arn:aws:amplify:us-east-1:115372163617:apps/dnxdny8iom5jq
Region
us-east-1
Environment name
VS code
Figma File Version (if applicable)
No response
Amplify CLI Version
12.8.2
If applicable, what version of Node.js are you using?
v20.11.0
What operating system are you using?
Windows
Browser type?
Google Chrome
Describe the bug
I keep getting this bug:
[ERROR] 05:24.121 DataStore - Sync processor retry error: {"data": {}, "errors": [[GraphQLError: Request failed with status code 401]]}
I don't know why.Theses are where Datastore is used:
Expected behavior
It used to work, all of a sudden it stopped
Reproduction steps
[ERROR] 05:24.121 DataStore - Sync processor retry error: {"data": {}, "errors": [[GraphQLError: Request failed with status code 401]]}
Project Identifier
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: