简体   繁体   中英

ERROR: Registering runner with gitlab-runner

I read other posts and solutions described but they didnt work for me.

I have my own gitlab server running at AWS with its url mygitlab.com. The gitlab server works fine with a lot of projects.

I have another server S1 in the same AWS network than my gitlab server. Servers see each other, telnet works fine on 80 (http) or 443 (https) ports from my server S1 to the gitlab server.

For my project named "test" on my gitlab server I go to the webpage of this project then to the menu "settings -> CI/CD" then I "expand" the "Runners" section then I go in the section "Specific runners" saying: "These runners are specific to this project." I copy the given url (mygitlab.com) and the specific token.

On my server S1 I installed gitlab-runner then I launch:

sudo gitlab-runner register --url https://mygitlab.com --registration-token mytoken

I have this error:

ERROR: Registering runner... forbidden (check registration token)  runner=mytoken
PANIC: Failed to register the runner. You may be having network problems. 

I tried http instead of https, I got the same error

I tried and checked solutions I read here and on other forums:

  • be sure the token is specific to the project: done !
  • try to "Reset registration token": done !
  • is there 127.0.0.0 localhost in /etc/hosts: done !
  • checking network between servers: done !

Thanks for tips and any idea to test !

You have to mention https://... in the url eg https://gitlab.com

  1. Enter the GitLab instance URL eg https://gitlab.com

  2. Enter the registration token eg GR1348941iADNi

  3. Enter a description for the runner eg linux

  4. Enter tags for the runner (comma-separated) eg linuxos, local-runnner, local-shell

  5. Enter optional maintenance note for the runner eg git-cicd

  6. Enter an executor eg virtualbox, docker+machine, docker-ssh, ssh, parallels, shell, docker-ssh+machine, kubernetes, custom, docker

It may be you run your GitLab instance behind a reverse proxy such as Nginx. and you or your friends set allow from IP and block other source traffic.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM