After moving my self-hosted HumHub from the old humhub/humhub-dev:master image to the official humhub/humhub:stable image (HumHub 1.19, FrankenPHP, PHP 8.4), two things broke: the “update all modules” button and the ONLYOFFICE integration. Both are fixed now, and this post walks through every step it took.
The setup:
- HumHub runs via Docker Compose in its own LXC, with
/databind-mounted from./humhub-data-v2on the host. - ONLYOFFICE Document Server (with PostgreSQL and RabbitMQ) runs via Docker Compose in a separate LXC.
- Both sit behind NPMplus as a reverse proxy, each with its own subdomain.
The symptoms:
- Clicking “Alle aktualisieren” in the module overview returned
Während der letzten Aktion ist ein Fehler aufgetreten. (Handler not found). - Opening any office document returned
Ein unerwarteter Serverfehler ist aufgetreten.
The ONLYOFFICE fix turned out to be four separate problems stacked on top of each other. Each one only became visible after the previous one was fixed.
Part 1: “Handler not found” when updating modules
“Handler not found” is a frontend error: the browser can’t find the JavaScript action behind the button. After a big version jump (1.18 brought the move to Bootstrap 5), stale assets are the usual suspect. Instead of fighting the button, I updated the modules from the command line.
The console lives at /opt/humhub/protected/yii in the official image, not relative to the working directory. I found it with:
|
1 |
docker compose exec humhub sh -c 'find / -name yii -path "*protected*" -not -path "/proc/*" 2>/dev/null' |
The update command is module/update-all (not marketplace/update-all):
|
1 2 |
docker compose exec humhub php /opt/humhub/protected/yii module/update-all docker compose exec humhub php /opt/humhub/protected/yii cache/flush-all |
That updated seven modules and ran their migrations.
Watch the file ownership
docker compose exec runs as root by default. In this image the marketplace modules live in /data/modules, and the freshly updated folders now belonged to 0:0 while everything else belonged to 33:33 (www-data). That would break later updates from the web UI, so I reset it:
|
1 |
docker compose exec humhub chown -R 33:33 /data/modules |
For future CLI updates, run as www-data from the start:
|
1 |
docker compose exec -u 33 humhub php /opt/humhub/protected/yii module/update-all |
A quick docker inspect confirmed that /data is a bind mount of /opt/stacks/humhub/humhub-data-v2, so modules, uploads and config all survive container recreation.
Part 2: ONLYOFFICE throws a 500 error
The browser only showed HumHub’s generic error page, so the first step was the application log at /data/logs/app.log. This filter skips the noisy [file] entries and shows the newest real exception:
|
1 |
docker compose exec humhub sh -c 'grep -n -E "\]\[error\]\[[^f]" /data/logs/app.log | tail -n 1' |
The culprit:
|
1 2 |
yii\base\UnknownMethodException: Calling unknown method: humhub\modules\file\models\File::canRead() |
The installed ONLYOFFICE module was version 3.3.0 and called an API that no longer exists in HumHub 1.19.
Upgrading the module by hand
module/update onlyoffice reported “No compatible version found online”. The marketplace lists the module as compatible with HumHub up to 1.18, so a 1.19 instance isn’t offered anything. Version 4.0.0 is available on GitHub, so I installed it manually:
|
1 2 3 4 5 6 7 |
cd /opt/stacks/humhub wget -O /tmp/onlyoffice-4.0.0.zip https://github.com/ONLYOFFICE/onlyoffice-humhub/releases/download/v4.0.0/onlyoffice.zip unzip -q /tmp/onlyoffice-4.0.0.zip -d /tmp/oo mv humhub-data-v2/modules/onlyoffice ./onlyoffice-3.3.0.bak mv /tmp/oo/onlyoffice humhub-data-v2/modules/onlyoffice chown -R 33:33 humhub-data-v2/modules/onlyoffice docker compose exec -u 33 humhub php /opt/humhub/protected/yii migrate/up --includeModuleMigrations=1 --interactive=0 |
The module settings (Document Server URL, JWT secret) are stored in the database and survived the swap.
Patching 4.0.0 for HumHub 1.19
4.0.0 still called canRead(). In 1.19 the permission check is canView():
|
1 2 |
M=humhub-data-v2/modules/onlyoffice sed -i 's/->canRead(/->canView(/g' $M/controllers/ApiController.php $M/components/BaseFileController.php |
The next error was Getting unknown property: File::fileName. The real column is file_name. Careful here: models/CreateDocument.php has its own fileName form field that must not be renamed, so I only touched calls on File objects:
|
1 |
sed -i 's/file->fileName/file->file_name/g' $M/widgets/EditorWidget.php $M/widgets/ConvertWidget.php $M/widgets/views/convert.php |
Important: FrankenPHP keeps PHP code in memory. After every patch, run docker compose restart humhub, otherwise you keep seeing the old error.
Part 3: “office.example.com hat die Verbindung abgelehnt”
With the PHP errors gone, the editor dialog opened but stayed blank, and the frame showed “refused to connect”. In Chromium browsers that message inside an iframe usually means the embedded site forbids being framed, not that the server is down.
The headers confirmed it:
|
1 2 |
curl -sI https://office.example.com/ | grep -iE "x-frame-options|content-security-policy" # x-frame-options: SAMEORIGIN |
HumHub and ONLYOFFICE run on different subdomains, so SAMEORIGIN blocks the embed. Asking the Document Server directly (curl -sI http://<documentserver-ip>/) returned no such header, so NPMplus was adding it.
The fix went into NPMplus, under the proxy host for the office subdomain, then Advanced, then Custom Nginx Configuration:
|
1 2 |
more_clear_headers X-Frame-Options; add_header Content-Security-Policy "frame-ancestors 'self' https://humhub.example.com" always; |
The X-Frame-Options header still showed up afterwards, because NPMplus sets it at location level. It didn’t matter: modern browsers ignore X-Frame-Options when a CSP frame-ancestors directive is present. As a bonus, only my HumHub is now allowed to embed the editor.
Part 4: “Herunterladen ist fehlgeschlagen”
Now the editor loaded, then failed with “download failed”. The Document Server log on the ONLYOFFICE LXC showed why:
|
1 2 |
tail -n 40 ./logs/documentserver/docservice/out.log | grep -iE "error|download|ECONN|status" # error downloadFile:url=http://<humhub-ip>:8404/onlyoffice/backend/download?... Request failed with status code 500 |
So the network path between the two LXCs worked, but HumHub answered with a 500. Its log showed:
|
1 |
fopen(file/2/6/26bc840a-.../file): Failed to open stream: No such file or directory |
The file existed at /data/uploads/file/2/6/.../file, and the uploads symlink and aliases were correct. The giveaway was the relative path. In HumHub 1.19, StorageManager::get() returns a path relative to the storage, and contents are meant to be read via getContentStream() or getContent(). A quick look at the core class confirmed it:
|
1 |
docker compose exec humhub sh -c 'grep -nE "public function" /opt/humhub/protected/humhub/modules/file/components/StorageManager.php' |
The module still passed store->get() straight to PHP file functions in two places. Both got patched:
|
1 2 3 |
sed -i 's/sendFile(\$this->file->store->get(), /sendStreamAsFile($this->file->store->getContentStream(), /' $M/controllers/BackendController.php sed -i 's/file_get_contents(\$file->store->get(), false, null, 0, \$limitDetect)/stream_get_contents($file->store->getContentStream(), $limitDetect)/' $M/Module.php docker compose restart humhub |
After the restart, documents opened, edits saved, and the changes were still there after reopening.
Lessons learned
- Read the log, not the browser. HumHub’s generic “unexpected server error” hides everything.
/data/logs/app.lognames the exact file and line every time. - Fix one layer at a time. Each fix revealed the next problem: PHP API changes, then a proxy header, then the storage API. None of them were visible while the previous one was still there.
- Restart FrankenPHP after code changes. Without a restart, patched PHP files have no effect.
- Run CLI commands as the web user (
-u 33), so you don’t leave root-owned files in/data. - Marketplace compatibility is a hard filter. A module listed as “up to 1.18” simply won’t be offered on 1.19, even if a newer version exists.
Caveats
These are local patches to ONLYOFFICE 4.0.0. Reinstalling or updating the module overwrites them. Once ONLYOFFICE ships a release that supports HumHub 1.19, it should appear in the marketplace and replace this workaround.
Other old modules may hit the same store->get() change. This lists candidates:
|
1 |
grep -rln "store->get()" humhub-data-v2/modules --include=*.php |