remix-run / indie-stack

The Remix Stack for deploying to Fly with SQLite, authentication, testing, linting, formatting, etc.
https://remix.run/stacks
MIT License
1.13k stars 316 forks source link

Initial commit will not deploy #278

Closed justin-hackin closed 7 months ago

justin-hackin commented 8 months ago

Have you experienced this bug with the latest version of the template?

yes

Steps to Reproduce

When I clone this project, and follow all setup instructions, the deployment happens but the healthcheck is never healthy. The prisma db call to count errors out:

The table `main.User` does not exist in the current database.

on the call to count.

I made my demo app public so you can see for yourself: https://github.com/justin-hackin/test-indie-stack

I tried many times. One time I didn't use the app name with the randomly generated string (I removed that). I assumed if the cli let me create an app, the name was as unique as it needs to be. However, I noticed that it complained about having the wrong region set and I was able to fix it by adding primary_region = "yyz" to my config. Does the app ensure the name is globally unique as I hear is required?

this post says create command deprecated. Could this be the cause?

Expected Behavior

The initial repo should deploy successfully after init/setup

Actual Behavior

see steps

justin-hackin commented 8 months ago

I tried fly launch after attempting all this and it's the same problem with that too.

justin-hackin commented 8 months ago

Although the fly launch hung on the healthcheck, when I pushed the changes, the github action was able to deploy. Sadly, I wasted many hours on this. I expected more from a supported stack with a paid subscription business behind it.

justin-hackin commented 8 months ago

Here's what happened in the logs when the cli launch run hangs on healthcheck:

2024-03-30T22:06:49.877 app[9080e30dae94d8] yyz [info] > start

2024-03-30T22:06:49.877 app[9080e30dae94d8] yyz [info] > remix-serve ./build/index.js

2024-03-30T22:06:50.227 app[9080e30dae94d8] yyz [info] /myapp/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:10

2024-03-30T22:06:50.227 app[9080e30dae94d8] yyz [info] throw new Error(prefix);

2024-03-30T22:06:50.227 app[9080e30dae94d8] yyz [info] ^

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] Error: Invariant failed

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at invariant (/myapp/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:10:15)

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at Object.<anonymous> (/myapp/build/index.js:186:35)

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at Module._compile (node:internal/modules/cjs/loader:1364:14)

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at Object.Module._extensions..js (node:internal/modules/cjs/loader:1422:10)

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at Module.load (node:internal/modules/cjs/loader:1203:32)

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at Function.Module._load (node:internal/modules/cjs/loader:1019:12)

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:203:29)

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at ModuleJob.run (node:internal/modules/esm/module_job:195:25)

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at ModuleLoader.import (node:internal/modules/esm/loader:337:24)

2024-03-30T22:06:50.228 app[9080e30dae94d8] yyz [info] at importModuleDynamicallyWrapper (node:internal/vm/module:432:15)

2024-03-30T22:06:50.984 app[9080e30dae94d8] yyz [info] INFO Main child exited normally with code: 1

2024-03-30T22:06:50.998 app[9080e30dae94d8] yyz [info] INFO Starting clean up.

2024-03-30T22:06:50.999 app[9080e30dae94d8] yyz [info] INFO Umounting /dev/vdb from /data

2024-03-30T22:06:51.000 app[9080e30dae94d8] yyz [info] [ 4.354386] reboot: Restarting system

2024-03-30T22:06:51.190 runner[9080e30dae94d8] yyz [info] machine has reached its max restart count (10)
justin-hackin commented 8 months ago

So, it gets worse, although the action reported a success, the app's requests all hang indefinitely 😖 I have reproduced this in 2 different projects.

justin-hackin commented 7 months ago

I started a discussion about this cursed process here: https://community.fly.io/t/have-you-ever-successfully-deployed-a-remix-js-app-using-the-indie-stack-whats-your-secret/19017

julianosirtori commented 7 months ago

I had the same problem, the workaround was scaling the machine's memory

fly scale memory 1024

I fink this issue is related: #276

MichaelDeBoey commented 7 months ago

CC/ @rubys

frimmy commented 7 months ago

guess... i'll just stand up a remix app on aws? 😅

I started a discussion about this cursed process here: https://community.fly.io/t/have-you-ever-successfully-deployed-a-remix-js-app-using-the-indie-stack-whats-your-secret/19017

cursed indeed

frimmy commented 7 months ago

https://fly.io/docs/js/frameworks/remix/ - seems like fly's docs are more up to date?

justin-hackin commented 7 months ago

I've thought about porting my code again to this https://github.com/epicweb-dev/epic-stack which is pretty similar and more scaffolded, I would be curious to know if it "just works".

justin-hackin commented 7 months ago

I'm closing this because when I was testing deploys there was a service outage with fly.io. I may have mistaken very long cold starts for the app hanging as well.