App dev: every app-logs poll returns 400 "Malformed JWT", shown only as "Error while polling app logs"

I have reproduced the issue on the latest CLI version.

Yes, I am on the latest version

I have searched existing posts and this report is not a duplicate.

Yes, this isn’t a duplicate

In which of these areas are you experiencing a problem?

App

Expected behavior

With a Function extension in the app, shopify app dev streams Function run logs to the terminal under the app-logs prefix. If the log subscription token is invalid, the CLI should show the server’s status and message rather than a generic line.

Actual behavior

Every app-logs poll fails, from the first request to the end of the session. The terminal repeats this every 5 seconds:

app-logs │ Error while polling app logs.
app-logs │ Retrying in 5 seconds.

The CLI drops the HTTP status and body, so I patched the onUnknownError handler locally to print them. Every request to app_management/unstable/organizations//app_logs/poll returns:

status=400 errors=["Malformed JWT"]

The token sent is the one appLogsSubscribe just returned. It is a normal three-part JWT, about 288 characters. The first poll, with no cursor yet, fails too. I never saw a successful poll. As a result, Function run logs never stream and are never written to disk for app function replay.

The behaviour is identical on @shopify/cli 4.3.0 and 4.9.3. Environment: Node 22.19.0, Linux, App Management app with a dev store.

Reproduction steps

  1. Use an app that has at least one Function extension (ours is a discount Function).
  2. Run shopify app dev against a dev store.
  3. Watch the app-logs prefix in the output: “Error while polling app logs” repeats every 5 seconds for the whole session.

Verbose output

app-logs │ Error while polling app logs.
app-logs │ Retrying in 5 seconds.

–verbose prints nothing more for this failure. The status and message are discarded before logging, so the 400 “Malformed JWT” above came from a local patch to the CLI’s onUnknownError handler.

Operating system

Ubuntu 22

CLI version

4.9.3

Shell

bash

Nodejs version

22

What language and version are you using in your application?

Node (TypeScript)

Hey @james.waer, thanks for your report and for your patience waiting to hear back from us. I’ve brought this to the relevant team internally and will follow up here as soon as I have more info to share!

Any update ?? we are stuck because of this issue.

Hi @james.waer and @Donal-Shopify!

Just letting you know that this is a duplicate of this topic: Shopify app dev: "Error while polling app logs" loop.

But I’m happy to know that it reached the relevant team! :slight_smile:

Quick update all: The team responsible for the app logs poll have identified the root cause and are working on a fix. I’ll update this thread again once its shipped. Thanks for your patience with this, much appreciated.