GitLab Runner cannot see the updated file

Hello,
I updated the .gitlab-ci.yml file, but GitLab Runner still see the old file. I also used the clear runner caches button, but problem exist. I also started and stopped the runner.

Cheers.

Hi,
I also updated the GitLab Runner:

# gitlab-runner --version
Version:      16.11.0
Git revision: 91a27b2a
Git branch:   16-11-stable
GO version:   go1.21.9
Built:        2024-04-18T19:21:08+0000
OS/Arch:      linux/amd64

Problem exist!

Can you please provide more details about your configuration? Please post your config.toml (with removed tokens), as well as your full .gitlab-ci.yml configuration with description on what are you trying to achieve. Otherwise community cannot help you further.

1 Like

Hi,
Sure. The contents of the config.toml file is:

concurrent = 1
check_interval = 0
connection_max_age = "15m0s"
shutdown_timeout = 0

[session_server]
  session_timeout = 1800

[[runners]]
  name = "project"
  url = "http://IP"
  id = 6
  token = "[REDACTED]"
  token_obtained_at = 2024-04-23T07:37:37Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  [runners.cache]
    MaxUploadedArchiveSize = 0

And the contents of the .gitlab-ci.yml file is:

stages:
  - build
  - deploy
build:
  stage: build
  script:
    - rm -rf /data/project
    - cd /data/
    - git clone http://IP/project/project.git
deploy:
  stage: deploy
  script:
    - cd /data/docker
    - docker compose up -d

I modified the .gitlab-ci.yml file as follows:

stages:
  - build
  - deploy
build:
  stage: build
   script:
    - rm -rf /data/project
    - cd /data/
deploy:
  stage: deploy
  script:
    - cd /data/docker
    - docker compose up -d

I started and stopped the runner and I also used the clear runner caches button, but Runner still sees the old .gitlab-ci.yml file:

Fetching changes with git depth set to 20...
Reinitialized existing Git repository in /home/gitlab-runner/builds/58HB9Us2w/0/project/project/.git/
remote: You are not allowed to download code from this project.
fatal: unable to access 'http://IP/project/project.git/': The requested URL returned error: 403
ERROR: Job failed: exit status 1

As you can see, it still looks for the git line.

By “modified” you mean: you changed, commited and pushed the file to a branch on GitLab?

1 Like

Yes and I can see the updated version of the file. This is very odd.

Hi again,
I unregistered the token and then created a new Runner and registered it:

# gitlab-runner list
Runtime platform                                    arch=amd64 os=linux pid=274827 revision=91a27b2a version=16.11.0
There might be a problem with your config based on jsonschema annotations in common/config.go (experimental feature):
jsonschema: '/runners/0/Monitoring' does not validate with https://gitlab.com/gitlab-org/gitlab-runner/common/config#/$ref/properties/runners/items/$ref/properties/Monitoring/$ref/type: expected object, but got null
 
Listing configured runners                          ConfigFile=/etc/gitlab-runner/config.toml
project                                              Executor=shell Token=[REDACTED] URL=http://IP

But the result is the same as before:

# gitlab-runner run
Runtime platform                                    arch=amd64 os=linux pid=274765 revision=91a27b2a version=16.11.0
Starting multi-runner from /etc/gitlab-runner/config.toml...  builds=0 max_builds=0
Running in system-mode.                            
                                                   
There might be a problem with your config based on jsonschema annotations in common/config.go (experimental feature):
jsonschema: '/runners/0/Monitoring' does not validate with https://gitlab.com/gitlab-org/gitlab-runner/common/config#/$ref/properties/runners/items/$ref/properties/Monitoring/$ref/type: expected object, but got null
 
Configuration loaded                                builds=0 max_builds=1
listen_address not defined, metrics & debug endpoints disabled  builds=0 max_builds=1
[session_server].listen_address not defined, session endpoints disabled  builds=0 max_builds=1
Initializing executor providers                     builds=0 max_builds=1
Checking for jobs... received                       job=963 repo_url=http://IP/project/project.git runner=ETyfPxwzq
Added job to processing list                        builds=1 job=963 max_builds=1 project=9 repo_url=http://IP/project/project.git time_in_queue_seconds=1
WARNING: Job failed: exit status 1
                 duration_s=0.369725037 job=963 project=9 runner=ETyfPxwzq
Appending trace to coordinator...ok                 code=202 job=963 job-log=0-1001 job-status=running runner=ETyfPxwzq sent-log=0-1000 status=202 Accepted update-interval=1m0s
Updating job...                                     bytesize=1001 checksum=crc32:5e4fbae7 job=963 runner=ETyfPxwzq
Submitting job to coordinator...ok                  bytesize=1001 checksum=crc32:5e4fbae7 code=200 job=963 job-status= runner=ETyfPxwzq update-interval=0s
Removed job from processing list                    builds=0 job=963 max_builds=1 project=9 repo_url=http://IP/project/project.git time_in_queue_seconds=1

How do I troubleshoot?

Hello,
I created a new project and used the same .gitlab-ci.yml file as before. This time Runner worked. Where is the problem from? Is there anything like a cache left somewhere?

Cheers.

Hello,
No idea?

Cheers.

Hello,
Problem solved. The reason was that my user account was not a member of that project.

Cheers.