Testing gitlab-runner locally repository not found

Hello,

I’m running gitlab-runner locally to test my .gitlab-ci.yaml file but it cannot find the repository. It tries to clone it from a local path that doesn’t exist:

gitlab-runner exec docker --docker-privileged --docker-cache-dir /tmp/gitlabrunner --docker-volumes /tmp/gitlabrunner:/tmp/gitlabrunner --docker-volumes /var/run/docker.sock:/var/run/docker.sock test-buildRuntime platform                                    arch=amd64 os=linux pid=9421 revision=d9b83537 version=11.10.0~beta.1315.gd9b83537
WARNING: You most probably have uncommitted changes. 
WARNING: These changes will not be tested.         
Running with gitlab-runner 11.10.0~beta.1315.gd9b83537 (d9b83537)
Using Docker executor with image xxxx ...
Starting service docker:dind ...
Pulling docker image docker:dind ...
Using docker image sha256:b90ec7b4590e2638ed18d0afff2467a5eea36947c69439a188ed67c3d47e2ef2 for docker:dind ...
Waiting for services to be up and running...
Pulling docker image xxx ...
Using docker image sha256:2ed027798240412e0d5251379ab0ad8c1db8e01764f79d9d3bd5d38f3dd44986 for xxx...
Running on runner--project-0-concurrent-0 via company...
DEPRECATION: this GitLab server doesn't support refspecs, gitlab-runner 12.0 will no longer work with this version of GitLab
Cloning repository...
fatal: repository '/root/git/api' does not exist
ERROR: Job failed: exit code 1
FATAL: exit code 1  

Could you help me on this please? I don’t understand…

Thank you

1 Like

It looks like your GitLab version is not supported.

DEPRECATION: this GitLab server doesn’t support refspecs, gitlab-runner 12.0 will no longer work with this version of GitLab

You should try updating it.

Hello,

I should upgrade gitlab-ci?

the deprecation warning shouldn’t be the cause of your problem. You’re running v.11.10 and that should be compatible with your version of gitlab. Gitlab-runner have an option to turn on more logging, that should reveal the repo url you’re trying to clone.

I had the same problem and it was related to fetching submodules. Never got a good workaround, stuck to running CI only in the runners (having to push), never directly on my working copy.

It’s not just submodules anymore - the latest version 11.11.0 is now refusing to clone the repository that it’s being run in despite the reported path being correct.

dan@holly:[local]:~/cog$ gitlab-runner exec docker package-dev --docker-volumes "/home/dan/.emergent/packages/:/packages:rw" --docker-pull-policy "if-not-present"  
Runtime platform                                    arch=amd64 os=linux pid=4925 revision=6c154264 version=11.11.0
Running with gitlab-runner 11.11.0 (6c154264)
Using Docker executor with image emergent:bionic ...
Using locally found image version due to if-not-present pull policy
Using docker image sha256:a5e9bc76992cfc39c096236ab44536f1b2c115b95f33962231510b1d5fa03a1d for emergent:bionic ...
Running on runner--project-0-concurrent-0 via holly...
DEPRECATION: this GitLab server doesn't support refspecs, gitlab-runner 12.0 will no longer work with this version of GitLab
Cloning repository...
fatal: repository '/home/dan/cog' does not exist
ERROR: Job failed: exit code 1
FATAL: exit code 1

I am having the same problem. No submodules, so that is not the issue.

I am also running the runner locally with docker installed:
gitlab-runner exec docker instrumentation-debug

2 Likes

Had the same issue with GitLab Runner 11.11.0 while it does not happen with Runner 11.10.0:

  • on macOS 10.14
  • installed with Homebrew

To workaround, use the following command to install GitLab Runner 11.10:

brew uninstall gitlab-runner
brew install https://github.com/Homebrew/homebrew-core/raw/abac7f40640176a170117fc16f8b451f739da404/Formula/gitlab-runner.rb
2 Likes

Yep, I worked around the issue by downgrading to 11.9. Nice to hear that 11.10 also works.

1 Like

Can confirm that downgrading to 11.10.0. worked!

1 Like

I had the same problem as @teadriven, and downgrading to gitlab-runner 11.10.0 on Debian fixed it: (apt-get install gitlab-runner=11.10.0).

1 Like

Doesn’t fix it for me :frowning:

Version 11.11.1 appears to have resolved the issue.

2 Likes

With Homebrew, 11.11.1 has not been available so far. Just created a PR for it: https://github.com/Homebrew/homebrew-core/pull/40476

Hello. I had to sign-up to say this.

Version 11.11.1 is broken.

I ran

brew install gitlab-runner

Then I configured the runner.
Then I ran

git add --all . && \
git commit -m “testing gitlab ci” &&
gitlab-runner exec docker test`

And the output I received was

─Hugbot@Hugbots-MacBook-Pro ~/Repositories/[REDACTED] ‹feature/ci_and_cd_pipeline›
╰─$ git add --all . && git commit -m “testing gitlab ci” && gitlab-runner exec docker test 1 ↵
[feature/ci_and_cd_pipeline 779b0f7] testing gitlab ci
1 file changed, 1 deletion(-)
Runtime platform arch=amd64 os=darwin pid=74579 revision=5a147c92 version=11.11.1
Running with gitlab-runner 11.11.1 (5a147c92)
Using Docker executor with image python …
Pulling docker image python …
Using docker image sha256:a4cc999cf2aaafbe0b934b74be5a55cb3b8bd9349856131bea3579428b4155bf for python …
Running on runner–project-0-concurrent-0 via Hugbots-MacBook-Pro.local…
DEPRECATION: this GitLab server doesn’t support refspecs, gitlab-runner 12.0 will no longer work with this version of GitLab
Cloning repository…
fatal: repository ‘/Users/Hugbot/Repositories/[REDACTED]’ does not exist
ERROR: Job failed: exit code 1
FATAL: exit code 1

But then I did as suggested above and downgraded to version 11.10.0

brew uninstall gitlab-runner
brew install https://github.com/Homebrew/homebrew-core/raw/abac7f40640176a170117fc16f8b451f739da404/Formula/gitlab-runner.rb

And it worked.

Can someone please address this issue as it had taken about 2 days of productivity out of me by the time I landed on this thread.

1 Like

I’m happy to say that on Debian, gitlab-runner version 11.10.1 is working.

Thanks for reporting. Can you escalate this on https://gitlab.com/gitlab-org/gitlab-runner/issues or https://gitlab.com/gitlab-org/gitlab-runner/issues/4251 ?

I’m sorry @tnir, I don’t have the bandwidth to do that right now. Would you mind doing that instead?

1 Like

@tnir

I have posted in the thread you specified:

I have create a new issue here:

1 Like

Thanks for your response.

As described on gitlab-runner’s issue, just created https://github.com/Homebrew/homebrew-core/pull/40807 for upgrading Runner to the latest.