Remix app pim Integration deployed on fly.io

Topic summary

A developer is building a Shopify app that imports product data from a PIM system via API with automatic synchronization. The app works correctly in development but encounters session authentication issues after deployment to fly.io.

Main Issue:

  • “Invalid session” or “No valid session found” errors occur on first import attempt
  • Typically succeeds on second or third click
  • Error logs show the app requesting offline access tokens and returning 500 Internal Server Error

Technical Context:

  • Built using Remix template with default SQLite database configuration
  • No custom changes made to database or proxy settings

Troubleshooting Suggestions:

  • Reinstall the app in the Shopify store
  • Migrate session data from development environment to fly.io production database
  • Verify session table data in the SQLite database on fly.io
  • Consider whether a custom database setup is needed for production deployment

The discussion remains open with the developer seeking guidance on session management in production environments.

Summarized with AI on November 4. AI used: claude-sonnet-4-5-20250929.

I am creating an app that integrates a pim system through their api with a Shopify store. It’s a one way import from pim to Shopify with auto sync. I’m partly finished and it’s working fine in development. I have deployed the app to fly.io

when I run an import I get an invalid session error. If I click import again it normally works on second or third click. Anyone know how to fix this? I have not changed any settings regarding database or proxy. It’s just from the default remix template. Here is the error: │ [shopify-app/INFO] Authenticating admin request
16:27:15 │ remix │ [shopify-app/INFO] Authenticating admin request
16:27:15 │ remix │ [shopify-app/INFO] No valid session found
16:27:15 │ remix │ [shopify-app/INFO] Requesting offline access token
16:27:15 │ remix │ [shopify-app/INFO] No valid session found
16:27:15 │ remix │ [shopify-app/INFO] Requesting offline access token
16:27:15 │ remix │ error Response {
16:27:15 │ remix │ size: 0,
16:27:15 │ remix │ [Symbol(Body internals)]: {
16:27:15 │ remix │ body: null,
16:27:15 │ remix │ type: null,
16:27:15 │ remix │ size: 0,
16:27:15 │ remix │ boundary: null,
16:27:15 │ remix │ disturbed: false,
16:27:15 │ remix │ error: null
16:27:15 │ remix │ },
16:27:15 │ remix │ [Symbol(Response internals)]: {
16:27:15 │ remix │ url: undefined,
16:27:15 │ remix │ status: 500,
16:27:15 │ remix │ statusText: ‘Internal Server Error’,
16:27:15 │ remix │ headers: {},
16:27:15 │ remix │ counter: 0,
16:27:15 │ remix │ highWaterMark: undefined
16:27:15 │ remix │ }
16:27:15 │ remix │ }

Hi @GlennAppsal

  1. Have you tried reinstalling the app in the store?
  2. If you don’t want to try reinstalling, can you migrate the session data from the development environment to the fly.io environment together, what database are you using? You can find it in the session table of the database.

Have not tried to reinstall it. I am just using the SQLite default configuration that was setup in the scaffolded app. Do I need to setup a custom database for production? I’m not sure how the session work in remix

Can you check the session table in the sqllite data in fly.io.