How to view self-hosted runner logs in macOS?

Describe your question in as much detail as possible:

We have a Mac Studio M1 running Gitlab Runner, with docker executor, as our group runner.

When we tried to run a sizable job running esbuild of 300 bundles, it always fails without any error message. The process exists when the script tries to archive the 300 endpoints, before uploading to AWS CloudFormation for deployment.

Other jobs runs fine, running the above deployment job with shell executor is also fine. It only fails in docker.

I tried increasing storage and memory allocated to the docker VM in mac, but the problem persists.

The shell from the VM from Docker for Mac shows no useful logs.

I would like to see if the logs generated from GitLab Runner, where can I find it?

What are you seeing, and how does that differ from what you expect to see?

I see no error messages, the process just exits with code 1 in the middle of building.

I expect the job runs fine.

Consider including screenshots, error messages, and/or other helpful visuals

This is a screenshot of the last few lines, they are normal logs from a normal deployment task running the Serverless Framework.
image

What version are you on? Are you using self-managed or GitLab.com?

  • GitLab (Hint: /help): gitlab.com
  • Runner (Hint: /admin/runners):
    Version: 15.6.1
    Git revision: 133d7e76
    Git branch: 15-6-stable
    GO version: go1.19.3
    Built: 2022-11-24T15:21:18+00:00
    OS/Arch: darwin/arm64

Add the CI configuration from .gitlab-ci.yml and other configuration if relevant (e.g. docker-compose.yml)

This is the section of the failing job in my gitlab-ci.yml:

deploy:review:
  allow_failure: true
  environment:
    name: review/$CI_COMMIT_REF_SLUG
    on_stop: unstage:review
  resource_group: review/$CI_COMMIT_REF_SLUG
  interruptible: true
  needs:
    - test
  rules:
    - if: $CI_MERGE_REQUEST_IID && $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME != "dev"
      when: manual
  script:
    - apt-get -yqq update && apt-get -yqq install chromium
    - yarn --immutable
    - yarn deploy --verbose
  stage: deploy
  tags:
    - build
    - osx
    - docker
  variables:
    NODE_OPTIONS: --max-old-space-size=24576

What troubleshooting steps have you already taken? Can you link to any docs or other resources so we know where you have been?

The steps I took are mentioned in the description above.

Your self-hosted runner logs are stored in the file system of your Mac. To view these logs, you need to open the folder where they are stored.

To do this, follow these steps:

  1. Open Finder, type ~/Library/Logs and press Return. This will open up the Library folder on your Mac.

  2. Find Runner and click on it so that it is highlighted in the list of folders.

  3. Select the File Viewer tab in the sidebar on the left side of your screen, then select Show Package Contents from the drop-down menu in the upper right corner of your screen, as shown below:

Hi @Rohit, thanks for the reply.

In my ~/Library/Logs I see no Runner directory.

I installed with homebrew and my directory at ~/Library/Logs/homebrew/gitlab-runner is empty.

Where should I try next?

Hi,

on my macOS its /usr/local/var/log/gitlab-runner.err.log

best,

Bodo

Unfortunately my /usr/local only contains the following directories, var/ is nowhere to be seen.

  1. bin/
  2. include/
  3. lib/
  4. share/

Whats happening when you try:

brew services restart gitlab-runner

Edit: Also try

lsof|grep -i gitlab

to see which process has gitlab files open

I installed my runner via homebrew.

The configuration can be located via the command brew services, here is an example of the output:

~ brew services                   
Name          Status  User   File
gitlab-runner started vicary ~/Library/LaunchAgents/homebrew.mxcl.gitlab-runner.plist

Inside the plist file, there is a specific setting that uses the --syslog option:

	<array>
		<string>/opt/homebrew/opt/gitlab-runner/bin/gitlab-runner</string>
		<string>run</string>
		<string>--syslog</string>
	</array>

But tailing /var/log/system.log gives me nothing, is it possible that syslog in macOS sends to some other locations?