Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Auto-cloning a Gitlab repo fails with "unable to update url base from redirection"

Open
#144 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
git, typescript

Research direction

Start with the Backstage plugin and the git_clone module referenced in the template; review issue #117 and PR 210 first. Reproduce with the GitLab URL ending in /-/blob/main/?ref_type=heads and compare it with the working repository-root URL. Done means auto-cloning succeeds under GitLab SAML SSO while the workspace still matches the Backstage entity.

Written by the indexing model from the issue text.

Description

bug help wanted
Background

My organisation is exploring Coder with the Backstage plugin and Gitlab.com (Gitlab SaaS, i.e. not self-hosted).

In Backstage, before creating anything, the plugin shows:

No workspaces found for repo
https://gitlab.com/myorg/myrepo/-/blob/main/?ref_type=heads

We see #117 and the fact a change was made, and also that a merge was made to the git clone module in PR 210, but we are yet to be able to make it work.

Challenge

With a template that auto-clones, for example using the git_clone module:

data "coder_parameter" "repo_url" {
    name                = "repo_url"
    display_name  = "Git repository"
}

module "git_clone" {
  source     = "registry.coder.com/modules/git-clone/coder"
  version   = "1.0.18"
  agent_id = coder_agent.main.id
  url     = data.coder_parameter.repo_url.value
}

We see the clone fail after redirection:

Cloning https://gitlab.com/myorg/myrepo/-/blob/main/ to /home/coder/main...
Cloning into '/home/coder/main'...

fatal: unable to update url base from redirection:
  asked for: https://gitlab.com/myorg/myrepo/-/blob/main/info/refs?service=git-upload-pack
   redirect: https://gitlab.com/groups/myorg/-/saml/sso?redirect=%2Fmyorg%2Fmyrepo%2F-%2Fblob%2Fmain%2Finfo%2Frefs%3Fservice%3Dgit-upload-pack&token=<token>

We enforce single sign-on, which may explain the saml/sso redirection.

Alternatives

If we do not "auto-clone", and instead try and clone from the Workspace template directly (providing "Git repository" in the GUI), providing "https://gitlab.com/myorg/myrepo", then it works.

The downside is that the Backstage plugin won't "match" the Workspace as being related to the Backstage entity (presumably because we omitted the -/blob/main/?ref_type=heads suffix).

Has anyone been able to make this work with Gitlab yet please?

Dominant language
TypeScript
Stars
67
Forks
9
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from coder/backstage-plugins

All issues in coder/backstage-plugins

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.