-
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
NotImplemented: A header you provided implies functionality that is not implemented - AWS Amplify Storage remove() #13133
Comments
Hello @ChristopherGabba, and thank you for providing the sample code. Was there a specific page/section of the Storage docs you were following to set up your backend? And is this an app that you've explicitly only used Gen2 resources/docs for backend or was this something you're trying to migrate from a Gen 1 setup? |
I'll give you the step-by-step:
That's how I ended up with my current structure. Step #2 Is where I set up all of my configs. I still kind of have both a v5 and v6 |
You don't really need to override the prefix in your bucket for This |
Hello @HuiSF, I just replicated the error with more logs on the the keys being deleted via for (const obj of objects.items) {
console.log("Deleting post key:", obj.key)
await remove({ key: obj.key })
} for (const obj of objects.items) {
console.log("Deleting sharedMedia key:", obj.key)
await remove({ key: obj.key })
} Output:
I have not yet removed my prefix override yet, but will and try to replicate it again. |
Thanks @ChristopherGabba the keys strings look normal to me (I found an instance that DeleteObject may encounter this error when the key contains quotes) How do you replicate this error, in a local environment? If so, I think if you can inspect the outgoing network request (request URL and headers) for this remove operation that would be helpful. |
@HuiSF I will try to do this and see what the headers are on the network request in the coming day or so. I should not have quotations in any object keys, but will confirm there is nothing weird going on. |
@HuiSF Managed to catch the bug in dev tools network tab: Here was the logs of the keys:
Headers Tab:
Preview Tab:
Response Tab:
Screenshot of Window: Note: This happened after about 10 delete attempts, so it's about 1/10. Note this also occured after removing the extra configurations regarding the For comparison if needed expand the below to see the successful deletion response headers immediately before this one failed: Headers Tab:
Screenshot of Successful deletion immediately before: |
Thanks @ChristopherGabba this is helpful. In the service responded error message, it mentioned about this header In addition, the Amplify library doesn't not attach this header any where. I noticed that |
@HuiSF I just double-checked. The only place I see And I counted 7 displayed ^ I do have sentry installed in my application, but if that was the cause, wouldn't it block every post DELETE request to the server? This all started occurring in the last few weeks. I did upgrade from |
@ChristopherGabba Thanks for confirming, this is odd, as the request doesn't have that header but the service complained about it... I don't have a clue now how this could happen at this moment. We do have integration tests performing similar amount of remove objects calls and it has not encountered this error so far. Could you check and try to disable any functionality that alters network request and run some tests see if it still reproducible? If it's still reproducible, could you create a minimum sample app for reproducing this issue and share with us? |
@HuiSF I disabled sentry in my app by removing all the sentry code and replicated the error. Here are the new logs and screenshot
Preview Tab <Error>
<Code>
NotImplemented
</Code>
<Message>
A header you provided implies functionality that is not implemented
</Message>
<Header>
If-Modified-Since
</Header>
<RequestId
>
WT9PF89AEVNQF1WS
</RequestId>
<HostId>
GBP19d6y72Gz7L2lqZWtv0NHB0XgUNw4iuRQi+46fOKi4BsSP+rYbbwdvGwVTuZm+wczx1wsOxo=
</HostId>
</Error> html <?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NotImplemented</Code><Message>A header you provided implies functionality that is not implemented</Message><Header>If-Modified-Since</Header><RequestId>WT9PF89AEVNQF1WS</RequestId><HostId>GBP19d6y72Gz7L2lqZWtv0NHB0XgUNw4iuRQi+46fOKi4BsSP+rYbbwdvGwVTuZm+wczx1wsOxo=</HostId></Error> |
@ChristopherGabba, let us know if you get a sample repro app up and running. I'll check with the team internally to see if we have one that can be used to duplicate this as well. |
@ChristopherGabba, just wanted to add that the |
@cwomack Just want to clarify, are you suggesting that I submit an issue with the S3 team? |
@ChristopherGabba, iterating this error is not thrown from Amplify. It is on the actual call to S3 delete object.
Since the library is not modifying this header. I could be happening from any of your dependency. We can try and help but at this we would need minimal repo code to see whats going on. |
Hi @ChristopherGabba. I am facing exactly the same issue. |
@ashika112 I will try to get a minimum reproducible example going for several of my errors in the coming weeks. |
@ashika112 @HuiSF I made a demo app but so far am unable to replicate the error. I'll keep trying in that app and try to replicate exactly what I'm doing in my main app. In the meantime, I'm now getting this error almost every time I send a Edit:
All of these seem to reference an issue where the Edit: Captured all the headers on the I do not see any other data included in the Request Headers that wasn't showing up in the chrome debugger. |
@ashika112 @HuiSF I just captured this What is interesting is that Sentry captured the following bug simultaneously: Basically I'm watching a video. When the video ends, I send a |
Okay I am getting the bug regardless of whether or not the video is playing. I read through this stack overflow thread: https://stackoverflow.com/questions/7670156/amazon-s3-getting-501-error-on-put and it seems to hint at a content-length header being set to 0 or empty? I also read in the same thread: I'm trying to use Charles Proxy but struggling with it, I will keep trying. |
@HuiSF @ashika112 @chrisbonifacio I invited you to a private repo and updated the ReadMe with instructions to reproduce the issue. |
@ChristopherGabba Thanks for the reproducible code. Will try to pull in and see whats happening. Can you also provide link to the repo? |
Here you go: https://github.com/ChristopherGabba/ReelFeelApp I've updated the ReadMe again, so please refer to it. I've made two accounts for troubleshooting and sent the same content for testing for the error. |
Good morning @chrisbonifacio / @HuiSF / @ashika112, hope all is well. If you guys need help reproducing the issue, or any other details, let me know and I can gladly get on the phone to discuss. |
Hey, @ChristopherGabba. Please reach out to me on Discord with your availability and email to invite. I'll schedule a call for tomorrow if that's okay. |
@ChristopherGabba as per our call, the cause of this issue seems to stem from some nested dependency or deeper network layer of Expo or React Native. Going to close this issue and ask that anyone else running into this please track the issues opened on the Expo and React Native repos regarding the headers mentioned in this thread. I hope those teams are able to help out and you're unblocked soon 🙏 |
In my case, I got the error message when the path includes '-' in the folder name, and when I got the '-' removed, it is working fine |
Before opening, please confirm:
JavaScript Framework
React Native
Amplify APIs
Storage
Amplify Version
v6
Amplify Categories
storage
Backend
Amplify Gen 2 (Preview)
Environment information
Describe the bug
When a post is deleted in my application, I use the
list
andremove
functions from the aws-amplify storage. When it hits the remove() function, occasionally (maybe 1 in 4 post deletions) this error comes up and it fails the deletion.Expected behavior
This error should not appear and it should successfully delete my post. What is interesting is that I have not changed anything in this function in months and this error started appearing a week ago and I can't pinpoint what it's telling me.
Reproduction steps
Refer to reproducible code below.
Code Snippet
Here is my delete function:
Log output
aws-exports.js
Manual configuration
Amplifyconfiguration.json
Additional configuration
App entry extra:
Mobile Device
iPhone 12
Mobile Operating System
iOS 17.3
Mobile Browser
Safari
Mobile Browser Version
No response
Additional information and screenshots
No response
The text was updated successfully, but these errors were encountered: