YunoHost-Apps / pixelfed_ynh

The federated image shareing service Pixelfed for YunoHost
https://pixelfed.org/
GNU Affero General Public License v3.0
43 stars 15 forks source link

Picture not available when posting, the return (packaging v2) #223

Closed lapineige closed 10 months ago

lapineige commented 1 year ago

211 continuation as the change to packaging v2 #220 broke it.

lapineige commented 1 year ago

ping @sekretaerbaer (https://github.com/pixelfed/pixelfed/issues/4275#issuecomment-1595938629) I merged a change that should restore a working condition to files with the issues (once the PR is merged to master): https://github.com/YunoHost-Apps/pixelfed_ynh/pull/224/commits/013c3d60f4cbda04c5c609f673c1396ff916da86

This will reset your filsystems.php, for good : it avoids giving too much access rights to this files while restoring a working state :)

ping @webmink, once this is closed by merging #224 you will have a proper working version :)

webmink commented 1 year ago

It will be a delight :-) Currently having to use Flickr for blog illustrations... Thanks so much.

lapineige commented 1 year ago

I worked in my case. If you can use the command line, you can try it. If not, I'm probably merging this today :)

webmink commented 1 year ago

I'll wait for the merge, too much going on to go hack the server until about Tuesday

lapineige commented 1 year ago

Merged :)

Jaxom99 commented 10 months ago

I encountered this error, as described in #211 . It's on a new install of the app on a fresh server. I did not find how to fix it on the thread, apart from upgrades... What data can I provide ? ping @lapineige

ln my case, there was a failed restore of the same app from another server (from mid-august, so same version I guess ?) just before (it was well handed by ynh, I have logs if needed). And when encountering the bug, I removed and reinstalled the app (via ynh) but that changed nothing. => Maybe on these operations, some files are not removed, and so I'm not on last version everywhere ? Where should I look to correct that ?

lapineige commented 10 months ago

Can you follow this and share the results ? https://forum.yunohost.org/t/pixelfed-0-11-9-instagram-import-no-preview-after-import/26071/4

I can provide more detailed instructions. Basically the issue is that the images have incorrect file permissions.

Jaxom99 commented 10 months ago

Thanks. Here are the results :

[pixelfed]

user = pixelfed group = pixelfed

chdir = /var/www/pixelfed

listen = /var/run/php/php8.2-fpm-pixelfed.sock listen.owner = www-data listen.group = www-data

pm = ondemand pm.max_children = 24 pm.max_requests = 500 request_terminate_timeout = 1d

pm.process_idle_timeout = 10s

; Additional php.ini defines, specific to this pool of workers.

php_admin_value[upload_max_filesize] = 100M php_admin_value[post_max_size] = 100M

; Group should not be pixelfed, unless image (folder) access rights are not working group = www-data

Jaxom99 commented 10 months ago

Just tested the branch with yunohost app upgrade pixelfed -u https://github.com/YunoHost-Apps/pixelfed_ynh/tree/fix_php_conf_image-permissions, and it's so weird : it made the previous post OK, but a new one is in the same "no preview" state. See screencap : https://pic.infini.fr/gallery#WvnDhSXo/hhynm955.png

Also folder state :

oc:/var/www/pixelfed/public/storage/m/_v2/601716093526560769/c51ea9690-856390# ls -lah
total 20K
drwxr-x--- 5 pixelfed www-data 4.0K Aug 31 08:17 .
drwxrwx--- 3 pixelfed www-data 4.0K Aug 28 10:06 ..
drwxr-x--- 2 pixelfed pixelfed 4.0K Aug 31 08:17 GymuhRTWfBIe
drwxr-x--- 2 pixelfed www-data 4.0K Aug 28 12:27 krfiZNpivCpu
drwxr-x--- 2 pixelfed www-data 4.0K Aug 28 13:05 Qbe51HU0U7u1

new post :

ls -lah GymuhRTWfBIe/
total 200K
drwxr-x--- 2 pixelfed pixelfed 4.0K Aug 31 08:17 .
drwxr-x--- 5 pixelfed www-data 4.0K Aug 31 08:17 ..
-rw-r--r-- 1 pixelfed pixelfed 157K Aug 31 08:17 DLnLoFC8PI3jfErTHGwfzNFAUaNjYNw0KdSL5PuS.jpg
-rw-r--r-- 1 pixelfed pixelfed  31K Aug 31 08:17 DLnLoFC8PI3jfErTHGwfzNFAUaNjYNw0KdSL5PuS_thumb.jpg

old post :

ls -lah krfiZNpivCpu/
total 240K
drwxr-x--- 2 pixelfed www-data 4.0K Aug 28 12:27 .
drwxr-x--- 5 pixelfed www-data 4.0K Aug 31 08:17 ..
-rwxr-x--- 1 pixelfed www-data 171K Aug 28 12:27 YryRfx2Q7gdQcyq0oVW1i7dTd32qVfLeVTb3kEmY.jpg
-rwxr-x--- 1 pixelfed www-data  57K Aug 28 12:27 YryRfx2Q7gdQcyq0oVW1i7dTd32qVfLeVTb3kEmY_thumb.jpg

:crossed_fingers:

lapineige commented 10 months ago

it made the previous post OK

This is expected: https://github.com/YunoHost-Apps/pixelfed_ynh/blob/master/scripts/upgrade#L160 We fix the rights on every upgrade, just in case (it can't do any harm).

but a new one is in the same "no preview" state

So it was buggy after all… I might have fixed mine and forgot it.

Can you show me the content of /etc/php/8.2/fpm/pool.d/pixelfed.conf ?

Jaxom99 commented 10 months ago
oc:/home/testadmin# cat /etc/php/8.2/fpm/pool.d/pixelfed.conf 

[pixelfed]

user = pixelfed
group = pixelfed

chdir = /var/www/pixelfed

listen = /var/run/php/php8.2-fpm-pixelfed.sock
listen.owner = www-data
listen.group = www-data

pm = ondemand
pm.max_children = 24
pm.max_requests = 500
request_terminate_timeout = 1d

pm.process_idle_timeout = 10s

:scream: and yet, it was updated indeed :

ls -lah /etc/php/8.2/fpm/pool.d/pixelfed.conf 
-r-------- 1 root root 291 Aug 31 07:49 /etc/php/8.2/fpm/pool.d/pixelfed.conf
lapineige commented 10 months ago

Change group = pixelfed to group = www-data to fix it. (or don't, to test if a future fix solves it. In the midtime, a simple chown -R :www-data /brokenPictureFolder could fix it)

I don't understand why it's not applied : https://github.com/YunoHost-Apps/pixelfed_ynh/blob/fix_php_conf_image-permissions/conf/php-fpm.conf#L5