IMipPlugin.php core patch is not persisted — silently reverts on any image bump or container recreate #2
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Calendar invites on office.bcos.cloud are sent from the organizer's own SMTP account (rather than
the system
invitations-noreplyaddress) only because a core Nextcloud file is hand-patched insidethe running container:
/var/www/html/apps/dav/lib/CalDAV/Schedule/IMipPlugin.phpThis patch exists nowhere except the live container filesystem — not in a Docker image, not in
hiveiq-openmetal/hiveops/instances/bcos-office/, not in this repo.Why this is a problem
Any of the following silently reverts it:
nextcloud:29-apache-> anything newer)docker compose up -d --force-recreate bcos-officeocc upgrade/ an app store update that reinstallsdavThe failure is silent and easy to misread: invites keep working, they just quietly start arriving
from the noreply address again. Nobody gets an error. We only notice when someone asks "why does the
invite come from noreply?" — or, worse, we re-apply a half-remembered version of the patch and
reintroduce a fatal (which is exactly what happened, see below).
History — why this is worth doing properly
IMipPlugin.phppatched in-container to send via the organizer's mail account.The patch called
$result->fetchAssociative()— a Doctrine DBAL method that does not exist onNextcloud's
OC\DB\ResultAdapter. It raised\Error, which the surroundingcatch (\Exception)does not catch (separate
\Throwablebranch), so the fatal escaped and killed the CalDAVPUT.Result: every event with any attendee failed to save, for every user, with the Calendar
UI's generic "Failed to save event". Undiagnosed for two weeks.
fetch()+is_array()guard +catch (\Throwable)).Verified: CalDAV PUT with attendee -> HTTP 201; bcos-mail logs
from=<organizer> status=sent;external delivery confirmed by a real recipient.
An unversioned patch to a core file, with no review and no test, cost us two weeks of broken calendar
invites. It needs to live somewhere that gets reviewed and survives a rebuild.
Proposed fix
Pick one:
/docker-entrypoint-hooks.d/before-starting/*on every container start. Drop the patch in as a script there, mounted from
hiveiq-openmetal/hiveops/instances/bcos-office/, and make it idempotent (detect already-patched,and hard-fail loudly if the upstream file's shape changed rather than patching blindly).
FROM nextcloud:29-apache+COPY/patchthe file, build and pin the tag.Heavier, but the patch is then reviewable in git and versioned with the image.
supported config (
occ config:app:set dav ..., mail app settings, or a small proper Nextcloud appimplementing the scheduling hook) so we stop editing core at all. Cleanest, most work.
Recommendation: 1 now (cheap, stops the silent revert), 3 as the real answer when there's room.
Whichever we pick, the patch content must be committed to this repo so it is reviewable and
re-appliable, and
docs/should note that core is patched.Acceptance criteria
bcos/bcos-office(not just living in the container)docker compose up -d --force-recreate bcos-officeleaves invites still sending from the organizer's addressIMipPlugin.phpchanges shapeapps/davis patchedReference
IMipPlugin.php.bak-20260713-preclaude(same directory)data/nextcloud.log(level>=3); "Failed to save event" is a frontend catch-allSuperseded by hiveiq-ops/hiveiq-devops#38 — hiveiq-ops/hiveiq-devops#38
Filed here by mistake. This is deployment/infra work:
bcos/bcos-officeis an empty repo, while the office stack config actually lives inhiveiq-openmetal-prod/hiveops/instances/bcos-office/and infra issues are tracked inhiveiq-devops.@johannes — please close this one in the UI.