By ttlyacctpll
Hello! I deployed on App Platform yesterday and got a “Heap out of Memory” build error, which prevented my app from being deployed. After some online searching [1], I then added these 2 environment variables:
NODE_OPTIONS=--max-old-space-size=4096
GENERATE_SOURCEMAP=false
This caused my app to deploy successfully, but the Health App Check became “Unavailable” and when I tried to access my website, it displayed “We encountered an error when trying to load your application and your page could not be served. Check the logs for your application in the App Platform dashboard.”.
Anyone know what’s going on here?
[1] https://www.digitalocean.com/community/questions/app-platform-node-js-service-heap-out-of-memory
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hey there!
It sounds like your application may not actually have fully deployed if the health checks are failing. You will want to reference your application logs to see the errors being provided there. The message We encountered an error when trying to load your application and your page could not be served" typically indicates a 5xx error of some kind. Your logs should provide more details on it. You can also open your browser developer console and check the error shown there.
For the health checks you will want to make sure your application is set to listen on 0.0.0.0 and not 127.0.0.1 or localhost. You’ll also want to ensure you aren’t running any long migrations or other processes during the deploy that may prevent your application from being able to respond to health checks. You can move those to post deploy jobs instead.
Lastly if needed you can modify the health checks to start at a later time. You would need to edit the intial_delay_seconds to increase the amount of time before health checks start.
Hope it helps! Nate
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.