GitLab errors hide glab's stderr behind a generic "GitLab CLI command failed"
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 73/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- gitlab, typescript
- Lĩnh vực
- backend, developer-experience
Hướng nghiên cứu
Đọc packages/source-control-gitlab/src/server/GitLabCli.ts và so sánh cách xử lý lỗi với thay đổi về git stderr trong #5620. Theo dõi cách VcsProcessExitError đi đến GitLabCliCommandError.detail, bao gồm cả ánh xạ not-found trong fromVcsError. Mục tiêu là stderr hữu ích của glab xuất hiện trong lỗi được hiển thị, đồng thời cách xử lý lỗi xác thực, giới hạn tốc độ và spawn vẫn được giữ nguyên.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- TypeScript
- Star
- 24.8k
- Fork
- 6.4k
- Merge trung bình
- 10 giờ 8 phút
- Pull request đã merge (30 ngày)
- 323
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pingdotgg/t3code
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: open project shortcutĐang mởbug needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
needs more info via-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
pingdotgg/t3code#22054 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pingdotgg/t3code
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
mobile-next/mobile-mcp#526 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
e2e-failure ready-to-code
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 73/100
redhat-developer/rhdh-plugin-export-overlays#4470 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
anthropics/anthropic-sdk-typescript#1273 ·
Maintainer thường phản hồi trong vòng 10 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
CopilotKit/OpenBot#815 ·
Maintainer thường phản hồi trong vòng 1 ngày