38

After installing and registering gitlab-runner, when I'm running gitlab-runner start I get this error message. What will be the reason for this ?

Runtime platform                                    arch=amd64 os=darwin pid=65915 revision=c1edb478 version=14.0.1
FATAL: Failed to start gitlab-runner: "launchctl" failed with stderr: Load failed: 5: Input/output error
Bawantha
  • 3,644
  • 4
  • 24
  • 36

9 Answers9

43

I edited the /Users/$USER/Library/LaunchAgents/gitlab-runner.plist file and changed the location of the log files to a location writeable by my user:

<key>StandardOutPath</key>
    <string>/Users/USERNAME/.gitlab-runner/gitlab-runner.out.log</string>
<key>StandardErrorPath</key>
    <string>/Users/USERNAME/.gitlab-runner/gitlab-runner.err.log</string>

Then issued a

launchctl unload /Users/$USER/Library/LaunchAgents/gitlab-runner.plist
launchctl load -w /Users/$USER/Library/LaunchAgents/gitlab-runner.plist
gitlab-runner stop
gitlab-runner start
gitlab-runner status

And the service is up and running

For more info: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/28136

QuesterDesura
  • 385
  • 2
  • 18
Khamidjon Khamidov
  • 6,783
  • 6
  • 31
  • 62
14
gitlab-runner uninstall
gitlab-runner install
gitlab-runner start

fixed it for me, as stated here: https://docs.gitlab.com/runner/install/osx.html#upgrade-the-service-file

Kelteseth
  • 150
  • 1
  • 11
14

I installed with brew and getting same error when I tried

gitlab-runner start

I have to start the runner service with brew and it worked

brew services restart gitlab-runner

enter image description here

Adiii
  • 54,482
  • 7
  • 145
  • 148
5

Seeming your runner running in a non-sudo, bring the gitlab-runner daemon can't write log to the path that requires sudo permission. For example, the path in my Mac OS "/usr/local/var/log/gitlab-runner.out.log".

Steps to redirect log output:

  1. gitlab-runner uninstall followed by gitlab-runner install to get a clean "plist" as a basis.
  2. Edit /Users/<username>/Library/LaunchAgents/gitlab-runner.plist, and find the two XML-keys containing output paths for log files. A good path is /Users/<username>/.gitlab-runner/<log-file-name>
  3. gitlab-runner start
Pianosaurus
  • 5,538
  • 2
  • 20
  • 15
Lee Kaiming
  • 51
  • 1
  • 1
  • 4
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Nov 05 '21 at 09:03
1

I got the same issue while trying to set up gitlab-runner on an AWS macOS EC2 instance.

I was connecting `using SSH. I tried both Manual and Homebrew installations without success.

As per Homebrew comment:

Yes, as mentioned you need a gui login to use brew services

So, after many failed attempts. I connected to the instance using the GUI and followed Homebrew installation. It worked flawlessly on the first try.

raedshari
  • 403
  • 5
  • 16
0

I had this on an M1 Mac. I had to install the M1 specific version of the GitLab Runner: https://gitlab.com/gitlab-org/gitlab-runner/-/issues/26561

Mathias Lykkegaard Lorenzen
  • 15,031
  • 23
  • 100
  • 187
0

Check that exist directory /usr/local/var If not, create it

poGUIst
  • 299
  • 4
  • 10
-1

cd ~

sudo chmod +x /usr/local/bin/gitlab-runner

gitlub-runner start

worked for me

Bawantha
  • 3,644
  • 4
  • 24
  • 36
  • @VictoriaAgafonova install brew installation of runner ,or make sure you have runner configure under group some time project runners won't work – Bawantha Aug 27 '21 at 20:00
  • 1
    thanks. But how to find out which settings does brew installation of gitlab-runner use? I've installed one with brew, it starts fine, but in my project's runners page i can see the note, that my registered runner was never used.. I assume, this installed runner doesnt use my -/.gitlab-runner/config.toml ... – Victoria Agafonova Aug 30 '21 at 11:05
-1

I got same problems. Very green in DevOps. Tried hard for make pipeline for my first pet)

docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register

Use this, it's command for register gitlab-runner in Docker.