link_issue passes through a misleading 404 when an integration token lists Sentry App installations

Đang mở Phù hợp với người mới
#2,295 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue nà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
65/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ệ
typescript
Lĩnh vực
api, authentication

Hướng nghiên cứu

Bắt đầu tại packages/mcp-core/src/tools/support/issue-linking/app.ts, đặc biệt là linkAppIssue quanh các dòng 311–315, và theo dõi cách hàm xử lý lỗi từ listSentryAppInstallations. Issue mô tả việc chuyển lỗi 404 khi liệt kê thành UserInputError giải thích yêu cầu về member-token hoặc OAuth. Hoàn tất khi trường hợp integration-token trả về hướng dẫn rõ ràng đó thay vì lỗi 404 thô.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

mcp-feedback-pattern

Problem

An agent tried to link a Sentry issue to a Linear issue with link_issue three times, using numeric, short-ID and issue-URL forms. Each call failed with HTTP 404: "Could not find requested organization." Reading the same issue with get_issue_details worked, so the agent couldn't tell what was wrong and kept changing the issue reference (MCP-SERVER-GQW, kind=broken, impact=worked_around, server 0.42.0).

The org exists. The token isn't a member's token. Sentry only lists Sentry App installations for organization members, and link_issue needs that list to find the App's installation UUID.

Evidence

Failing call on 2026-11-16 at 16:02:44 UTC, trace 1ef233a8b788497097715d0d140d0143. There's no mcp.session.id or client.id.

  • The MCP http.server span has app.access.method=sentry_access (direct Sentry-Bearer token) and no user.id.
  • GET /organizations/{org}/issues/{shortId}/ returned 200. On the region side, GroupDetailsEndpoint made the app.find_installation_by_proxy_user RPC, which Sentry only runs for Sentry App proxy users (src/sentry/auth/access.py:1185, _from_rpc_sentry_app at :1374-1382). So the token is an integration (Sentry App) token.
  • GET https://sentry.io/api/0/organizations/{org}/sentry-app-installations/?per_page=100 returned 404 (span 858fccc96f0fe1d3). The control-silo span stops right after organization.get_access_context_by_slug and never reaches check_object_permissions.
  • Sentry at e495a739f: SentryAppInstallationsBaseEndpoint.convert_args (src/sentry/sentry_apps/api/bases/sentryapps.py:416-422) raises Could not find requested organization when context.member is None for a non-superuser with a user_id. A proxy user is never a member.
  • Toolkit at ca04710: linkAppIssue (packages/mcp-core/src/tools/support/issue-linking/app.ts:311-315) awaits listSentryAppInstallations in a Promise.all and lets the raw 404 through.
  • This isn't one user. In the last 14 days, sampled spans show 30 404s on this listing call. All 12 traces I checked were sentry_access sessions without a user.id.

Existing work

  • getsentry/sentry#128739 reports the same 404 for internal integration tokens. Draft getsentry/sentry#129878 lets internal integrations list their own org's installations and returns 403 for published-App tokens.
  • Inference from code, not tested: even with getsentry/sentry#129878, the link POST /sentry-app-installations/{uuid}/external-issue-actions/ checks is_acting_user(request.user, installation.sentry_app.proxy_user_id) for App callers (sentryapps.py:466-468). An internal integration's token would still be refused for the Linear installation. So the MCP should keep a clear error either way.
  • Not covered by toolkit#2136 (App not installed) or toolkit#1954 (409 URL guard).

Fix

Draft PR to follow: turn the 404 on the installation listing into a UserInputError that says Sentry only lists installations for org members, so integration tokens get this 404, and that linking App issues needs a user token or OAuth sign-in.

Reports

  • MCP-SERVER-GQW (2026-11-16)

Report count: 1

via automation evt_905b9c478746fd9deeb853f85ad7441b · Run ID dispatch_6b056fcf1c2c5c748f43774a62ac1591.

--

View Session [Sentry]

Ngôn ngữ chính
TypeScript
Star
975
Fork
189
Merge trung bình
1 ngày 2 giờ
Pull request đã merge (30 ngày)
571

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của getsentry/toolkit

Tất cả issue của getsentry/toolkit

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.