`glab cluster agent` errors out when executing against a self-managed environment

Summary

glab 1.50.0 is throwing errors when configured against a self-hosted instance (17.6)

Steps to reproduce

  • install glab with brew on Mac OS 15.1
  • authenticate with a token against a self-managed instance

Example Project

This is happening against a self-managed environment

What is the current bug behavior?

  • glab auth, config and version both throw the following warning/error about API 401 not authorized - tho it seems the commands themselves may be successful?

  • Attempting to use the instructions on glab cluster bootstrap, I get a panic error (The flux step was successful)

What is the expected correct behavior?

No errors.

Relevant logs and/or screenshots

glab version
Current glab version: 1.50.0 (2024-11-28)
failed checking for glab updates: GET https://gitlab.com/api/v4/projects/gitlab-org/cli/releases: 401 {message: 401 Unauthorized}
glab auth login
.....
✓ Configured API protocol.
✓ Logged in as kthrace
✓ Configuration saved to /Users/kkwentus/.config/glab-cli//Users/kkwentus/.config/glab-cli/config.yml
failed checking for glab updates: GET https://gitlab.com/api/v4/projects/gitlab-org/cli/releases: 401 {message: 401 Unauthorized}
$ glab cluster agent bootstrap glab-agent --manifest-path manifests/
Registering Agent ... [OK]
Configuring Agent ... panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x2 addr=0x8 pc=0x10317d648]

goroutine 1 [running]:
gitlab.com/gitlab-org/cli/commands/cluster/agent/bootstrap.(*apiWrapper).ConfigureAgent(0x140001f0888, 0x140001d63f0, {0x140002cb24a, 0x6})
        gitlab.com/gitlab-org/cli/commands/cluster/agent/bootstrap/api_wrapper.go:93 +0x288
gitlab.com/gitlab-org/cli/commands/cluster/agent/bootstrap.(*bootstrapCmd).configureAgent(...)
        gitlab.com/gitlab-org/cli/commands/cluster/agent/bootstrap/agent_bootstrap.go:428
gitlab.com/gitlab-org/cli/commands/cluster/agent/bootstrap.(*bootstrapCmd).run(0x1400071ba68)
        gitlab.com/gitlab-org/cli/commands/cluster/agent/bootstrap/agent_bootstrap.go:338 +0xcc
gitlab.com/gitlab-org/cli/commands/cluster/agent/bootstrap.NewCmdAgentBootstrap.func2(0x14000168c08, {0x140004c8930, 0x1, 0x10343406b?})
        gitlab.com/gitlab-org/cli/commands/cluster/agent/bootstrap/agent_bootstrap.go:270 +0x83c
github.com/spf13/cobra.(*Command).execute(0x14000168c08, {0x140004c8900, 0x3, 0x3})
        github.com/spf13/cobra@v1.8.1/command.go:985 +0x834
github.com/spf13/cobra.(*Command).ExecuteC(0x1400059e308)
        github.com/spf13/cobra@v1.8.1/command.go:1117 +0x344
main.main()
        gitlab.com/gitlab-org/cli/cmd/glab/main.go:155 +0x924

Output of checks

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

```
sudo gitlab-rake gitlab:env:info

System information
System:		Ubuntu 24.04
Proxy:		no
Current User:	git
Using RVM:	no
Ruby Version:	3.2.5
Gem Version:	3.5.23
Bundler Version:2.5.11
Rake Version:	13.0.6
Redis Version:	7.0.15
Sidekiq Version:7.2.4
Go Version:	unknown

GitLab information
Version:	17.6.1-ee
Revision:	5f698b15f67
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	14.11
URL:		https://gitlab.gnomemain.com
HTTP Clone URL:	https://gitlab.gnomemain.com/some-group/some-project.git
SSH Clone URL:	git@gitlab.gnomemain.com:some-group/some-project.git
Elasticsearch:	no
Geo:		no
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers:

GitLab Shell
Version:	14.39.0
Repository storages:
- default: 	unix:/var/opt/gitlab/gitaly/gitaly.socket
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell

Gitaly
- default Address: 	unix:/var/opt/gitlab/gitaly/gitaly.socket
- default Version: 	17.6.1
- default Git Version: 	2.47.0
```

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

sudo gitlab-rake gitlab:check SANITIZE=true

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 14.39.0 ? ... OK (14.39.0)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell-check
Internal API available: OK
Redis available via internal API: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... yes
Number of Sidekiq processes (cluster/worker) ... 1/1

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab App ...

Database config exists? ... yes
Tables are truncated? ... skipped
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Cable config exists? ... yes
Resque config exists? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... yes
Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units)
Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units)
Projects have namespace: ...
5/1 ... yes
3/2 ... yes
Redis version >= 6.2.14? ... yes
Ruby version >= 3.0.6 ? ... yes (3.2.5)
Git user has default SSH configuration? ... yes
Active users: ... 2
Is authorized keys file accessible? ... yes
GitLab configured to store new projects in hashed storage? ... yes
All projects are in hashed storage? ... yes
Elasticsearch version 7.x-8.x or OpenSearch version 1.x ... skipped (Advanced Search is disabled)
All migrations must be finished before doing a major upgrade ... skipped (Advanced Search is disabled)

Checking GitLab App ... Finished


Checking GitLab subtasks ... Finished

Possible fixes

Assignee Loading
Time tracking Loading