Runner with docker painc "invalid memory address or nil pointer dereference" with passed docker socket from host

Using debian 11 as host (A VM instance)

Using docker run gitlab and gitlab-runner

74ccf5b3b54a   gitlab/gitlab-runner:latest   "/usr/bin/dumb-init …"   3 hours ago   Up 10 minutes                                                                        gitlab-runner
d33fd113ff0c   gitlab/gitlab-ee:latest       "/assets/wrapper"        4 hours ago   Up 3 hours (healthy)   80/tcp, 0.0.0.0:22->22/tcp, 0.0.0.0:8110->8110/tcp, 443/tcp   gitlab

And pass the host docker socket into docker with --volume /var/run/docker.sock:/var/run/docker.sock for runner.

And also apt install docker.io in the container for docker-client tools

Using hello world pipeline

build-job:
  stage: build
  script:
    - echo "Hello, $GITLAB_USER_LOGIN!"

test-job1:
  stage: test
  script:
    - echo "This job tests something"

test-job2:
  stage: test
  script:
    - echo "This job tests something, but takes more time than test-job1."
    - echo "After the echo commands complete, it runs the sleep command for 20 seconds"
    - echo "which simulates a test that runs 20 seconds longer than test-job1"
    - sleep 20

deploy-prod:
  stage: deploy
  script:
    - echo "This job deploys something from the $CI_COMMIT_BRANCH branch."

And docker logs gitlab-runner as fellow ( I try a lot times)

Checking for jobs... received                       job=5 repo_url=http://10.10.30.201:8110/gitlab-instance-36d0b459/Monitoring.git runner=qeDEybaU
WARNING: Job failed (system failure): panic: runtime error: invalid memory address or nil pointer dereference
  duration_s=0.00025079 job=5 project=1 runner=qeDEybaU
WARNING: Failed to process runner                   builds=0 error=panic: runtime error: invalid memory address or nil pointer dereference executor=docker runner=qeDEybaU
Checking for jobs... received                       job=9 repo_url=http://10.10.30.201:8110/gitlab-instance-36d0b459/Monitoring.git runner=qeDEybaU
WARNING: Job failed (system failure): panic: runtime error: invalid memory address or nil pointer dereference
  duration_s=0.000230269 job=9 project=1 runner=qeDEybaU
WARNING: Failed to process runner                   builds=0 error=panic: runtime error: invalid memory address or nil pointer dereference executor=docker runner=qeDEybaU
Checking for jobs... received                       job=10 repo_url=http://10.10.30.201:8110/gitlab-instance-36d0b459/Monitoring.git runner=qeDEybaU
WARNING: Job failed (system failure): panic: runtime error: invalid memory address or nil pointer dereference
  duration_s=0.00014876 job=10 project=1 runner=qeDEybaU
WARNING: Failed to process runner                   builds=0 error=panic: runtime error: invalid memory address or nil pointer dereference executor=docker runner=qeDEybaU

Hi, which versions of GitLab, GitLab Runner and Docker are involved? Please share config.toml sections for runner too (remove sensitive details).

Maybe it is related to this issue Getting Nil Pointer Dereference error (#27975) · Issues · GitLab.org / gitlab-runner · GitLab

The environment already reset but:

Gitlab 15.0 docker run
–detach
–restart always
–name gitlab
–publish 22:22
–publish 8110:8110
–volume /opt/gitlab/config:/etc/gitlab
–volume /opt/gitlab/logs:/var/log/gitlab
–volume /opt/gitlab/data:/var/opt/gitlab
nexus.local/gitlab/gitlab-ee:latest

Gitlab-Runner

docker run --rm -it --volume /opt/gitlab-runner/config:/etc/gitlab-runner nexus.local/gitlab/gitlab-runner:latest register

docker run
–detach
–name gitlab-runner
–restart always
–volume /opt/gitlab-runner/config:/etc/gitlab-runner
–volume /var/run/docker.sock:/var/run/docker.sock
nexus.local/gitlab/gitlab-runner:latest

with image ID 80fc903c5ed9 so I think v15.

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "2ac20422ef9d"
  url = "http://10.10.30.201:8110/"
  token = "qeDEybaUtmDww8ZfNDVS"
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

Docker :

Client:
Version: 20.10.5+dfsg1
API version: 1.41
Go version: go1.15.15
Git commit: 55c4c88
Built: Sat Dec 4 10:53:03 2021
OS/Arch: linux/amd64
Context: default
Experimental: true

Server:
Engine:
Version: 20.10.5+dfsg1
API version: 1.41 (minimum version 1.12)
Go version: go1.15.15
Git commit: 363e9a8
Built: Sat Dec 4 10:53:03 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.13~ds1
GitCommit: 1.4.13~ds1-1~deb11u1
runc:
Version: 1.0.0~rc93+ds1
GitCommit: 1.0.0~rc93+ds1-5+b2
docker-init:
Version: 0.19.0
GitCommit:

Linux alpha.local 5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17) x86_64 GNU/Linux

PRETTY_NAME=“Debian GNU/Linux 11 (bullseye)”
NAME=“Debian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=debian
HOME_URL=“https://www.debian.org/
SUPPORT_URL=“Debian -- User Support
BUG_REPORT_URL=“https://bugs.debian.org/