Ralph KEMPS
Ralph KEMPS

Reputation: 173

Can’t clone repo from GitLab CI in Docker

I'm have some trouble with GitLab CI. For the context, it is my first CI that I'm trying to configure. GitLab is installed via an Omnibus package and is in 9.0.6CE version on a CentOS 6 64bits. GitLab runners are installed on 2 systems: an Ubuntu 16.04 64bits and CentOS 6 64bits. The second runner is on the same server as GitLab. The runners are in version 9.1.1. There are installed through repositories. I have tried with a runner in a Docker service but it doesn't change the result. The servers are behind a proxy with authentication that limits their access to Internet. I have configured the server to manage the proxy (environment variables and so on) and Docker can retrieve images from Internet.

I have PHP project where I would like to do some PHPUnit test at each push. When I run the runner locally, everything goes fine. But when the runner is activated by GitLab CI then, the git repository can't be cloned. Do you have any solution or even suggestion to resolve the problem?

.gitlab-ci.yml:

image: php:7.1.0

before_script:
  - bash ci/docker_install.sh > /dev/null

test:php7.1:
  script:
    - phpunit --coverage-text -c app/
  tags:
    - docker

Job result:

Running with gitlab-ci-multi-runner 9.1.1 (6104325)
on arthur-docker (7b16a671)
Using Docker executor with image php:7.1.0 ...
Using docker image sha256:bca6e849844c9924fda99a3d8e271d37d9ed4fb5bc5727c3fe6c3ba171a4fdae for predefined container...
Pulling docker image php:7.1.0 ...
Using docker image php:7.1.0 ID=sha256:97c69bd40b40e1a1338409408ceb61b779097cc857037305450ad9a1ea249695 for build container...
Running on runner-7b16a671-project-138-concurrent-0 via f24c7be7d1da...
Cloning repository...
Cloning into '/builds/ems/gest_dev'...
fatal: repository 'http://gitlab-ci-token:[email protected]:82/ems/gest_dev.git/' not found
ERROR: Job failed: exit code 1

Upvotes: 3

Views: 2152

Answers (2)

elingerojo
elingerojo

Reputation: 374

First diagnostic step

Does your .gitlab-ci.yml look like this EXACTLY?

image: php:7.1.0

before_script:
  - bash ci/docker_install.sh > /dev/null

test:php7.1:
  script:
    - phpunit --coverage-text -c app/
  tags:
  - docker

Please note the indentation particularly about tags: because your POST shows it YAML correct but Gitlab incorrect. The docs say that it needs to be inside a job like your test:php7.1: job.

Upvotes: 0

LuFFy
LuFFy

Reputation: 9297

Go through the issues here :

  1. https://gitlab.com/gitlab-org/gitlab-ci-multi-runner/issues/1721
  2. https://gitlab.com/gitlab-org/gitlab-ce/issues/22501

Short Answer :

remote: Git access over HTTP is not allowed

Upvotes: 1

Related Questions