Skip to content

S3 endpoint tries to resolve protocol as host? #2603

Description

@CallMeTerdFerguson

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions