GitLab-Runner "listen_address not defined" error
Asked Answered
B

4

43

I'm running a Laravel api on my server, and I wanted to use Gitlab-runner for CD. The first two runs were good, but then I started to see this problem listen_address not defined, session endpoints disabled builds=0

I'm running a linux server on a web shared hosting, so I can access a terminal and get some priviliges but I can't do some sudo stuff like installing a service. That's why I've been running gitlab-runner in user-mode

Error info

Configuration loaded                                builds=0
listen_address not defined, metrics & debug endpoints disabled  builds=0
[session_server].listen_address not defined, session endpoints disabled  builds=0

.gitlab-runner/config.toml

concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "CD API REST Sistema SIGO"
  url = "https://gitlab.com/"
  token = "blablabla"
  executor = "shell"
  listen_address="my.server.ip.address:8043"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
Bowleg answered 15/5, 2019 at 16:16 Comment(2)
I'm not exactly sure what happened, but reinstalling gitlab-runner (and registering once again) worked for me!Irreplaceable
I am getting the same error and reinstalling doesn't seem to solve it? :/Temuco
R
49

I have literally wasted 2 days on this subject. I have followed the below steps to get the runners configured and execute jobs successfully.

I am using Mac OS X 10.13 and Git Lab 12. However, people with other OS also can check this out.

I have stopped the runners and uninstalled them. Now deleted all references and files to gitlab runner, including the gitlab executable also. I got to know GitLab Runner executable paths from https://docs.gitlab.com/runner/configuration/advanced-configuration.html

I have installed them again using the gitlab official documentation.

Then the runners shows online in the gitlab portal. However, the jobs are not getting executed. It shows simply stuck. It tried to get information from logs using

gitlab-runner -debug run

Then I got to know that listen_address not defined. After a long try I got to know that simply enabling Run Untagged jobs did the trick. The jobs started and completed successfully. Still the I see the listen_address not defined from debug. So that misled me. Edit Runner from Gitlab server

Though it seems that last one task has solved my problem, but doing all the tasks in a batch did the trick.

Regality answered 25/7, 2019 at 15:30 Comment(4)
The setting to have a metrics listen_address belongs in the global section, with the concurrent and check_interval settings. [[session_server]] also has a listen_address setting for itselfSodium
Can you pls mark this as solution/answer :)Kitty
Thanks!!! the docs are so unclear!Lymphosarcoma
Thanks! Removing the container and recreating was sufficient to fix for me. No other changes.Fibroid
A
6

Conversely, an alternative to Avinash's solution is to include the tags you create when you register the runner in the gitlab-ci.yml file

    stages:
      - testing

    testing:
      stage: testing
      script:
        - echo 'Hello world'
    tags:
      - my-tags
Aquiver answered 9/1, 2020 at 19:0 Comment(1)
Except, the tags were declared, the gitlab-ci uses them, and at some point it just stops! I really don't want to have to register a new runner every few weeksDepict
S
2

This error can also appear if you don't register the runner using sudo (since then it is a user-mode runner, while some processes require a system-mode runner).

Spinule answered 3/7, 2023 at 12:7 Comment(0)
O
0

Fixed my issue by first unregistering my runner with:

gitlab-runner list

followed by

gitlab-runner verify --delete -t <TOKEN> -u <URL>

and then simply creating a new runner in gitlab and registering it with sudo fixed my issue completely.

Orangeade answered 23/4 at 22:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.