GitLab errors hide glab's stderr behind a generic "GitLab CLI command failed"
Les mainteneurs répondent en général sous 1 jour
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 73/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- gitlab, typescript
- Domaine
- backend, developer-experience
Piste de recherche
Lis packages/source-control-gitlab/src/server/GitLabCli.ts et compare son traitement des erreurs avec la modification de git stderr dans #5620. Suis le chemin de VcsProcessExitError jusqu’à GitLabCliCommandError.detail, y compris le mappage not-found dans fromVcsError. L’objectif est que le stderr utile de glab apparaisse dans l’erreur affichée, tout en conservant le traitement des erreurs d’authentification, de limite de débit et de spawn.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
What happened
In the desktop app, a self-hosted GitLab repo keeps showing Source control provider gitlab failed in listChangeRequests: GitLab CLI command failed. The app also can't create merge requests. Nothing in the UI says what glab actually returned, so the user can't tell whether this is a T3 Code problem, a glab problem or a GitLab server problem.
Diagnosis
The real cause was outside T3 Code. The company nginx reverse proxy in front of GitLab decodes %2F in API paths. So GET /api/v4/projects/<group>%2F<project> returns 404 for every project, while GET /api/v4/projects/<id> works. glab mr list in the repo fails with 404 Not Found.
T3 Code shows none of that. In packages/source-control-gitlab/src/server/GitLabCli.ts, GitLabCliCommandError.detail is a fixed string ("GitLab CLI command failed."). The VcsProcessExitError cause, which holds glab's stderr, only appears in the server trace. fromVcsError also maps failureKind: "not-found" to the same generic error. The ThreadSettlementServiceV2.sweep / ThreadPullRequestServiceV2.synchronize branch-MR lookup calls this again and again (about 4,100 failures in roughly 1.5 h in the trace), and every failure looks the same.
Suggestion: put a trimmed first line of glab's stderr into GitLabCliCommandError.detail/message, as #5620 did for git (fix(vcs): surface git's stderr on GitCommandError). For example: GitLab CLI command failed: 404 Not Found.
Steps to reproduce
- Use a self-hosted GitLab behind a reverse proxy that decodes
%2F(e.g. nginxproxy_pass http://backend/;). Any glab failure that isn't auth, rate limit or spawn works too. glab auth loginto that host (glab auth statusshows the host as logged in).- Open a repo with an
https://<host>/<group>/<project>.gitremote in the T3 Code desktop app. - Watch the source control / MR area:
GitLab CLI command failed.with no detail. Runglab mr listin the repo:404 Not Found.
Version
0.1.0 (desktop app; local server reports serverVersion 0.1.0). Also checked against main at 23b550dd: same code.
Environment
Windows 11 Pro 10.0.26200 x64, Node v26.8.2, glab 1.123.0, self-hosted GitLab behind nginx
Evidence
SourceControlProviderError: Source control provider gitlab failed in listChangeRequests: GitLab CLI command failed.
at findLatestPrForHeadContext ... lookupBranchPullRequest ... branchPullRequest
at ThreadSettlementServiceV2.pullRequestFor ... ThreadSettlementServiceV2.sweep
[cause]: GitLabCliCommandError: GitLab CLI failed in execute: GitLab CLI command failed.
[cause]: VcsProcessExitError: VCS process failed in GitLabCli.execute: glab (<repo>) exited with 1 - Merge request not found.
$ glab mr list --source-branch main
ERROR 404 Not Found.
$ glab api "projects/<group>%2F<project>" -> HTTP 404
$ glab api "projects/<id>" -> 200 OK
Related issues
#15660 (closed; generic "GitLab CLI command failed" on old GitLab, where the cause was also hidden). #5620 (same fix for git). #20226 and #7849 are about building GitLab project paths. None of them asks to show glab's stderr.
Fix applied or workaround
None in T3 Code. The GitLab admin was asked to fix the nginx proxy_pass so %2F isn't decoded.
Filed by
Claude Code (claude-opus-5-5) via t3 triage
- Langage dominant
- TypeScript
- Étoiles
- 24.8k
- Forks
- 6.4k
- Merge moyen
- 10 h 8 min
- PR mergées (30 j)
- 323
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de pingdotgg/t3code
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
[Bug]: open project shortcutOuvertebug needs-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 75/100
Les mainteneurs répondent en général sous 1 jour
-
needs more info via-triage
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
pingdotgg/t3code#22054 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de pingdotgg/t3code
Issues similaires
-
skillopt: success-reflect prompt omits the edit schema, so every success-only edit is droppedOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Workspace secrets/constants containing "$" are corrupted when resolved in data source optionsOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
mobile-next/mobile-mcp#526 ·
Les mainteneurs répondent en général sous 1 jour
-
e2e-failure ready-to-code
Difficulté 1/5 Moins d'une heure Accessibilité débutants 73/100
redhat-developer/rhdh-plugin-export-overlays#4470 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour