Jobs stuck on Skipping Git submodules setup

Summary

Whenever i try to run a Job using Shared Runners or my own personal Runners, my [job] gets stuck at Skipping Git submodules setup. This occurs random but periodically.

Steps to reproduce

Use this .gitlab-ci.yml file and check your jobs:

stages:
  - build
  - deploy

build_stable:
  stage: build
  before_script:
    - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - docker pull gitlab.xxx.com:2053/exc/deploy/docker-php7-builder:stable
    - docker tag gitlab.xxx.com:2053/exc/deploy/docker-php7-builder:stable docker-php-builder
  only:
    - master
  script: |
    docker build -t $CI_REGISTRY_IMAGE:stable -f Dockerfile .
    docker push $CI_REGISTRY_IMAGE:stable

deploy_xxx_dev:
  stage: deploy
  tags:
    - xxx_dev
  only:
    - dev
  script:
    - /usr/bin/docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
    - cd /opt/install-script
    - export PROJECT=xxx
    - export EXCHANGE_ENV=stage
    - ./exchange.sh update-service php-frontend        

What is the current bug behavior?

Job gets stuck on Skipping git submodules setup. And this is not a network problem. Selection_203

What is the expected correct behavior?

To move on...

Similar issue:

https://gitlab.com/gitlab-org/gitlab-ce/issues/46901

Edited by Karolis Sprindzius