funkwhale/docs/administrator/troubleshooting/backend.md

201 wiersze
4.4 KiB
Markdown
Czysty Zwykły widok Historia

2022-07-01 09:02:29 +00:00
# Troubleshoot backend issues
The Funkwhale backend is made up of lots of moving parts. This guide shows you how to troubleshoot and gather information about the most important elements of the backend.
## Tools
If you have access to the Funkwhale backend, you can use logs to get more information about an issue.
- **Reverse proxy logs** – check these logs if you have connectivity issues.
2022-07-01 09:02:29 +00:00
::::{tab-set}
2022-07-23 13:32:35 +00:00
:::{tab-item} Nginx
:sync: nginx
2022-07-01 09:02:29 +00:00
```{code-block} sh
sudo tail -f /var/log/nginx/access.log # Follow the access log
sudo tail -f /var/log/nginx/error.log # Follow the error log
```
2022-07-01 09:02:29 +00:00
:::
2022-07-01 09:02:29 +00:00
:::{tab-item} Apache2
:sync: apache2
2022-07-01 09:02:29 +00:00
```{code-block} sh
sudo tail -f /var/log/apache/access.log # Follow the access log
sudo tail -f /var/log/apache/error.log # Follow the error log
```
2022-07-01 09:02:29 +00:00
::::
2022-07-01 09:02:29 +00:00
- **API logs** – check these if you are having issues with the Funkwhale app, federation, or imports.
2022-07-01 09:02:29 +00:00
::::{tab-set}
2022-07-23 13:32:35 +00:00
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
```{code-block} sh
journalctl -xn -u funkwhale-server
```
2022-07-01 09:02:29 +00:00
:::
2022-07-01 09:02:29 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
```{code-block} sh
sudo docker compose logs -f --tail=50 api # Follow the last 50 messages
```
2022-07-01 09:02:29 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
- **Celery logs** – check these if a federation or import task isn't working.
2022-07-01 09:02:29 +00:00
::::{tab-set}
2022-07-23 13:32:35 +00:00
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
```{code-block} sh
journalctl -xn -u funkwhale-worker
```
2022-07-01 09:02:29 +00:00
:::
2022-07-01 09:02:29 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
```{code-block} sh
sudo docker compose logs -f --tail=50 celery # Follow the last 50 messages
```
2022-07-01 09:02:29 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
## Troubleshoot issues
### API issues
If the API isn't serving audio files, try the following:
- If youre using Docker, check you have commented out the `MEDIA_ROOT` variable in your `.env` file.
- Check the `_protected/media` block in your webserver points to your media path. This is `/srv/funkwhale/data/media` by default.
- If youre using the in-place import, check you have configured your media paths. Check the `MUSIC_DIRECTORY_PATH`, `MUSIC_DIRECTORY_SERVE_PATH` and `REVERSE_PROXY_TYPE` variables in your `.env` file. Make sure the webserver can read these directories.
2022-07-01 09:02:29 +00:00
### Import issues
If you're having issues importing files, try the following:
- Check that the file is encoded in a supported format
2022-07-23 13:32:35 +00:00
:::{dropdown} Supported formats
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
- flac
- ogg
- mp3
- opus
- aac
- m4a
- aiff
- aif
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
- Make sure your files play in another media player.
- Make sure your files are [tagged correctly](../../user/libraries/content/tag.md).
2022-07-01 09:02:29 +00:00
- Check the Celery logs for errors during the import.
### Federation issues
If you are having issues accessing federated content, try the following:
- Check that the remote library received your follow request and approved it.
- Trigger a library scan in the Funkwhale frontend.
- Check the Celery logs for errors during the scan.
### Memory tracing
If your Funkwhale server uses more memory than expected, you can check the footprint of requests. This requires a middleware to check memory allocation. To set up this middleware:
1. Add the middleware to your `.env` file.
2022-10-26 20:19:16 +00:00
```{code-block} text
2022-07-01 09:02:29 +00:00
ADDITIONAL_MIDDLEWARES_BEFORE=funkwhale_api.common.middleware.PymallocMiddleware
```
2. Enable memory tracing in your `.env` file.
2022-10-26 20:19:16 +00:00
```{code-block} text
2022-07-01 09:02:29 +00:00
PYTHONTRACEMALLOC=1
```
3. Restart your Funkwhale server.
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
2022-07-01 09:02:29 +00:00
sudo systemctl restart funkwhale.target
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose restart
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
The middleware prints out the top 25 memory allocations to the API logs. You can use these to see what requests use the most memory.
To disable memory tracing:
1. Remove the middleware from your `.env` file.
2022-10-26 20:19:16 +00:00
```{code-block} text
2022-07-01 09:02:29 +00:00
# ADDITIONAL_MIDDLEWARES_BEFORE=funkwhale_api.common.middleware.PymallocMiddleware
```
2. Disable memory tracing in your `.env` file.
2022-10-26 20:19:16 +00:00
```{code-block} text
2022-07-01 09:02:29 +00:00
PYTHONTRACEMALLOC=0
```
3. Restart your Funkwhale server.
2022-07-23 13:32:35 +00:00
::::{tab-set}
:::{tab-item} Debian
:sync: debian
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
2022-07-01 09:02:29 +00:00
sudo systemctl restart funkwhale.target
```
2022-07-23 13:32:35 +00:00
:::
2022-07-01 09:02:29 +00:00
2022-07-23 13:32:35 +00:00
:::{tab-item} Docker
:sync: docker
2022-07-01 09:02:29 +00:00
2022-10-26 20:19:16 +00:00
```{code-block} sh
sudo docker compose restart
2022-07-01 09:02:29 +00:00
```
2022-07-23 13:32:35 +00:00
:::
::::
2022-07-01 09:02:29 +00:00
## Get help
If you can't solve the issue yourself, ask the community for help. Check out the [get help](help.md) guide for information about where to ask your question and what details to provide.