After upgrading to 18.0, KAS won't start on Self-Managed

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Summary

I had set up a 17.x environment. After upgrading to 18.0, the kas service won't start at all. This means I can't set up more Kubernetes agent configurations. Also, because of error messages, I can't modify the Kubernetes agent configurations anymore.

Steps to reproduce

  1. Setup 17.11 and k8s environment. Configure Kubernates agent
  2. Upgrade the 17.11 to 18.0
  3. Try to reconfigure the agent. You got the below error.

image

Relevant logs and/or screenshots

This is the error message about the root cause.

root@ip-172-31-5-66:~# sudo gitlab-ctl tail gitlab-kas
==> /var/log/gitlab/gitlab-kas/state <==

==> /var/log/gitlab/gitlab-kas/current <==

2025-05-25_09:19:17.84812 {"time":"2025-05-25T09:19:17.848077337Z","level":"ERROR","msg":"Program aborted","error":"protojson.Unmarshal: proto: (line 1:50): unknown field \"gitops\""}
2025-05-25_09:19:18.86531 {"time":"2025-05-25T09:19:18.865258612Z","level":"ERROR","msg":"Program aborted","error":"protojson.Unmarshal: proto: (line 1:50): unknown field \"gitops\""}
2025-05-25_09:19:19.88219 {"time":"2025-05-25T09:19:19.882144015Z","level":"ERROR","msg":"Program aborted","error":"protojson.Unmarshal: proto: (line 1:50): unknown field \"gitops\""}
2025-05-25_09:19:20.89981 {"time":"2025-05-25T09:19:20.89976034Z","level":"ERROR","msg":"Program aborted","error":"protojson.Unmarshal: proto: (line 1:50): unknown field \"gitops\""}
2025-05-25_09:19:21.91724 {"time":"2025-05-25T09:19:21.917198253Z","level":"ERROR","msg":"Program aborted","error":"protojson.Unmarshal: proto: (line 1:50): unknown field \"gitops\""}

Possible fixes

The root cause is this.

File: /var/opt/gitlab/gitlab-kas/gitlab-kas-config.yml

agent:
  listen:
    address: localhost:8150
    network: tcp
    websocket: true
  configuration:
    poll_period: 300s
  gitops:
    poll_period: 300s
    project_info_cache_ttl: 300s
    project_info_cache_error_ttl: 60s
  kubernetes_api:
    listen:
      address: localhost:8154
    url_path_prefix: /
    websocket_token_secret_file: /var/opt/gitlab/gitlab-kas/websocket_token_secret_file
  info_cache_ttl: 300s
  info_cache_error_ttl: 60s
gitlab:

"gitops" won't be supported any more. So, we need to remove it.

As a test in my environment, after deleting like this and execute "sudo gitlab-ctl restart kas", this issue has gone.

But DO NOT Run "sudo gitlab-ctl reconfigure". This command overrides with the default yml file.

agent:
  listen:
    address: localhost:8150
    network: tcp
    websocket: true
  configuration:
    poll_period: 300s
      #  gitops:
      #    poll_period: 300s
      #    project_info_cache_ttl: 300s
      #    project_info_cache_error_ttl: 60s
  kubernetes_api:
    listen:
      address: localhost:8154
    url_path_prefix: /
    websocket_token_secret_file: /var/opt/gitlab/gitlab-kas/websocket_token_secret_file
  info_cache_ttl: 300s
  info_cache_error_ttl: 60s
gitlab:
Edited by 🤖 GitLab Bot 🤖