Please help out here

Please help out here. So I have moved alot of our data from S3 to using R2. Now everything is working, on django I have made a custom storage class, and some models are using it. While everything is working there is one small issue. I am trying to get the file size but when I try to get the file size I get the 400 head object error. And this happens on the endpoint url and not on the custom domain. How to force botocore to use the custom domain, else where its using custom domain as it is...so why here.
class R2Storage(S3Boto3Storage):
------
endpoint_url = settings.R2_ENDPOINT_URL
------
class R2Storage(S3Boto3Storage):
------
endpoint_url = settings.R2_ENDPOINT_URL
------
16 Replies
Raghav Sharma
Raghav SharmaOP2y ago
I want to force botocore to use the custom domain anyone?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Raghav Sharma
Raghav SharmaOP2y ago
So then why would we be getting a 400 Head object error when calling the the size of the file why would this happen. Interestingly locally when I try it on my laptop I dont get such an error
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Raghav Sharma
Raghav SharmaOP2y ago
I am hitting the non custom domain on production as well is this connected to cors by any chance?
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Raghav Sharma
Raghav SharmaOP2y ago
no... I just get this error All I want is the size of the object, any idea how to curl it manually? not able to figure out how to authorise it
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Raghav Sharma
Raghav SharmaOP2y ago
cf2bede0326231f6f2e51abc82a027e7
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Raghav Sharma
Raghav SharmaOP2y ago
wait ... give me second can you check? I just sent a 400 request @sdnts ^
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Raghav Sharma
Raghav SharmaOP2y ago
Oh...botocore is doing this I try to get the image.size
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Raghav Sharma
Raghav SharmaOP2y ago
due to which this happens ok thanks alot!! It worked
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server