This repository has been archived on 2024-01-30. You can view files and clone it, but cannot push or open issues or pull requests.
docs/content/services/hedgedoc.md

70 lines
2.3 KiB
Markdown
Raw Normal View History

+++
2022-01-06 16:18:39 +00:00
title = "hedgedoc"
taxonomies.categories = [ "services" ]
+++
runs on: parsons
purpose: writing things down, collaboratively
configuration: [nixfile](https://gitlab.infra4future.de/infra/haccfiles/-/blob/main/services/hedgedoc-hacc.nix)
login: SSO via keycloak
### configuration details
* hegedoc was once called codiMD, so container, config and users are still called codimd.
**Do NOT change this** unless you're activly migrating the service (with container, database and all) to the new name.
Everything userfacing is already renamed.
* there is a second instance named **pad-i4f** running for embedding into nextcloud.
# Troubleshooting
## Basic
Usually if hedgedoc dies, it's because postgres wasn't ready yet and the translation layer dosen't understand the wait message. Just restart hedgedoc in the container:
```
sudo nixos-container root-login codimd
systemctl restart hedgedoc
```
Sometimes restarting nginx fixes the problem. To do so run:
```
sudo systemctl restart nginx
```
As a last basic step try restarting the container as a whole:
```
sudo systemctl restart container@codimd
```
### Advanced
log into the container and take a look at the logs
sudo nixos-container root-login codimd
journalctl -e
#### fixing failed database upgrades
In some cases, HedgeDoc might apply migrations without correctly saving the progress. In these cases, HedgeDoc will refuse to start with “already exists”-errors like ERROR: type "enum_Notes_permission" already exists.
Get the name of the failing migration and append .js to it. For example, if you encounter this error
== 20180306150303-fix-enum: migrating =======
ERROR: type "enum_Notes_permission" already exists
the name of the failed migration would be 20180306150303-fix-enum.js.
The SQL-statement may look like this:
INSERT INTO "SequelizeMeta" (name) VALUES ('20180306150303-fix-enum.js');
Make sure HedgeDoc does not run and insert the name into the SequelizeMeta table.
Enter the container switch to the postgres user, open psql and commect to the codimd dataase:
su postgres
psql
\l
\c codimd
[ RUN adjusted SQL STAMEMENT from above ]
\q
Start HedgeDoc again and observe if it starts correctly. It may be necessary to repeat this process and insert multiple migrations into the SequelizeMeta table.