Deployment is failing due to swap memory #746
-
Hey all, I've been running a new project, fairly small, but when I try to deploy to Fly, I get errors when doing healthchecks: 2024-05-28T06:06:09.127 app[e28675d4a79558] sjc [info] level=INFO msg="executing command: npx [prisma migrate deploy]"
2024-05-28T06:06:10.531 app[e28675d4a79558] sjc [info] npm WARN exec The following package was not found and will be installed: [email protected]
2024-05-28T06:06:20.246 app[e28675d4a79558] sjc [info] <--- Last few GCs --->
2024-05-28T06:06:20.246 app[e28675d4a79558] sjc [info] [340:0x5c9e270] 10425 ms: Mark-Compact (reduce) 253.5 (257.7) -> 253.4 (258.4) MB, 600.07 / 0.26 ms (+ 244.6 ms in 188 steps since start of marking, biggest step 69.5 ms, walltime since start of marking 1319 ms) (average mu = 0.567, current mu = 0.553[340:0x5c9e270] 11108 ms: Mark-Compact (reduce) 254.4 (258.4) -> 254.4 (259.4) MB, 667.27 / 0.00 ms (average mu = 0.401, current mu = 0.025) allocation failure; scavenge might not succeed
2024-05-28T06:06:20.246 app[e28675d4a79558] sjc [info] <--- JS stacktrace --->
2024-05-28T06:06:20.247 app[e28675d4a79558] sjc [info] FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
2024-05-28T06:06:20.247 app[e28675d4a79558] sjc [info] ----- Native stack trace -----
2024-05-28T06:06:20.264 app[e28675d4a79558] sjc [info] 1: 0xb82c28 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.264 app[e28675d4a79558] sjc [info] 2: 0xeed540 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.265 app[e28675d4a79558] sjc [info] 3: 0xeed827 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.266 app[e28675d4a79558] sjc [info] 4: 0x10ff3c5 [npm exec prisma migrate deploy]
2024-05-28T06:06:20.268 app[e28675d4a79558] sjc [info] 5: 0x1117248 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.269 app[e28675d4a79558] sjc [info] 6: 0x10ed361 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.270 app[e28675d4a79558] sjc [info] 7: 0x10ee4f5 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.270 app[e28675d4a79558] sjc [info] 8: 0x10cac16 v8::internal::Factory::AllocateRaw(int, v8::internal::AllocationType, v8::internal::AllocationAlignment) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.271 app[e28675d4a79558] sjc [info] 9: 0x10bc844 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawWithImmortalMap(int, v8::internal::AllocationType, v8::internal::Map, v8::internal::AllocationAlignment) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.272 app[e28675d4a79558] sjc [info] 10: 0x10bfb57 v8::internal::FactoryBase<v8::internal::Factory>::NewRawTwoByteString(int, v8::internal::AllocationType) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.272 app[e28675d4a79558] sjc [info] 11: 0x1230927 v8::internal::JsonParser<unsigned short>::MakeString(v8::internal::JsonString const&, v8::internal::Handle<v8::internal::String>) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.273 app[e28675d4a79558] sjc [info] 12: 0x123680d [npm exec prisma migrate deploy]
2024-05-28T06:06:20.274 app[e28675d4a79558] sjc [info] 13: 0x1238779 v8::internal::JsonParser<unsigned short>::ParseJson(v8::internal::Handle<v8::internal::Object>) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.275 app[e28675d4a79558] sjc [info] 14: 0xf7f21e v8::internal::Builtin_JsonParse(int, unsigned long*, v8::internal::Isolate*) [npm exec prisma migrate deploy]
2024-05-28T06:06:20.276 app[e28675d4a79558] sjc [info] 15: 0x1960df6 [npm exec prisma migrate deploy]
2024-05-28T06:06:20.308 app[e28675d4a79558] sjc [info] ERROR: cannot exec: sync cmd: cannot run command: signal: aborted
2024-05-28T06:06:20.320 app[e28675d4a79558] sjc [info] level=INFO msg="F254301428616D5C: exiting primary, destroying lease" It happens when trying to run migrations but I don't think it's related to the migrations exactly, and instead it's related to the memory configuration somehow. I think this is related: remix-run/indie-stack#276. But I tried adding the swap config to the .toml file and it still failed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I'm uncertain what could be the cause of using so much memory during the migration (and debugging out of memory errors is a huge pain), but you could probably bump the memory on your machine and you'll be set. The Epic Stack template (which you get when you deploy a fresh new epic stack app) runs on 1 CPU with 256MB of memory (within Fly's free allowances). So I'm not sure what's different about your app that could contribute to the out of memory error. Sorry! |
Beta Was this translation helpful? Give feedback.
I'm uncertain what could be the cause of using so much memory during the migration (and debugging out of memory errors is a huge pain), but you could probably bump the memory on your machine and you'll be set.
The Epic Stack template (which you get when you deploy a fresh new epic stack app) runs on 1 CPU with 256MB of memory (within Fly's free allowances). So I'm not sure what's different about your app that could contribute to the out of memory error. Sorry!