What app is this about, and its version: Wallabag 2.6.14~ynh1
What YunoHost version are you running: 12.1.37
What type of hardware are you using: Old laptop or computer
Describe your issue
After upgrading Wallabag from 2.5.4, it was no more accessible: error 500. Apparently it was something with header corruption.
I managed to solve it somehow using chatgpt, pasting its summary below.
Share relevant logs or error messages
Wallabag returns 500 error after upgrade (Doctrine unserialize error)
TL;DR:
After upgrading Wallabag on YunoHost, the app may fail with a 500 error due to corrupted serialized data in the database (entry.headers / entry.published_by). The fix is to identify and NULL-out the broken rows.
Symptoms
After upgrading Wallabag, accessing /wallabag/ results in:
500 Internal Server Error
Could not convert database value to ‘array’
unserialize(): Error at offset X of Y bytes
The error happens while rendering the entries list (homepage).
Root cause
Some Wallabag database columns are defined as Doctrine type=“array” and stored as PHP-serialized strings.
In my case, the following columns contained corrupted serialized payloads:
entry.headers
entry.published_by
When Doctrine tries to hydrate Entry entities, unserialize() fails and throws a Doctrine\DBAL\Types\ConversionException, which crashes the page even though these fields are optional metadata.
This corruption likely predates the upgrade, but newer Wallabag / Doctrine versions are stricter and expose it.
How to diagnose
Run this on the server to detect broken rows (example for headers):
DB=wallabag2
mysql -N -e “SELECT id, headers FROM ${DB}.entry WHERE headers IS NOT NULL;”
| while IFS=$‘\t’ read -r id val; do
php -r ‘$v=$argv[1]; if (@unserialize($v)===false && $v!==“b:0;”) echo “BAD headers ID=$argv[2]\n”;’
“$val” “$id”
done
Repeat for published_by:
mysql -N -e “SELECT id, published_by FROM ${DB}.entry WHERE published_by IS NOT NULL;”
| while IFS=$‘\t’ read -r id val; do
php -r ‘$v=$argv[1]; if (@unserialize($v)===false && $v!==“b:0;”) echo “BAD published_by ID=$argv[2]\n”;’
“$val” “$id”
done
Fix (safe)
These fields are non-essential metadata, so the fix is simply to NULL them for the corrupted rows:
UPDATE entry SET headers = NULL WHERE id IN (…bad ids…);
UPDATE entry SET published_by = NULL WHERE id IN (…bad ids…);
After that:
sudo -u wallabag2 php /var/www/wallabag2/bin/console cache:clear --env=prod
systemctl reload php-fpm
systemctl reload nginx
Wallabag should load normally again.
YunoHost-specific note (important)
After the upgrade, Wallabag runs under a dedicated PHP-FPM pool user (wallabag2).
Make sure these directories are writable by that user:
/var/www/wallabag2/var/cache
/var/www/wallabag2/var/logs
Otherwise Wallabag may fail to boot with cache/log permission errors before anything is logged.
Possible upstream improvements
Migrate Doctrine array fields to JSON
Add defensive unserialization (fallback to NULL)
Add a migration or integrity check for legacy serialized fields