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

AppSync error reporting issue #5855

Closed
ambriglia opened this issue May 21, 2020 · 4 comments
Closed

AppSync error reporting issue #5855

ambriglia opened this issue May 21, 2020 · 4 comments
Labels
API Related to REST API issues AppSync Related to AppSync issues question General question Service Team Issues asked to the Service Team

Comments

@ambriglia
Copy link

ambriglia commented May 21, 2020

Describe the bug
AWS AppSync does not report an error when request is incorrect.

To Reproduce
We are using the @aws-amplify/api npm package to make AppSync mutations. Accidentally, one of our mutation requests did not contain an ID.

Expected behavior
I expected the AppSync logging, within the appropriate CloudWatch LogGroup, to report some kind of error. However, after inspecting the logs, I noticed that AppSync reports nothing is wrong. It even returns a 200 response. We were notified of this bug in the frontend console because it looks like the @aws-amplify/api somehow determines there was an error. We rely on CloudWatch alarms to notify us of an issue. I do not know of a good way to trigger an alarm in this case.

@ambriglia ambriglia added the to-be-reproduced Used in order for Amplify to reproduce said issue label May 21, 2020
@manueliglesias manueliglesias added API Related to REST API issues AppSync Related to AppSync issues labels May 21, 2020
@manueliglesias
Copy link
Contributor

Hi @ambriglia

Accidentally, one of our mutation requests did not contain an ID.

Depending on how your AppSync api was provisioned, you could have a request mapping template that is auto generating a uuid for you if one is not present in the input arguments.

But, if @aws-amplify/api is reporting an error but got a 200 response back, this means that it got back a GraphQL error (not a general http error) with potentially partial data (see e.g. https://spec.graphql.org/June2018/#example-90475 )

May I ask what kind of error was received in your frontend console?

I am not sure why you don't see the error in CloudWatch, for that my suggestion would be to contact the AppSync service team in the support forums

@manueliglesias manueliglesias added question General question Service Team Issues asked to the Service Team and removed to-be-reproduced Used in order for Amplify to reproduce said issue labels May 22, 2020
@ambriglia
Copy link
Author

@manueliglesias Here is the error... failed to save animal: {"data":null,"errors":[{"path":null,"locations":[{"line":1,"column":24,"sourceName":null}],"message":"Variable 'input' has coerced Null value for NonNull type 'ID!'"}]}

That first link you provided above seems like it might be what we are experiencing.

The odd thing is that in the cloudwatch logs, appsync does not log out the actual response body data. I guess this is for privacy reasons? Regardless, because the response body is never logged, there is nothing else in the logs that helps me determine this was an error.

If there is not an amplify concern here, I can try and ask this question for the appsync service team, which you linked above. Thanks.

@harrysolovay
Copy link
Contributor

Yes––this would be a question for the AppSync service team.

@github-actions
Copy link

This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs.

Looking for a help forum? We recommend joining the Amplify Community Discord server *-help channels or Discussions for those types of questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Related to REST API issues AppSync Related to AppSync issues question General question Service Team Issues asked to the Service Team
Projects
None yet
Development

No branches or pull requests

3 participants