-
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
S3Object upload failing silently - not even a POST request. #3243
S3Object upload failing silently - not even a POST request. #3243
Comments
Related to #2706 |
Not sure if it is exactly the same, as mine is not even going to DynamoDB. |
@elliott-king do you see a 403 error on network tab? |
@elliott-king I have reproduced the problem, because in my case is not rejecting the promise when the upload fails. |
@elorzafe No, I am not getting a 403 error on the network tab. Tried on both Firefox (66) & Chrome (74). |
Just jumping in to say I did test this with my issue & it has resolved the silent failure. |
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 |
Which Category is your question related to?
GraphQL AppSync, and S3 Uploads with Complex Objects.
What AWS Services are you utilizing?
AWS Amplify with:
Provide additional details e.g. code snippets
Hello.
I am following the tutorial section to add complex objects. I think I am following the tutorial, but there is no file upload to either S3 or DynamoDB. In fact, my client app is not making a request at all! However, if I remove the file object from the mutation, the request will go through.
First, I will show my code. Then, I will talk about the debugging/testing steps I have taken.
Relevant section of schema.graphql:
When I
amplify push
this, it correctly creates the CreatePhotoInput in the Appsync Graphql API:Here is my auth handler:
And the bit where I actually call the mutation:
If I run this, the console will log the location ID, but nothing further. No request are sent. It will only do this for this code, though. If I place a deliberate error in the code, it will both send a POST request and give an error.
My debugging steps
file = {...}
, if I remove eithermimeType
orlocalUri
, I will get:The variables input contains a field name 'mimeType' that is not defined for input object type 'S3ObjectInput'
. If I remove both, it will make the request with no errors, but will put nothing in S3 (as expected).client.mutate(... variables: {...}
If I removefile: file
, it will make a request with no errors, but will put nothing in S3. If I remove anything (or everything) exceptfile: file
, it will continue to fail silently.At this point, I looked at your existing example for guidance. I placed a
console.log('file to upload:', selectedFile)
andconsole.log('file object', file);
at similar points to my above code. This allowed me to look at the structure of the file itself, and what would be uploaded to S3. They print identical responses for both my code and the sample code. However, the sample code is:In summation
I tried to follow the S3 object upload guide, but it is failing silently. However, if I put in a small bug, it will fail correctly. Due to the lack of error output, I am at a loss.
The text was updated successfully, but these errors were encountered: