epicweb-dev / epic-stack

This is a Full Stack app starter with the foundational things setup and configured for you to hit the ground running on your next EPIC idea.
https://www.epicweb.dev/epic-stack
MIT License
4.47k stars 369 forks source link

LiteFS not working #110

Closed ananni13 closed 1 year ago

ananni13 commented 1 year ago

I created a demo app to test the stack, followed the instructions steps to deploy to Fly but seems like something related to LiteFS is not working.

The Deploy action fails with a timeout: https://github.com/ananni13/epic-demo/actions/runs/5110312304/jobs/9186104446

Error: timeout reached waiting for healthchecks to pass for machine e2865eddb7d278 failed to get VM e2865eddb7d278: Get "https://api.machines.dev/v1/apps/epic-demo-c661/machines/e2865eddb7d278": net/http: request canceled

Checking the app logs in Fly I see this message logged every second in a loop:

2023-05-29T09:14:53.283 app[e2865eddb7d278] sjc [info] A28237BB490D58F0: cannot acquire lease or find primary, retrying: fetch primary url: Get "http://127.0.0.1:8500/v1/kv/litefs/epic-demo-c661": dial tcp 127.0.0.1:8500: connect: connection refused
ananni13 commented 1 year ago

Looks like it could be related to the difference between V1/V2 apps on Fly, here's a discussion that I failed to notice https://github.com/epicweb-dev/epic-stack/discussions/22 😅

Anyway, running fly consul attach --app <app-name> after the first deploy (you can do this right after creating the apps and setting up secrets/volumes, no need to wait for the deploy) fixes the issue for now, deploy action is working as well.

kentcdodds commented 1 year ago

This should be resolved now. Thanks! https://github.com/epicweb-dev/epic-stack/commit/550ce76939ef99ddc09be9dfed494e6535760b69

taylrd commented 10 months ago

I just ran into this same thing today with the latest version of Epic-Stack. Had to run

fly consul attach --app