Hmmm yep definitely “Out of memory” — I’m stuffing a lot of various node modules in there, which is probably causing this problem. But building Sveltekit locally, the build folder is only 8mb. And because it’s the Docker builder running out of memory, provisioning more memory using
scale won’t really do anything right?
Edit: just kidding, the build folder is kind of big (57.3MB) lol… I should probably fix that. Curious though, for us who are really into big projects, is this usually bad practice? Should we be breaking up these monoliths? What’s usually the upper bound of a build folder size?
2023-10-28T13:25:04.585 app[6e82de00b03698] syd [info] [ 646.082064] Out of memory: Killed process 1254 (node) total-vm:35319584kB, anon-rss:3615348kB, file-rss:0kB, shmem-rss:0kB, UID:0 pgtables:103252kB oom_score_adj:0
Umpteenth edit: setting this in Docker makes it deploy! Any other number makes it not deploy…
I don’t really know what’s going on, but if it works, it works…
Edit: It kind of works, about 3 of 4 tries end up with
✖ Machine 9185e50a413483 [app] update failed: timed out waiting for machine to reach started state: failed to wait for VM 9185e50a413483 in started sta
Edit #??: The Fly.io site is now giving me error 500’s… maybe that’s a sign I should go to bed. Quite often (80% of the time) when trying to deploy, even to a new project, I get
Machine e2865944b70518 [app] update failed: failed to update VM e2865944b70518: request returned non-2xx status, 504
About half of my deployments also get:
PCI: Fatal: No config space access function found and the Sveltekit Node app fails to launch
Final Edit: Finally got everything to deploy! It was a combination of user error (didn’t set .env properly for Sveltekit; need to set ORIGIN), incorrect configs (needed
ENV NODE_OPTIONS="--max-old-space-size=4096" and
FROM node:18.15.0-alpine (not latest) in Dockerfile, and removing this mysterious line I don’t know where I got from:
BODY_SIZE_LIMIT=20000000), and deploying with a different registry (
FLY_REGISTRY_HOST=registry-iad.fly.io fly deploy bc of some registry issues at Fly), and a few other things that might be Fly-side I never figured out (Dockerfile running out of memory sometimes; Docker images failing to fetch, the Fly machine not starting properly). Honestly I’m not really sure why some of it didn’t work for so long, and why it later worked, especially the Docker deployments hanging, or Sveltekit reporting “not found” or responding “invalid request body” or thinking my deployment size to be way too big, but actually kind of small in comparison to “real” monolithic apps.
There was a lot of trial and error, hammering your build machine for the last week (sorry!) and finally got it working — but what makes me kind of uneasy is that I don’t think I solved all the problems of why things never worked but I did figure out how to get a new project / deployment working, with the Docker and fly.toml and .env configurations. Here’s to hoping it doesn’t break again when Node 20 rolls around…! Thanks for everything, Cheers!