From 797d5b4e365840016c1087ef9a7a48d320ed9007 Mon Sep 17 00:00:00 2001 From: Pieter Date: Thu, 8 Jan 2026 17:45:59 +0100 Subject: [PATCH] fix: Clear Nextcloud log after initial maintenance repairs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During initial deployment, background jobs may fail temporarily while the system is still initializing (e.g., theming migration looking for directories that don't exist yet). These errors are harmless and resolve on subsequent cron runs, but they appear in the admin panel logs causing unnecessary concern. Solution: Clear the log file after running maintenance repairs to remove any transient initialization errors. Fixes admin panel showing "2 errors in the logs" after fresh deployment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- ansible/roles/nextcloud/tasks/install.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ansible/roles/nextcloud/tasks/install.yml b/ansible/roles/nextcloud/tasks/install.yml index 5152e36..70b995a 100644 --- a/ansible/roles/nextcloud/tasks/install.yml +++ b/ansible/roles/nextcloud/tasks/install.yml @@ -62,3 +62,9 @@ failed_when: false async: 600 poll: 10 + +- name: Clear any initial background job errors from log + shell: | + docker exec nextcloud truncate -s 0 /var/www/html/data/nextcloud.log + when: maintenance_repair.changed + changed_when: false