backup to external minio fails with `WARNING: Ignoring invalid line in '/home/git/.s3cfg': provider: AWS`

Summary

Backup isn't working with external minio storage.

Steps to reproduce

Deploy gitlab with external minio

(Please provide the steps to reproduce the issue)

Configuration used

storage.config

# Example configuration of `connection` secret for Rails
# Example for Minio storage
#   See https://gitlab.com/gitlab-org/charts/gitlab/blob/master/doc/charts/globals.md#connection
#   See https://gitlab.com/gitlab-org/charts/gitlab/blob/master/doc/advanced/external-object-storage
provider: AWS
# Specify the region
region: us-east-1
# Specify access/secret keys
aws_access_key_id: aws_access_key_id
aws_secret_access_key: aws_access_key_id
# The below settings are for S3 compatible endpoints
#   See https://docs.gitlab.com/ee/administration/job_artifacts.html#s3-compatible-connection-settings
aws_signature_version: 4
host: minio.mycompany.com
endpoint: "http://minio.mycompany.com:9000"
path_style: true

gitlab-values.yaml storage.config

# reference : https://gitlab.com/gitlab-org/charts/gitlab/-/raw/master/values.yaml
# https://docs.gitlab.com/charts/installation/command-line-options.html
# https://docs.gitlab.com/charts/installation/tls.html#option-3-use-individual-certificate-per-service
certmanager-issuer:
  email: myemail@mycompany.com

global:
  minio:
    enabled: false
  hosts:
    domain: mycompany.com
    externalIP: 10.10.10.10
    gitlab:
      name: gitlab.mycompany.com
      https: true
  appConfig:
    lfs:
      bucket: gitlab-lfs-storage
      connection:
        secret: gitlab-rails-storage
        key: connection
    artifacts:
      bucket: gitlab-artifacts-storage
      connection:
        secret: gitlab-rails-storage
        key: connection
    uploads:
      bucket: gitlab-uploads-storage
      connection:
        secret: gitlab-rails-storage
        key: connection
    packages:
      bucket: gitlab-packages-storage
      connection:
        secret: gitlab-rails-storage
        key: connection

    backups:
      bucket: gitlab-backup-storage
      tmpBucket: gitlab-tmp-storage
      connection:
        secret: gitlab-rails-storage
        key: connection

gitlab-runner:
  install: false

registry:
  enabled: false

gitlab:
  task-runner:
    backups:
      cron:
        enabled: true
        schedule: "@hourly"
      objectStorage:
        config:
          secret: storage-config
          key: config

rails.minio.yaml gitlab-rails-storage

# Example configuration of `connection` secret for Rails
# Example for Minio storage
#   See https://gitlab.com/gitlab-org/charts/gitlab/blob/master/doc/charts/globals.md#connection
#   See https://gitlab.com/gitlab-org/charts/gitlab/blob/master/doc/advanced/external-object-storage
provider: AWS
# Specify the region
region: us-east-1
# Specify access/secret keys
aws_access_key_id: aws_access_key_id
aws_secret_access_key: aws_secret_access_key
# The below settings are for S3 compatible endpoints
#   See https://docs.gitlab.com/ee/administration/job_artifacts.html#s3-compatible-connection-settings
aws_signature_version: 4
host: minio.mycompany.com
endpoint: "http://minio.mycompany.com:9000"
path_style: true

(Please provide a sanitized version of the configuration used wrapped in a code block (```yaml))

(Paste sanitized configuration here)

Current behavior

When I run backup utility command from task runner pod, it throws this error `git@gitlab-task-runner-yyyyyyyyyyyyyyyy:/$ backup-utility 2020-08-31 15:21:12 +0000 -- Dumping database ... Dumping PostgreSQL database gitlabhq_production ... [DONE] 2020-08-31 15:21:14 +0000 -- done 2020-08-31 15:21:21 +0000 -- Dumping repositories ... 2020-08-31 15:21:21 +0000 -- done Bucket not found: registry. Skipping backup of registry ... Bucket not found: gitlab-uploads-storage. Skipping backup of uploads ... Bucket not found: gitlab-artifacts-storage. Skipping backup of artifacts ... Bucket not found: gitlab-lfs-storage. Skipping backup of lfs ... Bucket not found: gitlab-packages-storage. Skipping backup of packages ... Bucket not found: gitlab-mr-diffs. Skipping backup of external_diffs ... Bucket not found: gitlab-terraform-state. Skipping backup of terraform_state ... Packing up backup tar WARNING: Ignoring invalid line in '/home/git/.s3cfg': provider: AWS

WARNING: Ignoring invalid line in '/home/git/.s3cfg': region: us-east-1

WARNING: Ignoring invalid line in '/home/git/.s3cfg': aws_access_key_id: aws_access_key_id

WARNING: Ignoring invalid line in '/home/git/.s3cfg': aws_secret_access_key: aws_secret_access_key

WARNING: Ignoring invalid line in '/home/git/.s3cfg': aws_signature_version: 4

WARNING: Ignoring invalid line in '/home/git/.s3cfg': host: minio.mycompany.com

WARNING: Ignoring invalid line in '/home/git/.s3cfg': endpoint: "http://minio.mycompany.com:9000"

WARNING: Ignoring invalid line in '/home/git/.s3cfg': path_style: true ERROR: /home/git/.s3cfg: Network is unreachable ERROR: Configuration file not available. ERROR: Consider using --configure parameter to create one`

Expected behavior

It backs up to the external minio

Versions

  • Chart: (tagged version | branch | hash git rev-parse HEAD)
  • Platform:
    • Cloud: (GKE | AKS | EKS | ?)
    • Self-hosted: (OpenShift | Minikube | Rancher RKE | ?)
  • Kubernetes: (kubectl version)
    • Client:
    • Server:
  • Helm: (helm version)
    • Client:
    • Server:

Relevant logs

(Please provide any relevate log snippets you have collected, using code blocks (```) to format)

Edited by Gajendra D Ambi