[Bug]: app-logs poll returns HTTP 400 "Malformed JWT" — `shopify app dev` loops "Error while polling app logs" (CLI 4.9.4)
維護者通常 2 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 30/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- authentication, cli
研究方向
Start in the app-logs poller's error handler (onUnknownError), which drops the status and body before printing "Error while polling app logs.", and in the request builder that sets the authorization and X-Shopify-Access-Token headers for app_logs/poll. A reasonable first step is to surface the HTTP status and response body in that error output and check it with a test or a mocked 400 response. The root cause lies server-side and is under investigation by Shopify, so the work is not to fix the JWT.
由索引模型根據 Issue 內容生成。
描述
Summary
With an app that has a Function extension, shopify app dev starts the app-logs poller (as designed), but every poll fails and the app-logs panel loops forever:
app-logs │ Error while polling app logs.
app-logs │ Retrying in 5 seconds.
The underlying request returns HTTP 400 {"errors":["Malformed JWT"]}. The CLI never shows the status or body, so the failure is undiagnosable without patching the CLI.
Expected behavior
shopify app dev streams Function run logs to the terminal under the app-logs prefix.
Actual behavior
Every app_logs/poll request fails from the first request to the end of the session, repeating every 5 seconds. shopify app logs -s <dev-store> reproduces the identical failure standalone, so it is not specific to app dev.
Note: only apps that contain a Function extension poll app logs at all (allExtensions.some(isFunctionExtension) gates the poller), so apps without a Function extension are unaffected and will not show this.
Reproduction
- Use an app that contains a Function extension (e.g. any
type = "function"extension inshopify.extension.toml). - Link a development store.
- Run
shopify app dev(orshopify app logs -s <dev-store>). - Observe the loop.
Evidence (captured on CLI 4.9.4)
AppLogsSubscribe (App Management API) succeeds and returns a jwtToken. The subsequent poll is then rejected:
- Request:
GET https://app.shopify.com/app_management/unstable/organizations/<org-id>/app_logs/poll- headers sent (per the CLI's own builder):
authorization: Bearer <jwt>andX-Shopify-Access-Token: Bearer <jwt>
- headers sent (per the CLI's own builder):
- Response:
HTTP 400 - Body:
{"errors":["Malformed JWT"]}
The JWT is fresh (30 minutes from expires_at) and its payload carries no organization claim:
{"shop_ids":[<id>],"app_id":<id>,"api_key":"<redacted>","user_id":"<redacted>","expires_at":<future>}
The poll endpoint is organization-scoped, and the token contains no organization claim. That mismatch is one hypothesis; it is also consistent with a signing/secret mismatch on the server side. Either way the minted subscription token is not accepted by the poll endpoint for any shop or organization.
CLI defect (separate, makes this hard to diagnose)
The poller's error handler drops the status code and response body before printing Error while polling app logs. (onUnknownError). --verbose shows the request but not the response, so the 400 + Malformed JWT only surfaces if the CLI is patched.
Environment
- Shopify CLI 4.9.4 (Homebrew), macOS (arm64)
- Node 26.11.1
- App has exactly one
functionextension organizationIdresolves correctly for this app (appByKeyreturns it), so this is not a missing-organization problem
Notes
- Already reported on community.shopify.dev:
- https://community.shopify.dev/t/shopify-app-dev-error-while-polling-app-logs-loop/38419
- https://community.shopify.dev/t/app-dev-every-app-logs-poll-returns-400-malformed-jwt-shown-only-as-error-while-polling-app-logs/38493
- Shopify staff acknowledged on 2026-10-13 that the relevant team is investigating; filing this to track the root cause and the CLI's missing error detail.
- 主要語言
- TypeScript
- 星號
- 757
- 分支
- 294
- 平均合併
- 2 天 20 小時
- 30 天內合併 PR
- 163
環境準備
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
Shopify/cli 的其他 Issue
-
[Bug]: app deploy fails intermittently with ENOENT on <handle>.js.map when two UI extensions share a folder可能已有人在做 @efegokdemir 於 7 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 67/100
維護者通常 2 天內回覆
-
難度 4/5 3-5 天 新手友好度 25/100
維護者通常 2 天內回覆
-
[Bug]: `theme dev` proxy 502s on cookie-heavy storefront responses (undici default 16 KiB `maxHeaderSize`)可能已有人在做 @efegokdemir 於 13 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 68/100
維護者通常 2 天內回覆
-
[Bug]: `shopify hydrogen dev` exits before listening when the npm registry is unreachable (p-cancelable onCancel-after-settle in latest-version chunk)可能已有人在做 @efegokdemir 於 12 天前認領。 未關閉
難度 4/5 3-5 天 新手友好度 48/100
維護者通常 2 天內回覆
-
難度 4/5 3-5 天 新手友好度 48/100
維護者通常 2 天內回覆
相似的 Issue
-
documentation good first issue
難度 2/5 半天 新手友好度 72/100
sujithputta02/Esapay#13 ·
-
難度 2/5 1-3 小時 新手友好度 65/100
ehmpathy/rhachet-roles-bhuild#468 ·
維護者通常 1 天內回覆
-
Share dialog: the address book's contact count reads "1 contacts" (no singular form in any language)可能已有人在做 @chibenwa 今天認領。 未關閉ai-driven-qa bug claude Cosmetic
難度 2/5 1-3 小時 新手友好度 72/100
linagora/twake-contacts-frontend#271 · 1 則留言 ·
維護者通常 1 天內回覆
-
factory-active task-identify-harness-labels-done task-identify-issue-type-done
難度 1/5 1 小時以內 新手友好度 70/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
Koenkk/zigbee2mqtt#33402 ·
維護者通常 1 天內回覆