Diagnosing Offline Applications
Learn how to diagnose and resolve common issues with applications that fail to stay online on Discloud.
If your application shuts down unexpectedly on Discloud, it is important to analyze what might be causing the issue. This guide will help you identify, debug, and resolve common problems related to applications going offline.
🛑 Common Application Behaviors & Causes
When an application shuts down unexpectedly, the behavior can provide clues about the root cause.
Starts and immediately shuts down.
Indicates a critical issue preventing proper initialization.
Likely causes: RAM limitations, missing dependencies, incorrect configurations, or startup code errors.
Shuts down during a specific action.
Happens when the application is triggered by a particular command or event.
Likely causes: Uncaught exceptions, high resource usage, or API failures.
Goes offline after a few days (free plan).
Could be related to Discloud’s anti-ghost app policy for free plans.
Consider upgrading to a paid plan to keep applications online.
⚠️ Potential Causes & Fixes
Insufficient RAM
If your application exceeds its allocated memory, it may be forcefully shut down.
✔ Monitor RAM usage and optimize your code.
✔ Consider increasing RAM in your discloud.config
file.
Code Errors & Exceptions
Unhandled exceptions or bugs in your code can cause crashes.
✔ Check the logs for error messages. ✔ Test locally before deploying to Discloud.
Free Plan Limitations
Discloud’s free plan may suspend inactive applications to free up resources.
✔ If your application goes offline unexpectedly, this could be the reason. ✔ Consider upgrading to a paid plan to keep it running.
🛠️ Step-by-Step Debugging
📌 A common mistake developers make is saying: "It works on my machine but not on Discloud."
Remember, Discloud operates in a Linux environment. Your application must be adapted to run on the target environment, not just your local machine.
⚡ Fixing Applications That Shut Down Immediately
If your application starts and immediately shuts down, it’s often due to:
Insufficient RAM.
If the application uses more memory than allocated, Discloud forcefully shuts it down.
Check your RAM usage and optimize memory-intensive operations.
Errors during initialization.
Bugs in the startup sequence can prevent the app from running properly.
Check for missing dependencies, incorrect configurations, or uncaught errors in the startup logic.
❗ Fixing Applications That Shut Down During a Specific Action
If your application stops running when a specific event or action is triggered, follow these debugging steps:
Check the logs.
Logs provide valuable insights into what caused the crash.
Look for error messages related to that action.
Review the code handling that action.
Check for unhandled exceptions, invalid API responses, or database errors.
Ensure proper error handling is in place.
Monitor resource usage.
Some actions require more RAM (e.g., playing music, processing images).
If the action is resource-intensive, consider increasing RAM allocation.
🎵 Common Examples (Discord Applications)
Music Bots
If the bot shuts down when playing music, it could be due to:
✔ High RAM usage → Optimize audio processing.
✔ Missing ffmpeg
→ Add ffmpeg
in APT
dependencies.
✔ API rate limits → Check if you're hitting limits with the music provider.
Image Generation Bots
Generating images consumes memory.
Ensure your bot has sufficient RAM and optimizes image processing code.
🛰️ Check Discloud's Status
If none of the above solutions resolve the issue, check the Discloud status page or the Discord channel for any reported system-wide issues. Temporary infrastructure problems could impact the availability of your application.
Last updated