K8S: ERROR: Error cleaning up configmap: resource name may not be empty

Summary

We use GitLab Runner on a K8S cluster. Randomly, we get this error on job init:

Running with gitlab-runner 13.10.0 (54944146)
on gitlab-runner-gitlab-runner-xxxx xxxxx
feature flags: FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY:false, FF_USE_FASTZIP:true, FF_GITLAB_REGISTRY_HELPER_IMAGE:true

Resolving secrets

Preparing the "kubernetes" executor

Using Kubernetes namespace: ci
Using Kubernetes executor with image example.com/alpine:3 ...
Using attach strategy to execute scripts...

Preparing environment

ERROR: Error cleaning up configmap: resource name may not be empty
ERROR: Job failed (system failure): prepare environment: setting up scripts configMap: generating scripts config map: rpc error: code = Unknown desc = auth: revision in header is old. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

Steps to reproduce

I don't know. I'm not sure but it looks like issue began when I added shared S3 cache.

Actual behavior

Job init failure

Expected behavior

No ConfigMap error

Relevant logs and/or screenshots

job log
Running with gitlab-runner 13.10.0 (54944146)
on gitlab-runner-gitlab-runner-xxxx xxxxx
feature flags: FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY:false, FF_USE_FASTZIP:true, FF_GITLAB_REGISTRY_HELPER_IMAGE:true

Resolving secrets

Preparing the "kubernetes" executor

Using Kubernetes namespace: ci
Using Kubernetes executor with image example.com/alpine:3 ...
Using attach strategy to execute scripts...

Preparing environment

ERROR: Error cleaning up configmap: resource name may not be empty
ERROR: Job failed (system failure): prepare environment: setting up scripts configMap: generating scripts config map: rpc error: code = Unknown desc = auth: revision in header is old. Check https://docs.gitlab.com/runner/shells/index.html#shell-profile-loading for more information

Environment description

We're using GitLab Runner 13.10.0 (issue also happened with GitLab Runner 13.9.0)

config.toml contents
[[runners]]
      environment = ["FF_GITLAB_REGISTRY_HELPER_IMAGE=true", "FF_USE_FASTZIP=true", "FF_USE_LEGACY_KUBERNETES_EXECUTION_STRATEGY=false", "CACHE_COMPRESSION_LEVEL=fastest"]

      [runners.kubernetes]
        image = "example.com/alpine:3"
        image_pull_secrets = [example-com-dckr"]

        privileged = false
        namespace = "ci"
        poll_timeout = 600

        cpu_request = "600m"
        memory_request = "512Mi"

        service_cpu_request = "100m"
        service_memory_request = "128Mi"
        service_cpu_limit = "200m"
        service_memory_limit = "256Mi"

        helper_image = "example.com/gitlab-runner-helper:x86_64-v${CI_RUNNER_VERSION}" # Just a mirror
        helper_cpu_request = "100m"
        helper_memory_request = "128Mi"
        helper_cpu_limit = "200m"
        helper_memory_limit = "256Mi"

        [runners.cache]
          Type = "s3"
          Shared = true
          [runners.cache.s3]
            ServerAddress = "xxxx"
            BucketName = "xxxx"
            BucketLocation = "xxxx"

        [runners.kubernetes.node_selector]
          "k8s.scaleway.com/xxxx-pool" = "ci"

        [runners.kubernetes.node_tolerations]
          "k8s.scaleway.com/xxxxx-context=ci" = "NoSchedule"

        [[runners.kubernetes.host_aliases]]
          ip = "127.0.0.1"
          hostnames = ["localhost.example.com"]
        [[runners.kubernetes.host_aliases]]
          ip = "1.2.3.4"
          hostnames = ["xxxxxxx.example.com"]

Used GitLab Runner version

We're using GitLab Runner 13.10.0 (issue also happened with GitLab Runner 13.9.0).

Possible fixes