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

bug: S3 Storage: forcePathStyle setting not preventing bucket name from being prepended to endpoint URL #7004

Open
2 of 3 tasks
ianks opened this issue Feb 7, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@ianks
Copy link

ianks commented Feb 7, 2025

Describe the bug

When using S3-compatible storage (MinIO), the bucket name is incorrectly prepended to the endpoint URL despite having forcePathStyle: true set in the configuration. This causes DNS resolution failures as the system attempts to access {bucketName}.{endpoint} instead of using path-style access ({endpoint}/{bucketName}).

Error encountered:

error Error: getaddrinfo ENOTFOUND logto.s.foo.com
    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26) {
  errno: -3008,
  code: 'ENOTFOUND',
  syscall: 'getaddrinfo',
  hostname: 'logto.s.foo.com',
  '$metadata': { attempts: 1, totalRetryDelay: 0 }
}

Expected behavior

With forcePathStyle: true, requests should be made to s.foo.com/logto instead of attempting to access logto.s.foo.com.

How to reproduce?

  1. Configure MinIO or other S3-compatible storage with the following settings:
{
  "bucket": "logto", 
  "endpoint": "https://s.foo.com", 
  "provider": "S3Storage", 
  "accessKeyId": "[redacted]",
  "accessSecretKey": "[redacted]",
  "forcePathStyle": true,
  "publicUrl": "https://s.foo.com"
}
  1. Attempt to upload a file or access storage
  2. Observe error logs showing attempts to access logto.s.foo.com instead of s.foo.com/logto

Context

  • Self-hosted, Logto version = 1.10.0
    • Container (Docker image)
    • Raw Node.js
@ianks ianks added the bug Something isn't working label Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants