Upload Artifakt to S3 not working: bad URI(is not URI?)

Hello GitLab Community.

I’m trying to configure Object Store on my GitLab instance. My gowl is to store artifacts in an S3 bucket. Somehow I got the following error in /home/git/gitlab/log/api_json.log:

{
  "time": "2021-02-23T14:58:58.622Z",
  "severity": "INFO",
  "duration_s": 3.18635,
  "db_duration_s": 0.20156,
  "view_duration_s": 2.98479,
  "status": 500,
  "method": "POST",
  "path": "/api/v4/jobs/157159/artifacts/authorize",
  "params": [
    {
      "key": "artifact_format",
      "value": "zip"
    },
    {
      "key": "artifact_type",
      "value": "archive"
    }
  ],
  "host": "xxx",
  "remote_ip": "172.21.44.92",
  "ua": "gitlab-runner 13.8.0 (13-8-stable; go1.13.8; linux/amd64)",
  "route": "/api/:version/jobs/:id/artifacts/authorize",
  "exception.class": "URI::InvalidURIError",
  "exception.message": "bad URI(is not URI?): \"://s3.eu-central-1.amazonaws.com:\"",
  "exception.backtrace": [
    "lib/object_storage/direct_upload.rb:216:in `block in upload_id'",
    "lib/gitlab/utils/strong_memoize.rb:30:in `strong_memoize'",
    "lib/object_storage/direct_upload.rb:215:in `upload_id'",
    "lib/object_storage/direct_upload.rb:158:in `multipart_part_upload_url'",
    "lib/object_storage/direct_upload.rb:148:in `block in multipart_part_urls'",
    "lib/object_storage/direct_upload.rb:147:in `initialize'",
    "lib/object_storage/direct_upload.rb:147:in `new'",
    "lib/object_storage/direct_upload.rb:147:in `multipart_part_urls'",
    "lib/object_storage/direct_upload.rb:58:in `multipart_upload_hash'",
    "lib/object_storage/direct_upload.rb:47:in `to_hash'",
    "app/uploaders/object_storage.rb:211:in `workhorse_remote_upload_options'",
    "app/uploaders/object_storage.rb:185:in `block in workhorse_authorize'",
    "app/uploaders/object_storage.rb:183:in `tap'",
    "app/uploaders/object_storage.rb:183:in `workhorse_authorize'",
    "app/services/ci/create_job_artifacts_service.rb:26:in `authorize'",
    "lib/api/ci/runner.rb:255:in `block (2 levels) in <class:Runner>'",
    "lib/api/api_guard.rb:213:in `call'",
    "lib/gitlab/request_profiler/middleware.rb:17:in `call'",
    "lib/gitlab/jira/middleware.rb:19:in `call'",
    "lib/gitlab/middleware/go.rb:20:in `call'",
    "lib/gitlab/etag_caching/middleware.rb:21:in `call'",
    "lib/gitlab/middleware/multipart.rb:172:in `call'",
    "lib/gitlab/middleware/read_only/controller.rb:50:in `call'",
    "lib/gitlab/middleware/read_only.rb:18:in `call'",
    "lib/gitlab/middleware/same_site_cookies.rb:27:in `call'",
    "lib/gitlab/middleware/handle_malformed_strings.rb:21:in `call'",
    "lib/gitlab/middleware/basic_health_check.rb:25:in `call'",
    "lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call'",
    "lib/gitlab/middleware/request_context.rb:23:in `call'",
    "config/initializers/fix_local_cache_middleware.rb:9:in `call'",
    "lib/gitlab/metrics/requests_rack_middleware.rb:76:in `call'",
    "lib/gitlab/middleware/release_env.rb:12:in `call'"
  ],
  "redis_calls": 1,
  "redis_duration_s": 0.003674,
  "redis_read_bytes": 2,
  "redis_write_bytes": 116,
  "redis_cache_calls": 1,
  "redis_cache_duration_s": 0.003674,
  "redis_cache_read_bytes": 2,
  "redis_cache_write_bytes": 116,
  "db_count": 7,
  "db_write_count": 0,
  "db_cached_count": 0,
  "correlation_id": "01EZ7PCY91P37T2QWS61C864M3",
  "meta.user": "tst",
  "meta.project": "tst/01_test_basic",
  "meta.root_namespace": "tst",
  "meta.caller_id": "/api/:version/jobs/:id/artifacts/authorize",
  "meta.remote_ip": "172.21.44.92",
  "meta.feature_category": "continuous_integration",
  "content_length": "0"
}

It seams that I’ve configured a wrong S3 URL.

Information about my GitLab Instance

I’m using the docker image from sameersbn: sameersbn/gitlab:13.8.4

Thous are (some) of the ENVs that I’ve configured:

  • GITLAB_ARTIFACTS_OBJECT_STORE_ENABLED = true
  • GITLAB_ARTIFACTS_OBJECT_STORE_REMOTE_DIRECTORY = name-of-the-bucket
  • AWS_ACCESS_KEY_ID = xxx
  • AWS_SECRET_ACCESS_KEY = yyy
  • GITLAB_ARTIFACTS_OBJECT_STORE_CONNECTION_AWS_REGION = eu-central-1
  • GITLAB_ARTIFACTS_OBJECT_STORE_DIRECT_UPLOAD = true

With this configuration the artifakt should be directly uploaded to the s3 bucket. The IAM Credentials are configured so that they have full access to the configured bucket.

The output of the file /home/git/gitlab/config/gitlab.yml is the following:

My .gitlab-ci.yml is not very special:

stages:
  - artifact

artifact:
  stage: artifact
  artifacts:
    paths:
      - file.txt
  script:
    - echo "This is a simple test" > file.txt

If somebody has the same issue or approaches to the solution I would be thankfull.

Thanks in advanced for your help.