gitlab: invalid URL specified for personal access tokens

Labels: area/bridge/gitlab kind/bug lifecycle/pinned lifecycle/stale

Timeline

Shane Pearman (spearman) opened (edited)

I created a bridge to a gitlab repo and configured it.

However when I try to git bug bridge pull I got Error: missing identity token so I figured I did something wrong (what is an identity token? I provided an access token when I configured the bridge).

git bug bridge auth shows the bridge:

909c824 gitlab     token <redacted> base-url:https://gitlab.com/,login:project_61675907_bot_da4fbf9716170e7b652e0921346b75dd

Ok I don't know what 'login:project_61675907_bot_da4fbf9716170e7b652e0921346b75dd` is, but I'll try to remove the bridge:

$ git bug bridge rm 909c824
Error: invalid key prefix

Doesn't work, neither does:

$ git bug bridge rm gitlab
Error: invalid key prefix

Edit: I also don't know how to manually delete the bridge, I tried removing the .git/git-bug directory, but git bug bridge auth still shows the bridge.

Shane Pearman (spearman) commented (edited)

So I managed to reset the bridge configuration by removing the ~/.config/git-bug directory.

I also figured out that to remove the bridge, you need to use it's "name" (which was "default"), but this name isn't shown when you list the bridge with git bug bridge auth.

Also the original problem of getting 'Error: missing identity token' when trying to bridge pull seems to have been caused by using a project access token. Configuring the bridge using a personal access token allowed me to pull the issues. (Which by the way, the git bug dialog points to https://gitlab.com/-/profile/personal_access_tokens to create an access token, but this URL is no longer valid, it should be https://gitlab.com/-/user_settings/personal_access_tokens)

Shane Pearman (spearman) commented (edited)

Git bug bridge configure seems to have broken again, now when I try to provide an access token I get:

Error: Multiple matching identity found:
...

And lists two identities. I never explicitly created a second identity so I don't know how this happened. Also removing .git/git-bug and ~/.config/git-bug doesn't get rid of the identities.

Not sure if this is related but somewhere along the way of configuring a bridge and pulling, some empty commits were made that only show up when using git log --all:

commit 7187a6b40be4672833d17b4d4fad6ce8ae5e34dc
Author:  <>
Date:   Sat Sep 14 03:17:17 2024 +0200

commit d0830a8e626d126fa610e9abe72ee72241b66fba
Author:  <>
Date:   Sat Sep 14 03:17:17 2024 +0200

commit 31241717f5217a766779b3f6c357501d666ade09
Author:  <>
Date:   Sat Sep 14 02:49:54 2024 +0200

commit ff453eeb218beae6cc9ffc7d6ca792ba306a8d2c (HEAD -> master, origin/master)
Author: spearman <spearman@gitlab.com>
Date:   Sat Sep 14 02:42:17 2024 +0200

    initial commit 

github-actions (github-actions) commented

This bot triages issues in order to help the maintainers identify what needs attention, according to the following lifecycle rules:

  • After 90 days of inactivity, lifecycle/stale is applied
  • After 90 days of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied

This bot will not automatically close stale issues.

To remove the stale status, you can:

  • Remove the stale label from this issue
  • Comment on this issue
  • Close this issue
  • Offer to help out with triaging

To avoid automatic lifecycle management of this issue, add lifecycle/frozen.

github-actions (github-actions) added label lifecycle/stale

github-actions (github-actions) commented

Pinging maintainers. This issue has been inactive for 90 days.
Issues will not be automatically closed due to inactivity.


Learn more

This bot triages issues in order to help the maintainers identify what needs attention, according to the following lifecycle rules:

  • After 90 days of inactivity, lifecycle/idle is applied
  • After 180 days of inactivity, lifecycle/dormant is applied

The following actions remove the inactive status:

  • Removing the lifecycle/* label from this issue
  • Commenting on this issue
  • Adding a new assignee to this issue
  • Reopening this issue
  • Adding this issue to a milestone
  • Pinning this issue to the top of the issue board

To avoid automatic lifecycle management of this issue, maintainers can add the lifecycle/pinned label.

github-actions (github-actions) added label lifecycle/idle

sudoforge removed label lifecycle/idle-auto

sudoforge commented

I'll try to provide some clarity here:

  • Your initial issue seems to have been caused by an expectation that git bug bridge rm took the bridge ID instead of name, as you later discovered. I agree that this shines light on a poor UX, and that git-bug-bridge-rm should probably take the ID, to align with other commands -- although supporting both would be doable for now (until a future in which two bridges to the same external platform are supported)
  • The invalid key prefix message is shown when attempting to remove the bridge configuration from the local git configuration file ($GIT_DIR/config), if the section doesn't exist. Did you manually remove the bridge section? I don't think git-bug should care if the config section it's trying to remove doesn't exist.
  • Regarding multiple identities: when importing from a bridge, identities are created to account for user actions which do not map to current git-bug users.
  • To manually remove the identities, you'd need to rm -r .git/refs/identities -- but you should prefer using git bug wipe instead.

Regarding the "empty commits" you're seeing, let's first review what the --all flag does to git-log:

--all
                                                                                                      
    Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as <commit>.

git-bug creates objects for issues, which end up getting stored under the refs/bugs namespace, with identities being stored under the refs/identities namespace. git-log --all will thus show these refs as empty, authorless commits.

github-actions (github-actions) removed label lifecycle/idle

sudoforge changed the title from gitlab: invalid URL specified for personal access tokens to gitlab: invalid URL specified for personal access tokens

sudoforge added label kind/bug

sudoforge added label area/bridge/gitlab

github-actions (github-actions) added label lifecycle/pinned

sudoforge closed the bug