# Frequent questions

### Stop and restart <a href="#stop-and-restart" id="stop-and-restart"></a>

`docker compose down`

`docker compose up -d`

### Getting the logs <a href="#getting-the-logs" id="getting-the-logs"></a>

All services logs combined:

`docker compose logs`

Specific service:

`docker compose logs backend`

### Didn't get the prompt for the first user <a href="#didnt-get-the-prompt-for-the-first-user" id="didnt-get-the-prompt-for-the-first-user"></a>

If you didn't get the prompt to create the first user, or lost the password but you still have access to the infra level, you can trigger the `createsuperuser` command to fix that.

In your compose file folder, try:

`docker compose exec backend poetry run python manage.py createsuperuser`

Alternatively, in a docker environment:

`docker ps -a | grep backend` (this will get you the id of the Backend for CISO Assistant container, keep it for the next step)

`docker exec -it <the_container_id> poetry run python manage.py createsuperuser`

and you should get a prompt now 😉

### Lost the first user password <a href="#lost-the-first-user-password" id="lost-the-first-user-password"></a>

`docker compose exec backend poetry run python manage.py changepassword <user_email>`

You'll get a prompt to change the password

### Random issues after upgrading <a href="#random-issues-after-upgrading" id="random-issues-after-upgrading"></a>

In some rare cases, the migration of database schemas can take longer than expected or fail silently. First thing to check is the backend container logs:

```shellscript
docker compose logs backend
```

Make sure you share these information if you're reporting an issue on Discord or the Support portal.

If you want to trigger the migration to make sure that all increments have been properly applied:

```shellscript
docker compose exec backend poetry run python manage.py migrate
```

### Healthcheck fails during the installation <a href="#healthcheck-fails-during-the-installation" id="healthcheck-fails-during-the-installation"></a>

most likely because the initialization took longer than expected. Make sure you provide the expected specs or tune the docker compose to give the app more time to finish the init phase.

### Don't want / Can't run the init script <a href="#dont-want-cant-run-the-init-script" id="dont-want-cant-run-the-init-script"></a>

The recommended pattern for a first local setup is to go with ./docker-compose.sh ; In case you can't:

Run

```shellscript
docker compose up -d
```

wait for the init to finish and then trigger the first user creation manually:

```shellscript
docker compose exec backend poetry run python manage.py createsuperuser
```

#### "Payload too large" when uploading a file to the frontend <a href="#payload-too-large-when-uploading-a-file-to-the-frontend" id="payload-too-large-when-uploading-a-file-to-the-frontend"></a>

By default, the `BODY_SIZE_LIMIT` environment variable is set to 20 MB in the frontend Dockerfile:

```shellscript
# frontend/Dockerfile

ENV BODY_SIZE_LIMIT=20000000 
```

In order to upload larger files, this value must be increased. How to do so depends on you rmode of deployment. Here are relevant docs:

* <https://docs.docker.com/compose/how-tos/environment-variables/set-environment-variables/>
* <https://helm.sh/docs/helm/helm_env/>
* <https://docs.docker.com/reference/cli/docker/container/run/#env>

If you use helm, this value is overwritten by the `bodySizeLimit` variable. Note the camel case here.
