# Troubleshooting

## Overview

This page helps you diagnose and resolve common issues encountered while running or using CodeAssist. It covers both runtime behaviors (inside the CodeAssist UI) and system errors (Docker or environment-related).

### Environment & Docker Errors

These issues occur before or during CodeAssist startup.

#### Exception: Container is unhealthy

This can occur when a Docker container fails to start properly.&#x20;

1. Check container logs:

```bash
docker logs <container-name>
```

2. Review the output for startup errors.&#x20;
3. Restart Docker and rerun CodeAssist:

```bash
sudo systelctl restart docker
uv run run.py
```

#### Error connecting to Docker daemon

If Docker isn't running, or your user lacks permission to access it, you may encounter an error that looks much like this one:

```bash
2025-09-04 15:03:47,975 - ERROR - Error connecting to Docker daemon:
Error while fetching server API version: ('Connection aborted.', FileNotFoundError(2, 'No such file or directory'))
2025-09-04 15:03:47,976 - ERROR - Please ensure Docker is installed and running.
```

1. Ensure Docker desktop (macOS and Windows) or Docker Engine (Linux) is open and running.&#x20;
2. You may need to restart Docker. If so, use this command:

```bash
sudo systemctl restart docker
```

3. Then, test your connection to Docker:

```bash
docker ps
```

4. If you still see the error, verify your user is in the `docker` group using this command:

```bash
sudo usermod -aG docker $USER
```

5. Log out and log back in.

{% hint style="info" %}
If CodeAssist crashes and Docker containers aren't shutting down correctly, use `docker stop $(docker ps -q)` to kill and restart all containers.&#x20;
{% endhint %}

#### Bind for 0.0.0.0:3000 failed: port is already allocated

This is a common issue you might experience if already running other Gensyn products, like [BlockAssist](https://docs.gensyn.ai/testnet/blockassist) or [RL Swarm.](https://docs.gensyn.ai/testnet/rl-swarm)

If a container, such as another Gensyn service, is already using `port:3000`, then the Docker containers will refuse to open. \
\
You have two options:

1. Stop the other service that is using the port (e.g., if you're running RL Swarm)
2. Run CodeAssist on a different port using the following `--port` argument:

```bash
uv run run.py --port 3001
```

When choosing a new port, please avoid `8000`, `8080`, `8001`, `8008`, `3003`, and `11434`, as they are reserved for other CodeAssist services.

{% hint style="info" %}
To check what containers are currently running, you can use the `docker ps` command or use the Docker Desktop UI.&#x20;
{% endhint %}

***

### Common Runtime Behaviors

These are expected or semi-expected quirks of the current CodeAssist prototype. They are **not necessarily bugs**, but knowing what they mean can save you time.

#### No-Ops (Assistant Stops Typing)

Sometimes, the assistant can enter a “no-operation” state. It’s unsure what to do next.

To fix this, simply move your cursor, add a space, or make any small edit. This resumes generation immediately.

{% hint style="info" %}
A **No-Op** is intentional. It signals when it is 'your turn.'
{% endhint %}

#### Broken Constraints in Problems

Some imported LeetCode problems include invalid or computationally infeasible test cases. You may encounter test cases that hang or never complete, and inputs that do not match the problem's listed constraints.&#x20;

{% hint style="danger" %}
This is due to the publicly-available, 3rd party LeetCode problem/solution dataset used within CodeAssist.
{% endhint %}

To fix this, choose a new problem from the sidebar and continue training. The issue is dataset-specific, not user-specific.&#x20;

#### "Wandering" Behavior

Rarely, the assistant will overwrite the starter function or switch to solving a different problem.&#x20;

To fix this:

1. Pause with `shift + space` or the UI button
2. Save your work by copying & pasting it elsewhere (if needed)
3. Restart CodeAssist (`ctrl + c`) then rerun with `uv run run.py`

#### Non-Linear Learning

After your first or second training run, performance may actually *degrade* before it shows signs of improvement.&#x20;

* **Why:** The assistant starts from a baseline model and calibrates using your early episodes. Initial adjustments on the model's side can be dramatic.
* **How to fix:** Continue recording and training on at least *five episodes* before expecting stable improvements and a more accurate outputting from your model.&#x20;

***

### When to Report an Issue

If you’ve tried the above steps and the problem persists:

* Collect your terminal output and Docker logs
* Include the CodeAssist version (`git rev-parse HEAD` in your repo)
* [Open a GitHub issue here](https://github.com/gensyn-ai/codeassist/issues) or share logs in the `#codeassist-support` channel on the [Gensyn Discord](https://discord.gg/gensyn)

{% hint style="success" %}
If you need additional support, you can [open a ticket](https://github.com/gensyn-ai/codeassist/issues) or [visit our Discord.](https://discord.com/invite/gensyn)&#x20;
{% endhint %}
