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

Unable to deploy to S3-Compatible (MinIO) service with hugo deploy #13159

Closed
tebriel opened this issue Dec 17, 2024 · 1 comment · Fixed by #13158
Closed

Unable to deploy to S3-Compatible (MinIO) service with hugo deploy #13159

tebriel opened this issue Dec 17, 2024 · 1 comment · Fixed by #13158

Comments

@tebriel
Copy link
Contributor

tebriel commented Dec 17, 2024

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.139.3+extended+withdeploy linux/amd64 BuildDate=unknown VendorInfo=nixpkgs

Does this issue reproduce with the latest release?

Yes (using master)

My Configuration:

---
baseURL: https://blog.frodux.in/
disablePathToLower: true
languageCode: en-us
title: Chris' Software Blog
theme: 'ananke'

deployment:
  targets:
    - name: production
      # https://gocloud.dev/howto/blob/#s3-compatible
      url: "s3://blog?endpoint=minio-us.infra.frodux.in&disableSSL=false&s3ForcePathStyle=true"

Example Error:

$ hugo deploy
Deploying to target "production" (s3://blog?endpoint=minio-us.infra.frodux.in&disableSSL=false&s3ForcePathStyle=true)
Error: open bucket s3://blog?endpoint=minio-us.infra.frodux.in&disableSSL=false&s3ForcePathStyle=true: unknown query parameter "disableSSL"

Debugging Log to help improve issue search for others experiencing similar issues

Paring down the unsupported options, all the way down to `s3://blog?endpoint=minio-uss.infra.frodux.in" results in the following:

Deploying to target "production" (s3://blog?endpoint=minio-us.infra.frodux.in)
Error: blob (code=Unknown): operation error S3: ListObjectsV2, exceeded maximum number of attempts, 3, https response error StatusCode: 0, RequestID: , HostID: , request send failed, Get "//blog./minio-us.infra.frodux.in?list-type=2&max-keys=1000": unsupported protocol scheme ""

Ok, let's then specify a protocol on the endpoint and use the secret awssdk=v2 option we found in the gocloud docs.

Deploying to target "production" (s3://blog?endpoint=https://minio-us.infra.frodux.in&awssdk=v2)
Error: blob (code=Unknown): operation error S3: ListObjectsV2, https response error StatusCode: 0, RequestID: , HostID: , request send failed, Get "https://blog.minio-us.infra.frodux.in/?list-type=2&max-keys=1000": dial tcp: lookup blog.minio-us.infra.frodux.in: no such host

Wait why is it now making the endpoint blog.<endpoint>? Oh, let's force path style instead of DNS style as documented in gocloud code

hugo deploy
Deploying to target "production" (s3://blog?endpoint=https://minio-us.infra.frodux.in&awssdk=v2&s3ForcePathStyle=true)
Error: open bucket s3://blog?endpoint=https://minio-us.infra.frodux.in&awssdk=v2&s3ForcePathStyle=true: unknown query parameter "s3ForcePathStyle"

or

hugo deploy
Deploying to target "production" (s3://blog?endpoint=https://minio-us.infra.frodux.in&awssdk=v2&use_path_style=true)
Error: open bucket s3://blog?endpoint=https://minio-us.infra.frodux.in&awssdk=v2&use_path_style=true: unknown query parameter "use_path_style"

Fix

Upgrading to gocloud 0.40.0 seems to fix it

$ hugo version
hugo v0.141.0-DEV-d66f1aa08f087f99a631227fec4e2939f199cbc3+extended+withdeploy linux/amd64 BuildDate=2024-12-17T17:12:29Z

$ hugo deploy
Deploying to target "production" (s3://blog?endpoint=https://minio-us.infra.frodux.in&awssdk=v2&use_path_style=true&disable_https=false)
Identified 27 file(s) to upload, totaling 148 kB, and 0 file(s) to delete.
Success!
Success!
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants