[Bug]: app-logs poll returns HTTP 400 "Malformed JWT" — `shopify app dev` loops "Error while polling app logs" (CLI 4.9.4)
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 30/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- typescript
- Bereich
- authentication, cli
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- TypeScript
- Sterne
- 757
- Forks
- 294
- Ø Merge
- 4 T. 12 Std.
- Gemergte PRs (30 T.)
- 175
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus Shopify/cli
-
A background token refresh failure in a non-interactive process wipes every saved CLI session (all accounts)Evtl. vergeben @efegokdemir hat das vor 3 Tagen übernommen. Offen
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
Maintainer antworten meist innerhalb von 2 Tagen
-
[Bug]: app deploy fails intermittently with ENOENT on <handle>.js.map when two UI extensions share a folderEvtl. vergeben @efegokdemir hat das vor 13 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 67/100
Shopify/cli#8823 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 25/100
Shopify/cli#8753 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
[Bug]: `theme dev` proxy 502s on cookie-heavy storefront responses (undici default 16 KiB `maxHeaderSize`)Evtl. vergeben @efegokdemir hat das vor 19 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
Shopify/cli#8717 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
[Bug]: `shopify hydrogen dev` exits before listening when the npm registry is unreachable (p-cancelable onCancel-after-settle in latest-version chunk)Evtl. vergeben @efegokdemir hat das vor 18 Tagen übernommen. Offen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 48/100
Maintainer antworten meist innerhalb von 2 Tagen
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
chaitin/MonkeyCode#1437 ·
Maintainer antworten meist innerhalb von 1 Tag
-
rtdb-info-connected-order test: unhandled 'connection is closed' rejection fails the CLI suiteOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 69/100
carbon-design-system/carbon-ai-chat#2615 ·
Maintainer antworten meist innerhalb von 1 Tag
-
e2e-failure ready-to-code
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlineEvtl. vergeben @r2jaff hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
ComposioHQ/composio#5054 ·
Maintainer antworten meist innerhalb von 1 Tag