S3 endpoint tries to resolve protocol as host? #2135

Closed
opened 2026-02-05 03:03:27 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @CallMeTerdFerguson on GitHub (Mar 2, 2021).

Describe the bug
I'm attempting to set up s3 compatible storage using Minio with Bookstack. Bookstack is running via Docker and my Minio cluster is up and running behind a Nginx SSL terminating, load balancing proxy and all works correctly for other applications/CLI's. The secret and key I am using both work correctly via other tools and have full permissions to the bucket. But when I provide the below conf (sanitized), I get the following error. Based on laravel.log, it seems like what I put in the STORAGE_S3_ENDPOINT and STORAGE_URL fields is getting an additional "http://" prepended, causing failures. Is there some configuration step I've missed? I have tried several other values for these configs and always get the prepended http://, which doesn't work for me as I'm load balancing on an https:// endpoint. Unsure if this is a bug or a simple misconfiguration on my part, but any help would be greatly appreciated.

Steps To Reproduce
Steps to reproduce the behavior:
Provide the following conf via .env file to docker-compose:

#Showing only relevant conf
STORAGE_TYPE=s3
STORAGE_S3_KEY=ThisIsAWorkingKey
STORAGE_S3_SECRET=ThisIsAWorkingSecret
STORAGE_S3_REGION=us-west-1
STORAGE_S3_BUCKET=bookstack
STORAGE_S3_ENDPOINT=https://minio.santizeddomain.com
STORAGE_URL=https://minio.sanitizeddomain.com/bookstack

Attempt to upload an image and get the following error in the logs:

[2021-03-02 15:37:19] production.ERROR: Error executing "ListObjects" on "//https://minio.sanitizeddomain.com"; AWS HTTP error: cURL error 6: Could not resolve host: https (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://https://minio.sanitizeddomain.com {"userId":1,"exception":"[object] (Aws\\S3\\Exception\\S3Exception(code: 0): Error executing \"ListObjects\" on \"//https://minio.sanitizeddomain.com\"; AWS HTTP error: cURL error 6: Could not resolve host: https (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://https://minio.sanitizeddomain.com at /var/www/html/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:195)
[stacktrace]
#0 /var/www/html/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php(97): Aws\\WrappedHttpHandler->parseError(Array, Object(GuzzleHttp\\Psr7\\Request), Object(Aws\\Command), Array)
#1 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(204): Aws\\WrappedHttpHandler->Aws\\{closure}(Array)

[previous exception] [object] (GuzzleHttp\\Exception\\ConnectException(code: 0): cURL error 6: Could not resolve host: https (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://https://minio.sanitizeddomain.com at /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210)
[stacktrace]
#0 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(158): GuzzleHttp\\Handler\\CurlFactory::createRejection(Object(GuzzleHttp\\Handler\\EasyHandle), Array)
#1 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(110): GuzzleHttp\\Handler\\CurlFactory::finishError(Object(GuzzleHttp\\Handler\\CurlMultiHandler), Object(GuzzleHttp\\Handler\\EasyHandle), Object(GuzzleHttp\\Handler\\CurlFactory))

Expected behavior
Expect calls to go directly to the endpoint i define on the protocol i define.

Screenshots
If applicable, add screenshots to help explain your problem.

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): BookStack v0.31.6 via the latest tag on ghcr.io/linuxserver/bookstack
  • PHP Version: 7.3.27
  • Hosting Method (Nginx/Apache/Docker): Docker

Additional context
Add any other context about the problem here.

Originally created by @CallMeTerdFerguson on GitHub (Mar 2, 2021). **Describe the bug** I'm attempting to set up s3 compatible storage using Minio with Bookstack. Bookstack is running via Docker and my Minio cluster is up and running behind a Nginx SSL terminating, load balancing proxy and all works correctly for other applications/CLI's. The secret and key I am using both work correctly via other tools and have full permissions to the bucket. But when I provide the below conf (sanitized), I get the following error. Based on laravel.log, it seems like what I put in the STORAGE_S3_ENDPOINT and STORAGE_URL fields is getting an additional "http://" prepended, causing failures. Is there some configuration step I've missed? I have tried several other values for these configs and always get the prepended http://, which doesn't work for me as I'm load balancing on an https:// endpoint. Unsure if this is a bug or a simple misconfiguration on my part, but any help would be greatly appreciated. **Steps To Reproduce** Steps to reproduce the behavior: Provide the following conf via .env file to docker-compose: ``` #Showing only relevant conf STORAGE_TYPE=s3 STORAGE_S3_KEY=ThisIsAWorkingKey STORAGE_S3_SECRET=ThisIsAWorkingSecret STORAGE_S3_REGION=us-west-1 STORAGE_S3_BUCKET=bookstack STORAGE_S3_ENDPOINT=https://minio.santizeddomain.com STORAGE_URL=https://minio.sanitizeddomain.com/bookstack ``` Attempt to upload an image and get the following error in the logs: ``` [2021-03-02 15:37:19] production.ERROR: Error executing "ListObjects" on "//https://minio.sanitizeddomain.com"; AWS HTTP error: cURL error 6: Could not resolve host: https (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://https://minio.sanitizeddomain.com {"userId":1,"exception":"[object] (Aws\\S3\\Exception\\S3Exception(code: 0): Error executing \"ListObjects\" on \"//https://minio.sanitizeddomain.com\"; AWS HTTP error: cURL error 6: Could not resolve host: https (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://https://minio.sanitizeddomain.com at /var/www/html/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:195) [stacktrace] #0 /var/www/html/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php(97): Aws\\WrappedHttpHandler->parseError(Array, Object(GuzzleHttp\\Psr7\\Request), Object(Aws\\Command), Array) #1 /var/www/html/vendor/guzzlehttp/promises/src/Promise.php(204): Aws\\WrappedHttpHandler->Aws\\{closure}(Array) [previous exception] [object] (GuzzleHttp\\Exception\\ConnectException(code: 0): cURL error 6: Could not resolve host: https (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for http://https://minio.sanitizeddomain.com at /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:210) [stacktrace] #0 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(158): GuzzleHttp\\Handler\\CurlFactory::createRejection(Object(GuzzleHttp\\Handler\\EasyHandle), Array) #1 /var/www/html/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php(110): GuzzleHttp\\Handler\\CurlFactory::finishError(Object(GuzzleHttp\\Handler\\CurlMultiHandler), Object(GuzzleHttp\\Handler\\EasyHandle), Object(GuzzleHttp\\Handler\\CurlFactory)) ``` **Expected behavior** Expect calls to go directly to the endpoint i define on the protocol i define. **Screenshots** If applicable, add screenshots to help explain your problem. **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): BookStack v0.31.6 via the latest tag on ghcr.io/linuxserver/bookstack - PHP Version: 7.3.27 - Hosting Method (Nginx/Apache/Docker): Docker **Additional context** Add any other context about the problem here.
OVERLORD added the 🐛 Bug🏭 Back-End labels 2026-02-05 03:03:27 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Mar 2, 2021):

Thanks for reporting @agrider.

Just tested this on my end within minio and could re-produce.
Tracked it back to an issue in the core php aws library.

A fix is available but requires an update of dependencies.
I'll see if I can get a patch release out soon to cover this.

@ssddanbrown commented on GitHub (Mar 2, 2021): Thanks for reporting @agrider. Just tested this on my end within minio and could re-produce. Tracked it back to an issue in the core [php aws library](https://github.com/aws/aws-sdk-php/issues/2189). A fix is available but requires an update of dependencies. I'll see if I can get a patch release out soon to cover this.
Author
Owner

@ssddanbrown commented on GitHub (Mar 3, 2021):

@agrider I've just deployed v0.31.7 which should solve this (Tested on my machine with minio): https://github.com/BookStackApp/BookStack/releases/tag/v0.31.7

The linuxserver image should follow shortly (They usually have a new image up within an hour after a release is published). Just shout if you continue to have issues after upgrade to v0.31.7.

@ssddanbrown commented on GitHub (Mar 3, 2021): @agrider I've just deployed v0.31.7 which should solve this (Tested on my machine with minio): https://github.com/BookStackApp/BookStack/releases/tag/v0.31.7 The linuxserver image should follow shortly (They usually have a new image up within an hour after a release is published). Just shout if you continue to have issues after upgrade to v0.31.7.
Author
Owner

@CallMeTerdFerguson commented on GitHub (Mar 3, 2021):

Awesome, thanks for the super fast response. I'll give the new version a swing this evening once lsio posts the new container.

@CallMeTerdFerguson commented on GitHub (Mar 3, 2021): Awesome, thanks for the super fast response. I'll give the new version a swing this evening once lsio posts the new container.
Author
Owner

@ssddanbrown commented on GitHub (Mar 3, 2021):

@agrider No problem!

Should not be long now, Their build is in progress: https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-bookstack/detail/master/355/pipeline

@ssddanbrown commented on GitHub (Mar 3, 2021): @agrider No problem! Should not be long now, Their build is in progress: https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-bookstack/detail/master/355/pipeline
Author
Owner

@CallMeTerdFerguson commented on GitHub (Mar 3, 2021):

@ssddanbrown Just pulled the latest image and confirmed the fix on my end. Thanks again!

@CallMeTerdFerguson commented on GitHub (Mar 3, 2021): @ssddanbrown Just pulled the latest image and confirmed the fix on my end. Thanks again!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2135