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

3.23.0 causes S3 errors (works in 3.22.0) #1262

Closed
mdmm13 opened this issue Mar 29, 2024 · 7 comments
Closed

3.23.0 causes S3 errors (works in 3.22.0) #1262

mdmm13 opened this issue Mar 29, 2024 · 7 comments

Comments

@mdmm13
Copy link

mdmm13 commented Mar 29, 2024

Problem: 3.2.3 breaks S3 loading of files from source, downgrade back to 3.2.2 resolves problem.

Error:

ERROR   [2024-03-29T22:25:53Z] Completed in 935.689µs /unsafe/size:140:140:1:1/resizing_type:fit/sharpen:0.3/plain/s3://XXXXXX/rr/DJI_1234-Verbessert.jpg@webp  request_id=9mbu4TpqeiXXXXXXXX method=GET status=500 client_ip=XXX.XXX.XXX.XXX error="Can't download source image: Get \"s3://XXXXXX/rr/DJI_1234-Verbessert.jpg\": operation error S3: GetObject, resolve auth scheme: resolve endpoint: endpoint rule error, Custom endpoint `s3.eu-central-003.XXX.com` was not a valid URI"

Debugging: Unclear what causes this, because the only change was a "docker compose pull" to upgrade and restart, no other config changes were made. Possibly S3 dependency upgrades to aws-sdk-go-v2?

@DarthSim
Copy link
Member

Hey @mdmm13!

I believe you mean v3.23.0, and yes, we migrated to aws-sdk-go-v2. I guess the problem is that your custom S3 endpoint lacks URL schema.

@mdmm13 mdmm13 changed the title 3.2.3 causes S3 errors (works in 3.2.2) 3.23.0 causes S3 errors (works in 3.22.0) Apr 3, 2024
@mdmm13
Copy link
Author

mdmm13 commented Apr 3, 2024

Hey @mdmm13!

I believe you mean v3.23.0, and yes, we migrated to aws-sdk-go-v2. I guess the problem is that your custom S3 endpoint lacks URL schema.

Thank you for the swift reply. Correct (updated title), but what do you mean by "custom S3 endpoint lacks URL schema"? Do we have to configure the environment variables differently in 3.23 vs 3.22? I checked the changelog and wasn't aware of any breaking changes.

@DarthSim
Copy link
Member

DarthSim commented Apr 4, 2024

From the error message you've posted, I guess that you've set a custom S3 endpoint using the IMGPROXY_S3_ENDPOINT config. An S3 endpoint should contain a URL schema:

Bad: example.com
Good: https://example.com

It seems like aws-sdk-go allows providing custom endpoints without URL schema (while I believe it should not) but aws-sdk-go-v2 requires it.

@jantomgid
Copy link

Hi @DarthSim I'm also getting issues with S3, we use AWS buckets, not custom endpoints, the same configuration works fine in version 3.22.0

{"client_ip":"x.x.x.x", "error":"Can't download source image: Status: 404; operation error S3: GetObject, https response error StatusCode: 404, RequestID: xxx, HostID: xxx, NoSuchKey: ","level":"error","method":"GET","msg":"Completed in 10.264341ms /plain/resize:fit:640:640:0:sm/plain/s3://example-bucket//foo/bar/baz@jpg","request_id":"xxx","status":404,"time":"2024-05-08T08:35:06Z"}

I have confirmed manually that the object actually exists in the bucket.

@jantomgid
Copy link

jantomgid commented May 8, 2024

We have found an issue, when there are two slashes after the bucket name

example-bucket//foo

instead of

example-bucket/foo

it works fine in v3.22.0, but not in v3.23.0 and newer, probably because of aws-sdk-go-v2.

@DarthSim
Copy link
Member

DarthSim commented May 8, 2024

Yeah, aws-sdk-go-v2 seems to be more strict

@DarthSim
Copy link
Member

DarthSim commented May 9, 2024

I patched the latest build so S3 integration works more like before:

  • http:// is added to the custom endpoint if it has no scheme.
  • All the leading slashes are trimmed from object keys.

@DarthSim DarthSim closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants