Remix, SqLite and Fly - Database tables not found

Hi! I did start with Remix to get to know that framework, and it’s nice so far. However after following the exact documentation, deploying on Fly.io does not work. Everything is running but when trying to make a POST request (/login), I am getting a server error. This is what is inside the logs:

2022-04-25T10:30:57.406 app[888f1801] ams [info] PrismaClientKnownRequestError: The table `main.User` does not exist in the current database.

2022-04-25T10:30:57.406 app[888f1801] ams [info]     at Object.request (/app/node_modules/@prisma/client/runtime/index.js:45578:15)

2022-04-25T10:30:57.406 app[888f1801] ams [info]     at PrismaClient._request (/app/node_modules/@prisma/client/runtime/index.js:46405:18)

2022-04-25T10:30:57.406 app[888f1801] ams [info]     at login (/app/app/utils/session.server.ts:34:16)

2022-04-25T10:30:57.406 app[888f1801] ams [info]     at action3 (/Users/dennis/Developer/loyall-docs/app/routes/login.jsx:97:18)

2022-04-25T10:30:57.406 app[888f1801] ams [info]     at Object.callRouteAction (/app/node_modules/@remix-run/server-runtime/data.js:40:14)

2022-04-25T10:30:57.406 app[888f1801] ams [info]     at handleDataRequest (/app/node_modules/@remix-run/server-runtime/server.js:94:18)

2022-04-25T10:30:57.406 app[888f1801] ams [info]     at requestHandler (/app/node_modules/@remix-run/server-runtime/server.js:34:18)

2022-04-25T10:30:57.406 app[888f1801] ams [info]     at /app/node_modules/@remix-run/express/server.js:41:22 {

2022-04-25T10:30:57.406 app[888f1801] ams [info]   code: 'P2021',

2022-04-25T10:30:57.406 app[888f1801] ams [info]   clientVersion: '3.12.0',

2022-04-25T10:30:57.406 app[888f1801] ams [info]   meta: { table: 'main.User' }

2022-04-25T10:30:57.406 app[888f1801] ams [info] }

2022-04-25T10:30:57.407 app[888f1801] ams [info] POST /login?_data=routes%2Flogin 500 - - 8.695 ms

2022-04-25T10:30:57.431 app[888f1801] ams [info] GET /login?_data=root 200 - - 1.801 ms

The database tables are not found but I did run migration commands etc. How could I fix this issue?

1 Like

Did try so ssh into the /app folder off the app and run some prisma commands, but without any succes. Still saying database tables are missing.

no reply from Fly in 1 year?

1 Like