Remix App: POST multipart/form-data (via Shopify App Proxy) returning 500, not hitting entry.server.tsx

Hi everyone,

Hoping someone might have insights into a persistent issue we’re facing with our Remix app deployed on Fly.io.

Context:

  • Stack: Remix v2, remix-serve, Node 18 (Alpine), Fly Postgres.

  • VM: Currently shared-cpu-2x (512MB RAM, scaled up during testing).

  • Workflow: A Shopify theme extension sends a POST request with multipart/form-data (containing a ~1-2MB image) via Shopify’s App Proxy to our backend endpoint (/apps/our-app-subpath/process-image?shop=…) for image processing.

The Problem:

The browser consistently gets a 500 Internal Server Error for these specific POST requests. The core issue seems to be that the request never reaches our Remix application code .

  • We’ve added logging to the absolute entry point (app/entry.server.tsx).

  • fly logs show standard GET requests (health checks, etc.) hitting entry.server.tsx successfully.

  • However, the POST requests with multipart/form-data do not appear in the entry.server.tsx logs at all.

What We’ve Tried:

  1. Verified App Proxy Config: Shopify App Proxy URL points correctly to our base Fly hostname (https://app2-virtual-try-on.fly.dev).

  2. Scaled VM: Increased RAM to rule out memory exhaustion during request buffering. Problem persists.

  3. Fixed Startup Issues: Resolved previous unrelated Prisma client init errors that caused crashes. The app now starts cleanly and passes health checks reliably (previous deployment warnings about the app “not listening” are gone).

  4. Simplified Handler: Deployed a minimal Remix action handler returning only 200 OK; the request still didn’t reach it.

  5. Local Testing: Saw a similar 500 symptom locally with Shopify CLI tunnel, but curl tests did reach the local handler, suggesting the local problem was tunnel-specific.

Hypothesis:

Since GETs work, the app is healthy, and the POST request vanishes before entry.server.tsx, we suspect the Fly.io proxy/load balancer might be dropping or rejecting these specific multipart/form-data POST requests (possibly due to size, content, or interactions with the Shopify App Proxy forwarding) before they hit our app container.

Questions:

  1. Has anyone else hit issues with multipart/form-data POSTs (especially >1MB or via App Proxy) getting dropped before reaching their app on Fly.io?

  2. Are there specific Fly proxy configurations (body size limits, timeouts, filters) that might silently cause a 500 without logging anything in fly logs?

  3. Any other ideas for diagnosing requests that seem to fail at the Fly infrastructure level before the application VM?

We’re a bit stuck debugging this “black hole”. Any pointers would be hugely appreciated!

Thanks!


1 Like

whenever fly-proxy drops a request to your app, it prints a message to the app logs. I’d recommend searching app logs (with event.provider:'proxy') to find any such requests. however, to my knowledge it only returns 502 and not 500 status code, so it’s likely the Shopify app proxy is generating that error.

I’m not familiar with the Shopify app proxy. does it have any logs you can check?

what response body are you getting in the browser?

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.