[pkg-php-pear] Bug#1029921: shaarli: Unable to fetch thumbnails, mkdir(): Permission denied

James Valleroy jvalleroy at mailbox.org
Sun Jan 29 00:32:52 GMT 2023


Package: shaarli
Version: 0.12.1+dfsg-7
Severity: normal
X-Debbugs-Cc: jvalleroy at mailbox.org

This issue was first opened at upstream issue tracker, but it only applies to the Debian package:

https://github.com/shaarli/Shaarli/issues/1911

It was also reported as an issue in FreedomBox:

https://salsa.debian.org/freedombox-team/freedombox/-/issues/2299

With debugging enabled, the error is shown in the Apache journal:

"GET /shaarli/admin/thumbnails HTTP/2.0" 200 2571 "https://localhost:4430/shaarli/admin/configure"
[proxy_fcgi:error] [pid 17352:tid 17399] [client 10.0.2.2:38818] AH01071: Got error 'PHP message: ErrorException: mkdir(): Permission denied', referer https://localhost:4430/shaarli/admin/thumbnails

Shaarli uses php-arthurhoaro-web-thumbnailer, with the configuration in /usr/share/shaarli/inc/web-thumbnailer.json.
This has the cache path set to "cache/", so it is trying to create a folder "cache" in /usr/share/shaarli.

Here are some things I tried, in order to fix it:

# ln -s /var/cache/shaarli/cache/ /usr/share/shaarli/cache

Then in the journal I see:

"GET /shaarli/admin/thumbnails HTTP/2.0" 200 2571 "https://localhost:4430/shaarli/admin/configure"
"PATCH /shaarli/admin/shaare/0/update-thumbnail HTTP/2.0" 200 1698 "https://localhost:4430/shaarli/admin/thumbnails"
[core:alert] [pid 17352:tid 17399] [client 10.0.2.2:46634] /usr/share/shaarli/cache/thumb/.htaccess: Require not allowed here, referer https://localhost:4430/shaarli/admin/thumbnails
"GET /shaarli/cache/thumb/14dd5266c70789bdc806364df4586335/7fb845c39d194747d128e9e70664a2ca05d881ae125901.jpg HTTP/2.0" 500 743 "https://localhost:4430/shaarli/admin/thumbnails"

I tried deleting .htaccess, but it gets re-written each time.

What I can do instead, it remove all the contents of .htaccess, and then the thumbnails are working ok.
Next step: I will check if I can do this in the package build.



More information about the pkg-php-pear mailing list