> ## Documentation Index
> Fetch the complete documentation index at: https://docs.squarecloud.app/llms.txt
> Use this file to discover all available pages before exploring further.

# App Won't Start on Square Cloud: EADDRINUSE, Cannot Find Module, INVALID_DEPENDENCY

> Fix EADDRINUSE port already in use, Cannot find module / ModuleNotFoundError, INVALID_DEPENDENCY, CONTAINER_TEMPORARILY_SUSPENDED, KEEP_CALM, better-sqlite3 bindings errors, and LACK_OF_RAM on Square Cloud.

If your application crashes at boot or never comes online, the console log almost always names the exact problem. Match the error below.

## EADDRINUSE (port already in use)

**What it means:** the app tries to bind the same network port twice.

**Why it happens:** two servers are started in the code, or a listener/`app.listen(...)` call gets created again inside an event handler (for example, on every request or every reconnect) instead of once at startup.

**How to fix:**

1. Bind **one** webserver, **once**, listening on port `80`.
2. Search your code for more than one `.listen()` (Node) or `run()` (Python/Flask/Django) call and remove the duplicate.
3. Make sure the listen call sits at the top level of your startup file, not inside a callback that can fire more than once.

```javascript theme={null}
// Correct: one listener, at the top level
app.listen(80, "0.0.0.0", () => {
  console.log("Server running");
});
```

<Note>Square Cloud dynamic apps must bind to host `0.0.0.0` and port `80`. Binding to `localhost`/`127.0.0.1` or any other port causes a site timeout instead.</Note>

## "Cannot find module" (Node.js) and ModuleNotFoundError (Python)

**What it means:** a package your code imports is missing from the dependencies file.

**Why it happens:** the library isn't listed in `package.json`'s `dependencies` (Node) or in `requirements.txt`/`pyproject.toml` (Python), so it never gets installed on the platform, even if it works on your machine.

**How to fix:**

1. Add the missing package to the dependencies file with a valid version.
2. Confirm the dependencies file itself is included in the `.zip` you uploaded.
3. Restart the application. For Node.js, a clean reinstall requires wiping `node_modules` first (delete it and `package-lock.json`, then restart) so the platform reinstalls from a clean state.

## INVALID\_DEPENDENCY

**What it means:** the deploy failed because an entry in your dependencies file doesn't exist or points to an invalid/unavailable version.

**How to fix:** open `package.json` / `requirements.txt` / `pyproject.toml`, fix the misspelled package name or version range for the flagged entry, and redeploy.

## CONTAINER\_TEMPORARILY\_SUSPENDED

**What it means:** the container was suspended by the platform.

**Why it happens:** this status is triggered by automatic resource-abuse protections, most commonly:

* **OOM (RAM):** the app tried to exceed its configured `MEMORY` and the process was killed.
* **CPU abuse:** the app continuously exceeded its allocated CPU, so the process was suspended to protect the node.
* **Request abuse:** a safety cap on traffic to `.squareweb.app` domains or messaging APIs (Discord, Telegram, WhatsApp) was tripped, almost always by an infinite loop or a missing cache rather than real popularity.

**How to fix:** check the email associated with your account, it explains which trigger caused the suspension. Then fix the root cause (memory leak, hot loop, or runaway request pattern) before restarting.

## KEEP\_CALM

**What it means:** a snapshot-related action was requested too fast.

**Why it happens:** either you (or an automation) requested a snapshot again before the platform's short cooldown between snapshot requests elapsed, or the account's daily snapshot limit for the current plan was reached. Note this is different from `DAILY_SNAPSHOTS_LIMIT_REACHED`, which specifically flags that the plan's daily quota is exhausted: `KEEP_CALM` can also fire on the shorter per-app cooldown between requests, independent of the daily count.

**How to fix:** wait a few minutes and try again. If the daily limit was hit, wait until the next day, or upgrade for a higher automatic-snapshot allowance.

## better-sqlite3 / native bindings errors

**What it means:** an error like `Could not locate the bindings file` when your app uses `better-sqlite3` (directly, or through `quick.db`).

**Why it happens:** the installed `better-sqlite3` version predates the platform's current Node.js LTS, so its prebuilt native binding doesn't match the runtime.

**How to fix:**

1. Update `better-sqlite3` to `12.5.0` or later (if you use `quick.db`, update it to `9.1.7` or later).
2. Delete `node_modules` **and** `package-lock.json`.
3. Restart the application for a clean reinstall that rebuilds the native bindings against the current runtime.

## LACK\_OF\_RAM

**What it means:** the application exceeded its allocated RAM, or the kernel signaled an out-of-memory condition, and the process was terminated to protect host stability.

**How to fix:**

1. Profile the app for memory leaks (Node.js: `--inspect`, Python: `memory_profiler`).
2. Move in-memory caches to Redis or another external store instead of growing an in-process cache/Map forever.
3. Increase the `MEMORY` value allocated to your application in the control panel.

See the full breakdown of RAM minimums, CPU allocation, and network/storage limits on the [Limits and Restrictions page](/en/platform/limitations-and-restrictions#lack_of_ram).

<Tip>Still stuck after checking the logs against the error above? Our support team can look at the specific crash with you.</Tip>

## Contact us

If you continue facing **technical difficulties**, our **specialized support team** is available to assist you. [**Contact us**](https://squarecloud.app/en/support) and we'll be happy to help you resolve any issue — support quality is a big part of why developers rate Square Cloud [**4.9/5 across 402 reviews**](https://www.trustpilot.com/review/squarecloud.app) on Google and Trustpilot.
