---
title: "App Won't Start? Fixing Common Container Errors"
description: "A bot or app that crashes or never comes online: how to read the console and fix a missing file, missing packages, address already in use and low memory."
url: https://fps.ms/docs/containers/troubleshooting
---
# Why won't my app start?

When a Container does not start, the **Console** tells you why. Start the server and read the last lines before it stops: they almost always name the problem. The most common causes are a main file the server cannot find, a package that is not installed, a port that is already in use, a missing environment variable, or a plan that runs out of memory. This page shows the message for each one and how to fix it.

## Read the console first

1. Go to [panel.fps.ms](https://panel.fps.ms) and click **Manage** on your server.
2. Click **Console**, then **Start** or **Restart**.
3. When the server stops, scroll up to the first error. FPS.ms then prints `Detected server process in a crashed state!` and an `Exit code`.

In a Python `Traceback`, the last line is the error and the lines above it show where it happened. In Node.js, the first line that starts with `Error:` is the one that matters.

## The server cannot find your main file

```txt
python: can't open file '/home/container/app.py': [Errno 2] No such file or directory
```

```txt
Error: Cannot find module '/home/container/index.js'
```

The server starts one file, `app.py` on Python and `index.js` on Node.js, from the main folder. Fix it one of these ways:

- Rename your file, or type its name in **App py file** (Python) or **Main file** (Node.js) on the **Startup** tab.
- Move the file out of a subfolder, or type the path, like `src/bot.py`.
- Did you upload a `.zip`? Unarchive it in **Files** first.

Other runtimes print their own message, like `No runnable jar found after the build.` on Java. The [supported runtimes](https://fps.ms/docs/containers/supported-runtimes.md) page lists the file or project each one looks for.

## A package is not installed

```txt
ModuleNotFoundError: No module named 'discord'
```

```txt
Error: Cannot find module 'discord.js'
```

- **Python:** add the package to `requirements.txt` in the main folder. See [installing Python packages](https://fps.ms/docs/containers/installing-python-packages.md).
- **Node.js:** add the package to `dependencies` in `package.json` in the main folder, for example with `npm install discord.js` on your computer. The server runs `npm install` on every start.

## Address already in use (EADDRINUSE)

```txt
Error: listen EADDRINUSE: address already in use 0.0.0.0:3000
```

```txt
OSError: [Errno 98] Address already in use
```

Your app tries to open a network port that something else already holds. The usual causes:

- **A hardcoded port.** Your app uses a fixed port like `3000`, `5000` or `8080`. Use the port in the `SERVER_PORT` environment variable instead. See [put a web app online](https://fps.ms/docs/containers/public-url.md) for examples.
- **Two listeners in one app.** For example a web server and a dashboard both on the same port. Give one of them another port, or let one serve both.
- **A second copy of your app.** A process your code started in the background is still running. Stop the server, wait until it is offline, then start it again.

A port below 1024, like `80` or `443`, fails with `EACCES` or `Permission denied`. Use `SERVER_PORT`: FPS.ms handles HTTPS on your [Public URL](https://fps.ms/docs/containers/public-url.md).

## An environment variable is missing

```txt
KeyError: 'BOT_TOKEN'
```

```txt
Error [TokenInvalid]: An invalid token was provided.
```

Your code reads a variable that is not set, or is set to the wrong value. Add it on the **Environment** tab, check the name for typos and capitals, and restart. Variables only reach your app after a restart. See [environment variables](https://fps.ms/docs/containers/environment-variables.md).

## The server ran out of memory

```txt
Your server ran out of memory: it used all 128 MB of its plan and was stopped.
```

Your app, or its build, needed more memory than your plan has. A `Killed` line in the output means the same.

- Install only the packages you use. Big libraries like `pandas` or `torch` need a lot of memory.
- Builds need more memory than running: Java and Kotlin with Gradle need about 1 GB.
- Upgrade the server to a plan with more memory.

## It starts and stops right away, with Exit code 0

Your code finished. A script that runs once and ends stops the server. A bot or a web app has to keep running: check that your code reaches `client.run(...)`, `bot.start()` or `app.listen(...)` and does not return early. To run a script on a timer, create a schedule on the **Schedules** tab that starts the server.

## A GitHub deploy failed

Open the **Deployments** tab and click **View log**. The last lines of the build name the problem. See [deploy from GitHub](https://fps.ms/docs/containers/deploy-from-github.md).

## Still stuck?

Copy the error lines from the console and [open a ticket](https://panel.fps.ms/tickets), or ask in our Discord. Never paste a token or password: replace it with `***`.

## Next steps

- [Supported runtimes](https://fps.ms/docs/containers/supported-runtimes.md)
- [Discord bot troubleshooting](https://fps.ms/docs/discord-bots/troubleshooting.md)
- [Telegram bot troubleshooting](https://fps.ms/docs/telegram-bots/troubleshooting.md)

---

[FPS.ms](https://fps.ms/index.html.md) · [All pages](https://fps.ms/llms.txt) · [Documentation](https://fps.ms/docs/llms.txt)
