Skip to content

Gitlab CI Runner ask for Username on cloning

Hi Guys,

I am just setting up Gitlab CI Runner.

I have Server A on which runs Gitlab ( with GitLab Community Edition 8.5.1 8b7080d ), and now I am setting up runners on Server B.

Both server runs Ubuntu Server, both 14.04.

I've done the following steps:

  • I installed Gitlab CI Runners on Server B according to the doc with the official repository using apt-get install.

  • Register runner on Server B to Gitlab on Server A.

  • Switch to user gitlab-runner on Server B.

  • Generate SSH key, and add id_rsa.pub key to the deploy keys of the target repo in Gitlab on Server A.

  • Try to clone the repo on Server B manually under user gitlab-runner. Success.

  • Rerun the build in Gitlab.

But I got the following error:

gitlab-ci-multi-runner 1.0.4 (014aa8c)
Using Shell executor...
Running on cairo...
Cloning repository...
Cloning into '/data/gitlab-runner/builds/d69b4969/0/myproject/maleskine'...
fatal: could not read Username for 'https://git.mydomain.com': No such device or address

ERROR: Build failed with: exit status 1

And I tried with manually running the following from the console:

git clone http://git.mydomain.com/myuser/maleskine.git
Cloning into 'maleskine'...
Username for 'https://git.mydomain.com': myuser
Password for 'https://myuser@git.jianshu.io':
warning: You appear to have cloned an empty repository.
Checking connectivity... done.

It seems that it couldn't be done because it's a private repository.

Just for reference, the following is /etc/gitlab-runner/config.toml:

concurrent = 1

[[runners]]
  name = "cairo"
  url = "https://git.mydomain.com/ci"
  token = "mytoken"
  tls-ca-file = ""
  executor = "shell"
  buildes_dir = "/data/gitlab-runner/builds/"
  [runners.ssh]
  [runners.docker]
    image = ""
    privileged = false
  [runners.parallels]
    base_name = ""
  [runners.virtualbox]
    base_name = ""

Just don't know why it can not clone. Is there a way to tell it to clone via the git protocol?

Best Regards. Larry