Trying to access a GitLab Workspace leads to a infinite redirection loop
Summary
After creating a workspace, trying to access the workspace URL leads to an endless redirection loop, with new tokens (`code=<token>`) generated on the URL for each redirection attempt.
The only deviation in the configs is that the wildcard domain is one level higher than recommended
GITLAB_WORKSPACES_WILDCARD_DOMAIN = *.<hostname>
GITLAB_WORKSPACES_PROXY_DOMAIN = workspace.<hostname>
So *.<hostname>
instead of *.workspace.<hostname>
.
Relevant logs and/or screenshots
Redirecting
2024/04/29 08:17:16 getHostnameFromState u.Hostname()=60001-workspace-2-2-s9yf2z.<hostname>{"level":"info","ts":1714378636.7510352,"caller":"logging/middleware.go:15","msg":"HTTP request processed","path":"/auth/callback","ip":"<IP>:29084","status":307,"host":"workspaces.<hostname>","method":"GET"}
2024/04/29 08:17:16 getHostnameFromState state=https://60001-workspace-2-2-s9yf2z.<hostname>/folder=/projects/pipeline-test
2024/04/29 08:17:16 getHostnameFromState u.Hostname()=60001-workspace-2-2-s9yf2z.<hostname>{"level":"info","ts":1714378636.8155632,"caller":"logging/middleware.go:15","msg":"HTTP request processed","path":"/","ip":"<IP>:29084","status":307,"host":"60001-workspace-2-2-s9yf2z.<hostname>","method":"GET"}
2024/04/29 08:17:17 getHostnameFromState state=https://60001-workspace-2-2-s9yf2z.<hostname>/?folder=/projects/pipeline-test
2024/04/29 08:17:17 getHostnameFromState u.Hostname()=60001-workspace-2-2-s9yf2z.<hostname>{"level":"info","ts":1714378637.6546965,"caller":"logging/middleware.go:15","msg":"HTTP request processed","path":"/auth/callback","ip":"<IP>:29084","status":307,"host":"workspaces.<hostname>t","method":"GET"}
Possible fixes
Edited by Daniel Diniz