App Proxy 500 Error - POST multipart/form-data not reaching backend (Remix/Fly.io)

Hi fellow developers,

We’re running into a strange issue with the App Proxy when handling image uploads from a theme extension.

Context:

  • Frontend: Theme App Extension, uses fetch to POST multipart/form-data (with a ~1-2MB image file) to the App Proxy path.

  • App Proxy Config: Prefix apps, Subpath xyz, Proxy URL https://.fly.dev (base hostname). Target URL from JS is /apps/xyz/process-image?shop=…

  • Backend: Remix app hosted externally (on Fly.io).

The Problem:

The fetch request from the theme extension consistently results in a 500 Internal Server Error in the browser.

  • Browser console shows the request being initiated correctly to the /apps/… path.

  • Backend server logs (at the earliest possible entry point, before any Remix routing) show that this specific POST request never arrives .

  • The backend server is running and successfully handles other requests (like GETs for health checks or loading the app in Admin).

What We’ve Ruled Out:

  1. App Proxy Config: We’ve confirmed the Proxy URL points to the correct base hostname of our backend server.

  2. Backend Server Issues: The server is stable, running, responding to other requests, and we’ve fixed previous unrelated startup problems. Scaling server resources didn’t help.

  3. Backend Code: Tested with a minimal backend handler for the route; the request still doesn’t arrive.

Hypothesis:

Since the request leaves the browser destined for the App Proxy path, but never reaches our backend’s entry point (while other requests do), we suspect the issue might be occurring within the Shopify App Proxy forwarding layer itself, specifically when dealing with multipart/form-data POST requests containing files.

Questions:

  1. Has anyone experienced the App Proxy seemingly dropping or failing to forward multipart/form-data POST requests, especially those with files around 1-2MB?

  2. Are there known limitations, header requirements, or specific behaviors of the App Proxy when handling multipart/form-data compared to regular POSTs or GETs?

  3. Does the App Proxy potentially impose size limits or timeouts before it even attempts to forward the request to the configured Proxy URL?

  4. Is there any way to get visibility or debug information on how the App Proxy processes a specific request before forwarding it?

It feels like the request is getting lost within Shopify’s infrastructure. Any tips for debugging App Proxy forwarding for file uploads would be greatly appreciated!

Thanks!

Hey @shoping :waving_hand: - I can’t say for sure what is happening here without a bit more info, but based on your description of your server seemingly not receiving the response from Shopify and the 500 error in browser, it could potentially be a limitation on our end.

Would you be able to share an X-Request-ID value from the 500 error that’s popping up in the browser if possible? You should usually be able to pull those from the response headers in the Network tab of Chrome Dev tools like this if the 500 error is originating on our end:

If you’re able to grab one of those request IDs, our team can take a closer look at this for sure.

Hi @shoping

Just wanted to check if you’re still experiencing this issue, or can we mark this topic as closed/solved?