diff --git a/nextcloud/readme.md b/nextcloud/readme.md index 9cdc587..d50de65 100644 --- a/nextcloud/readme.md +++ b/nextcloud/readme.md @@ -262,6 +262,12 @@ systemctl --user reset-failed nextcloud.service ## Notes and gotchas +- **The environment file is state, and it lives inside the webroot.** So is the + code, `config.php` and `data/`. Removing `~/podman-data/nextcloud` therefore + leaves a unit that cannot start — `parsing file .../nextcloud.env: no such file + or directory`, exit status 125 — and because the generated unit is + `WantedBy=default.target` it will also fail that way at boot. Re-run the playbook: + it recreates the directory, the environment file and the container. - **`activating` is not a healthy state.** A crash-looping container spends its time `activating` between restarts, so the play waits on `status.php` rather than on `is-active`, and reports the journal on failure. diff --git a/nextcloud/roles/nextcloud/tasks/main.yaml b/nextcloud/roles/nextcloud/tasks/main.yaml index 3b1459c..dc2ccd2 100644 --- a/nextcloud/roles/nextcloud/tasks/main.yaml +++ b/nextcloud/roles/nextcloud/tasks/main.yaml @@ -89,9 +89,13 @@ - name: Fail ansible.builtin.fail: msg: >- - Nextcloud is not serving — see the diagnostics above. A "Permission - denied" under /usr/local/etc/php/conf.d, anything about `db` or `redis`, - and "downgrading is not supported" each point somewhere different. + Nextcloud is not serving — the reason is in the diagnostics above. + `no such file or directory` for nextcloud.env or a path under + /var/www/html means this host's webroot was removed without re-running + this play, and anything about `db`, `redis` or "downgrading is not + supported" points at the database, the cache or the image instead. If + the unit is in the `failed` state from an earlier attempt: + systemctl --user reset-failed {{ unit_name }} # Nextcloud wants `cron.php` every five minutes. This has to be *this user's* # crontab, not root's: root cannot `podman exec` into another user's rootless