Euro Office 1.1.4 (DocumentServer 9.3.8): saving to Nextcloud fails, output files are created 0640 and nginx returns 403
-
After the automatic update to 1.1.4 (DocumentServer 9.3.8) last night, saving documents back to Nextcloud no longer works. The app stays
healthyand/healthcheckreturnstrue, so nothing in the dashboard shows it. I rolled back to 1.1.3 from the pre-update backup and everything works again.Symptom
The connector check in Nextcloud fails:
occ eurooffice:documentserver --check Error connection: Client error: `GET http://<app-id>/cache/files/data/conv_check_435581786_65/output.docx/check_435581786.docx?md5=…&expires=…&filename=check_435581786.docx` resulted in a `403 Forbidden` responseThe same
/cache/files/...route is what Nextcloud uses to fetch the edited document on every save, so real saves fail the same way.Cause
Since 9.3.8 the document server writes its output files with mode 0640 instead of 0644. nginx runs as
www-dataand can no longer read them:[error] open() "/var/lib/euro-office/documentserver/App_Data/cache/files/data/conv_check_549698124_65/output.docx" failed (13: Permission denied) # before the update (1.1.3) -rw-r--r-- 1 ds ds 8221 Nov 14 08:05 output.docx # after the update (1.1.4) -rw-r----- 1 ds ds 8154 Nov 15 08:22 output.docxThe directories are still
drwxr-xr-x ds:ds; only the files changed. In the access log the switch is exact: last200on/cache/filesat 00:50 UTC, the update at 01:01, first403at 01:10, and only 403s after that.What I ruled out
- Not the
secure_linksecret: both nginx and the document server use the defaultverysecretstring, and I recomputed the signature of a rejected URL (base64url(md5(expires + uri + secret))); it matches. - Not the umask: the
docserviceandconverterprocesses run with umask0022, so the 0640 seems to be set explicitly in the new code (my guess is the output writer incore/x2t; 9.3.8 changed ZIP writing incore#289, but I did not find the exact line).
Workaround
Restore the app from the backup Cloudron made just before the update (it rolls the package back to 1.1.3) and turn off automatic updates for the app until this is fixed. After the restore new files are
0644again and the connector check passes. Addingwww-datato thedsgroup inside the container would also work, but that is lost on every restart.Suggestion
It would help if the package's health check (or a test in the package) did what the connector's
--checkdoes: convert a document and fetch the result through nginx. That would have caught this before release, because/healthcheckstays green.Cloudron 10.1.6, Nextcloud 35.0.2 with the
euroofficeconnector 11.0.6, Euro Office 1.1.3 → 1.1.4. - Not the
-
-
-
Hello,
we hit the same failure on one of our instances (package
1.1.4/ DocumentServer9.3.8.37, Nextcloud35.0.3, connector11.0.6) and your analysis matched what we saw. We also recomputed thesecure_linksignature of a rejected URL and it was valid.Two additions that may be useful:
- Adding
www-datato thedsgroup was not possible for us: the container root file system is read-only (usermod→ "cannot lock /etc/passwd"). Only/tmp,/runand/app/dataare writable. - What helped us instead was an ACL entry
u:www-data:r-x, as default ACL on/tmpand on.../App_Data/cache/files/data, plus once recursively for the files already there. New files created in/tmppick the entry up automatically, and since it is stored with the file itself it also survived the rename into the cache for us. Owner and mode of the files stay unchanged. (setfaclwas not installed in our image, so we set the ACL attribute directly.)
After that
/cache/files/...returned 200 instead of 403 for us,occ eurooffice:documentserver --checkreports "successfully connected", and opening and editing docx and xlsx works again. Because/tmpand/app/dataare persistent volumes, we expect it to survive restarts as well. We have not been through an app update with it yet, so we kept it as a stopgap and kept the connector's cron check as our alarm, which mails the admins as soon as the check fails again. Whoever prefers to stay on an unchanged package can also restore the pre-update backup instead, but then auto updates for the app should stay off. - Adding
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login