nginxinc / nginx-s3-gateway

NGINX S3 Caching Gateway
Apache License 2.0
488 stars 127 forks source link

Container start fails because of missing S3_SERVICE variable #247

Closed zc-devs closed 3 months ago

zc-devs commented 3 months ago

Describe the bug

Pod fails to run with error:

Required S3_SERVICE environment variable missing

while documentation says that there should be s3 default value.

BTW, documentation formatting is broken and there is no description as well.

To reproduce

Steps to reproduce the behavior:

  1. Start container with config
    apiVersion: v1
    kind: ConfigMap
    metadata:
    name: ngs3gw
    data:
    S3_STYLE: path
    S3_BUCKET_NAME: main
    S3_SERVER: minio.minio.svc.cluster.local
    S3_SERVER_PROTO: http
    S3_SERVER_PORT: "9000"
    S3_REGION: eu
    DEBUG: "true"
    AWS_SIGS_VERSION: "4"
    ALLOW_DIRECTORY_LIST: "true"
  2. View logs of Pod
  3. See error
    /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
    /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
    /docker-entrypoint.sh: Launching /docker-entrypoint.d/00-check-for-required-env.sh
    Required S3_SERVICE environment variable missing

Expected behavior

Container/Pod starts.

Your environment

Additional context

Worked on unprivileged-oss-20240113. Works on unprivileged-oss-20240507 if S3_SERVICE: s3 is set.

4141done commented 3 months ago

Thank you for flagging this @zc-devs and I really apologize for the oversight. I put together a quick fix and tested against the two s3 services we support. Can you check that this branch works as you expect? https://github.com/nginxinc/nginx-s3-gateway/pull/248

4141done commented 3 months ago

Thank you for flagging this @zc-devs and I really apologize for the oversight. I put together a quick fix and tested against the two s3 services we support. Can you check that this branch works as you expect? #248

I'm actually going to go ahead and merge so fewer people are bitten by this. Please let me know if the new image works for you.

zc-devs commented 3 months ago

@4141done, it works well. Thank you for a quick fix.