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
- Use an app that has at least one Function extension (ours is a discount Function).
- Run
shopify app devagainst a dev store. - 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)