pixelfed / pixelfed

Photo Sharing. For Everyone.
https://pixelfed.org
GNU Affero General Public License v3.0
5.66k stars 680 forks source link

Picture display broken after upgrade to v0.11.5 : folder rights issue #4275

Open lapineige opened 1 year ago

lapineige commented 1 year ago

Hello,

On Yunohost installations, since version 0.11.5 new uploaded pictures are broken. They are not shown, neither the preview is. Even in compose view. Alternative text is working. I don't really know how to debug this. No horizon failed job, no supervisor issue, I can't find laravel log, no web console error… No other error to report. You can see an example here : https://photo.lapineige.fr/i/web/post/548580903387685397

Is that a know Pixelfed bug ? How can I diagnose this ?

Thank you


Pixelfed : 0.11.5 Postgres: 13.9 PHP: 8.1 - recently upgraded, before Pixelfed 0.11.5 we were using php 8.0 Laravel : 9.52.4

lapineige commented 1 year ago

I upgraded to Pixelfed 0.11.7, no change.

(Off-topic : I also noticed federation issues with Calckey, but it's unclear where it's coming from)

mitexleo commented 1 year ago

I upgraded to Pixelfed 0.11.7, no change.

(Off-topic : I also noticed federation issues with Calckey, but it's unclear where it's coming from)

It's a known issue. Calckey serves images without extension.

lapineige commented 1 year ago

To be precise, it's on the reading side. I can't search and load one of my Pixelfed posts. Are we talking of the same thing ?

webmink commented 1 year ago

Just to say my site is now working as expected after the upgrade to 0.11.7 via Yunohost.

lapineige commented 1 year ago

Including from other fediverse software (Mastodon,…) ?

lapineige commented 1 year ago

For my part the issue is completely solved by the v0.11.8 upgrade (I believe) for newer posts. Older ones remains not loaded from Mastodon (and working fine in Pixelfed). I'm unsure if it's an instance caching issue or a Pixelfed error.

As a result, I will close this.

Thanks everyone for your help ! (big up @neonota :green_heart:)

webmink commented 1 year ago

Yes, this post https://pix.webm.ink/p/webmink/568743143958536587 is visible in Mastodon and Fedilab (both vianown and other account) and external images are showing fine.

S.

On Mon, 29 May 2023, 14:14 lapineige, @.***> wrote:

Including from other fediverse software (Mastodon,…) ?

— Reply to this email directly, view it on GitHub https://github.com/pixelfed/pixelfed/issues/4275#issuecomment-1567127759, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKOFE5SUH5NZMQYPVH4LY3XISOLVANCNFSM6AAAAAAWRYKTAY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

lapineige commented 1 year ago

Ok, that's strange, it wasn't working on my side. Well, anyway, it's up and running now ! :D

lapineige commented 1 year ago

Tested on a new post (https://photo.lapineige.fr/i/web/post/572868822035539357), still broken (again ?) from Mastodon sadly :(

sekretaerbaer commented 1 year ago

works for me also to Mastodon

lapineige commented 1 year ago

Can you share the image (and its folder) rights and owners ? (I can provide instructions)

sekretaerbaer commented 1 year ago
namei -om /var/www/pixelfed/storage/app/public/m/_v2/436733357485973505/186f813ba-297a89/roz8VYElyVvd/HOLZErvRl3NCInhEZDwxFLL3ptjzUJoL9BmV8Ls7.jpg
f: /var/www/pixelfed/storage/app/public/m/_v2/436733357485973505/186f813ba-297a89/roz8VYElyVvd/HOLZErvRl3NCInhEZDwxFLL3ptjzUJoL9BmV8Ls7.jpg
 drwxr-xr-x root     root     /
 drwxr-xr-x root     root     var
 drwxr-xr-x root     root     www
 drwxr-x--- pixelfed www-data pixelfed
 drwxrwx--- pixelfed www-data storage
 drwxrwx--- pixelfed www-data app
 drwxrwx--- pixelfed www-data public
 drwxrwx--- pixelfed www-data m
 drwxrwx--- pixelfed www-data _v2
 drwxrwx--- pixelfed www-data 436733357485973505
 drwxr-x--- pixelfed www-data 186f813ba-297a89
 drwxr-x--- pixelfed www-data roz8VYElyVvd
 -rw-r--r-- pixelfed pixelfed HOLZErvRl3NCInhEZDwxFLL3ptjzUJoL9BmV8Ls7.jpg
lapineige commented 1 year ago

Thanks ! So in my case rights are identical except for the jpg : -rwxr-x--- So 750 for me, and 644 for you. I tried to change it to 644, no luck, still not working :(

Is it a newly installed instance (post v0.11.7) ?

sekretaerbaer commented 1 year ago

Version: 0.11.8-ynh1 not reinstalled but since 0.11.3-ynh1 only always updated

sekretaerbaer commented 1 year ago

just made an update to version: 0.11.8-ynh2 and now I also have the error.

namei -om /var/www/pixelfed/storage/app/public/m/_v2/436733357485973505/186f813ba-297a89/aYcYVqIp6OxU/P9GvsPp8WpI9aB8f6xKNiktjYXl5FzZJaeBiiUkr.jpg
f: /var/www/pixelfed/storage/app/public/m/_v2/436733357485973505/186f813ba-297a89/aYcYVqIp6OxU/P9GvsPp8WpI9aB8f6xKNiktjYXl5FzZJaeBiiUkr.jpg
 drwxr-xr-x root     root     /
 drwxr-xr-x root     root     var
 drwxr-xr-x root     root     www
 drwxr-x--- pixelfed www-data pixelfed
 drwxrwx--- pixelfed www-data storage
 drwxrwx--- pixelfed www-data app
 drwxrwx--- pixelfed www-data public
 drwxrwx--- pixelfed www-data m
 drwxrwx--- pixelfed www-data _v2
 drwxrwx--- pixelfed www-data 436733357485973505
 drwxr-x--- pixelfed www-data 186f813ba-297a89
 drwxr-x--- pixelfed www-data aYcYVqIp6OxU
 -rwxr-x--- pixelfed www-data P9GvsPp8WpI9aB8f6xKNiktjYXl5FzZJaeBiiUkr.jpg
sekretaerbaer commented 1 year ago

Backup back to version: 0.11.8-ynh1. Now also here the error. After I did sudo chmod -R ug=rwX,o=rX /var/www/pixelfed/storage/app/public/ everything works as it should.

lapineige commented 1 year ago

That's is realllllly strange 🤔

I don't understand why you didn't have the issue but have it since the upgrade. The only thing it touches here is making theses folders rights equals to 750 🤔

Could you explain what this does ? (what's the equivalent XXX rights ?)

ug=rwX,o=rX

sekretaerbaer commented 1 year ago

I can't explain it either.

I have the command from here

https://github.com/YunoHost-Apps/pixelfed_ynh/issues/211#issuecomment-1534965643

and it also seems to work only with version: 0.11.8-ynh1

lapineige commented 1 year ago

You mean it doesn't work with another version ? Which one ?

sekretaerbaer commented 1 year ago

I just tested it with Version 0.11.8-ynh3. I noticed that new images / directories user / group pixelfed / pixelfed are created. And the public permission is missing the read permission.

drwxr-x--- 2 pixelfed pixelfed 4096 Jun 13:25 q4t0EWVqUPG3

I give the folder read and verbose permissions with public permissions

drwxr-xr-x 2 pixelfed pixelfed 4096 Jun 13:25 q4t0EWVqUPG3

the images are displayed

So it seems the wrong permissions are set when the folders are created

lapineige commented 1 year ago

the images are displayed

From Mastodon and so on you mean ?

Thanks for investigating.

So it seems the wrong permissions are set when the folders are created

This should have been solved :(

sekretaerbaer commented 1 year ago

Yes also from Mastodon, Calckey, Friendica etc. and also in Pixelfed where before only "No Preview Available" was displayed.

lapineige commented 1 year ago

Ok… so we might have some permissions to change :thinking: Again :thinking:

sekretaerbaer commented 1 year ago

I did some tests today and with the following change in filesystems.php it works for me also with version 0.11.8-ynh3


                'dir' => [
                    'public' => 0775,
                    'private' => 0775,
lapineige commented 1 year ago

In my case for some reason with 0.11.8~ynh3 file owner are pixelfed:pixelfed and not pixelfed:www-data… Changing it solves the issue.

I don't know why it was reverted to this :thinking:

webmink commented 1 year ago

Yep, that update re-broke mine as well, no previews any more. I am not in a position to go in with a terminal right now to mess with configs and permissions so my instance will be broken until there's another update :-(

On Sat, Jun 17, 2023 at 11:43 PM lapineige @.***> wrote:

In my case for some reason with 0.11.8~ynh3 file owner are pixelfed:pixelfed and not pixelfed:www-data… Changing it solves the issue.

I don't know why it was reverted to this 🤔

— Reply to this email directly, view it on GitHub https://github.com/pixelfed/pixelfed/issues/4275#issuecomment-1595877783, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKOFE73YBO2FGRD3EH2353XLYXHVANCNFSM6AAAAAAWRYKTAY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

-- Simon Phipps Office: +1 (415) 683-7660 or +44 (238) 098 7027 Signal/Telegram/Mobile: +44 774 776 2816

sekretaerbaer commented 1 year ago

the same here all new folders and files are pixelfed:pixelfed and no longer pixelfed:www-data and although I set the permissions of the folders in filesystems.php to 0775 the permissions are now at 0755

lapineige commented 1 year ago

I don't understand why…

lapineige commented 1 year ago

Ok, found it, it's was the conversion to packaging v2 in Yunohost that forgot the setting.

I will close this all fallback to Yunohost own repository: https://github.com/YunoHost-Apps/pixelfed_ynh/issues/223

lapineige commented 1 year ago

For the record, this issue reappeared now with the Instagram import feature : https://forum.yunohost.org/t/pixelfed-0-11-9-instagram-import-no-preview-after-import/26071/10 It seems that again the permissions are not set correctly, files are owned by pixelfed:pixelfed instead of pixelfed:www-data. Any idea of another hardcoded value or something that could cause this on Pixelfed side ?

Should I open a separate issue ?

lapineige commented 1 year ago

For the record, the issue with normal upload was a configuration mistake, it is now solved. But not imports.

Any idea ? 🙏

tigransimonyan commented 7 months ago

I installed PixelFed (v0.11.13) on my home server and faced the same problem.

folder flags drwx------ for the new uploaded image.

sudo chmod -R ug=rwX,o=rX /var/www/pixelfed/storage/app/public/ helps, but I can't do it after every upload

what can I do now until you solve the problem?

tigransimonyan commented 7 months ago

As a temporary solution I changed this. Hopefully this won't cause any security issues.

Screenshot 2024-03-31 at 21 27 04
pawelorzech commented 2 months ago

This issue still happens for me. And then after I've tried to fix permissions in uploading flow there's another error: image