YunoHost-Apps / photoprism_ynh

AI-Powered Photos App for the Decentralized Web
GNU Affero General Public License v3.0
7 stars 6 forks source link

Failure in: namespacing: /run/systemd/unit-root/usr/lib64: No such file or directory #29

Closed brimwats closed 2 years ago

brimwats commented 2 years ago

Here are my logs: https://paste.yunohost.org/exahezimic

it worked until the most recent upgrade. So then I uninstalled and reinstalled and went to look for the settings yml to make tweaks on my server but...there seems to be no settings

brimwats commented 2 years ago

unsure if related to #22

Limezy commented 2 years ago

Hi @brimwats ! For sure it's not related to #22 However it's probably related to the fact that we changed from a .yml file giving the settings to an .env environnement file. Could you please first try to upgrade to 2022.09.01 just released ? Then tell me if it's still broken.

brimwats commented 2 years ago

Could you please first try to upgrade to 2022.09.01 just released ?

no luck! new logs: https://paste.yunohost.org/nuqaxigami

brimwats commented 2 years ago

I have this installed on a / domain (i.e. as main thing on the URI)

brimwats commented 2 years ago

Here are the install logs: https://paste.yunohost.org/raw/omajofapiy

And the uninstall logs https://paste.yunohost.org/raw/igojamecec

Limezy commented 2 years ago

https://forum.proxmox.com/threads/apache2-service-failed-to-set-up-mount-namespacing-permission-denied.56871/post-480100 Are you inside a Proxmox container ?

brimwats commented 2 years ago

No. I have a dell poweredge server, only has yunohost

Hardware: Dell R720 I have access to my server : SSH, direct access Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : not really. I have a RAID server, where /home = ~2TB and /var = 20TB so most of my storage needs to be on /var

brimwats commented 2 years ago

bc most of the photos are on /var/Multimedia I usually have to edit a config file to point programs at them.

Once Photpoprisim is up and running (haven't gotten to this part). Here's what I do:

sudo su

# Let's create the group and add its users

# groupadd multimedia, not necessary because it exists
usermod photoprism -a -G multimedia

# Set permissions

chown photoprism:multimedia -R /var/Multimedia
find /var/Multimedia -type d -exec chmod 0775 {} \;
find /var/Multimedia -type f -exec chmod 0664 {} \;

# Set ACLs (I did some research :p)
# Users will get ownership of their own files,
# but the group will always be multimedia
# I left the r permission to other, but you can replace it with 0
# if you only want the apps listed above to access the files

setfacl -d -m u::rwX,g::rwX,o::r /var/Multimedia

# Restart services

systemctl restart photoprism
systemctl restart php7.4-fpm
systemctl restart php8.0-fpm
systemctl restart nginx

(again, I only do the above once the URL for photoprism works. usually it works fine and is empty so the config file needs changing)

Thovi98 commented 2 years ago

I’ve the exact same issue since the exact same upgrade (sorry for the delay). I didn’t touch at any configuration, and I remove/reinstall, but same error. I don’t know how to solve this.

Limezy commented 2 years ago

Ok I will try to reproduce and then have a look at the bug. Meanwhile you can force upgrade to an earlier release of the package

centralscrutinizer21 commented 2 years ago

same here. how to force upgrade to an earlier version?

Limezy commented 2 years ago

OK. Just tried again to install from scratch, everything is perfect. So I'll try to install an old version then upgrade to reproduce the bug.

Limezy commented 2 years ago

same here. how to force upgrade to an earlier version?

It would be something like sudo yunohost app upgrade photoprism -u https://github.com/YunoHost-Apps/photoprism_ynh/tree/261e9e2c2ec606e2d6bf724127467da09ad3d0d7 --force --debug, to come back to version 2022.07.30~ynh3

I'm trying to install that version 2022.07.30~ynh3 and then upgrade, hopefully I'll be able to reproduce the bug

Limezy commented 2 years ago

Well, the bad news is that my update worked perfectly... Couldn't reproduce any bug !

centralscrutinizer21 commented 2 years ago

Yeah, and in my case downgrading to 2022.07.30~ynh3 didn't solved the issue neither

Limezy commented 2 years ago

Which architecture are you using ? Amd64 I guess ?

Limezy commented 2 years ago

Could you try restore from your pre upgrade backup, if you still have it ?

brimwats commented 2 years ago

my backup no longer exists

Limezy commented 2 years ago

It could be linked to the way I've solved #22. Could you please share here the result of the command sudo ls -lla / ?

centralscrutinizer21 commented 2 years ago

Which architecture are you using ? Amd64 I guess ?

Arm64

Could you try restore from your pre upgrade backup, if you still have it ?

Restored the app from backup version 2022.07.30~ynh1 now is working again

It could be linked to the way I've solved #22. Could you please share here the result of the command sudo ls -lla / ?

total 75
drwxr-xr-x  18 root root  4096 Aug  8 11:55 .           drwxr-xr-x  18 root root  4096 Aug  8 11:55 ..
lrwxrwxrwx   1 root root     7 Aug  8 11:11 bin -> usr/bin
drwxr-xr-x   3 root root  3072 Jan  1  1970 boot
drwxr-xr-x  17 root root  4080 Sep 17 13:05 dev
drwxr-xr-x 115 root root 12288 Sep 17 07:38 etc         drwxr-xr-x  23 root root  4096 Sep 15 14:44 home
lrwxrwxrwx   1 root root     7 Aug  8 11:11 lib -> usr/lib
drwx------   2 root root 16384 Aug  8 11:54 lost+found
drwxr-xr-x   2 root root  4096 Aug  8 11:11 media
drwxr-xr-x   3 root root  4096 Aug 25 20:02 mnt
drwxr-xr-x   3 root root  4096 Sep 16 17:59 opt
dr-xr-xr-x 289 root root     0 Jan  1  1970 proc
drwx------   4 root root  4096 Sep 16 17:59 root        drwxr-xr-x  37 root root  1100 Sep 17 17:31 run
lrwxrwxrwx   1 root root     8 Aug  8 11:11 sbin -> usr/sbin
drwxr-xr-x   2 root root  4096 Aug  8 11:11 srv
dr-xr-xr-x  12 root root     0 Jan  1  1970 sys
drwxrwxrwt  19 root root  4096 Sep 17 17:30 tmp
drwxr-xr-x  11 root root  4096 Aug  8 11:11 usr
drwxr-xr-x  13 root root  4096 Aug 25 23:01 var
Limezy commented 2 years ago

OK, I think I understood the problem. For some reasons you don't have a lib64 -> /usr/lib64 symlink at the root, which I have. The sandboxing function I've used in Systemd is crashing since I ask it to mount /lib64, which you don't have. I'm trying to see if there is a way to remove this or to put that bind as optional instead

Limezy commented 2 years ago

Could you please try to upgrade to 2022.09.01~ynh2 ?

brimwats commented 2 years ago

I upgraded but am still getting a 502 error. Should I try reinstalling from scratch?

Limezy commented 2 years ago

Could you please share the logs of the failure ? I'm convinced the error is linked to that specific binding of files during the start of the service. We just have to find out which one !

brimwats commented 2 years ago

There are no logs of the failure right now, the update happened successfully, but it's when I access the url it 502's

brimwats commented 2 years ago

I'm happy to try a reinstall to see if I can get logs though!

Limezy commented 2 years ago

If it's 502 it means the service is not starting well. Normally, it will throw an error. So you can go to Yunohost webadmin -> Services -> Photoprism Photoprism will likely tell you that it's not running, but there the webadmin should report the last lines of the service log, which are the ones I would like to have a look into ! Thanks

brimwats commented 2 years ago

oh duh! here it is

https://paste.yunohost.org/sonesubiqi

brimwats commented 2 years ago

and /var/log/photoprism/photoprism.log is empty

Limezy commented 2 years ago

Could you please try sudo yunohost app upgrade photoprism -u https://github.com/YunoHost-Apps/photoprism_ynh/tree/fix-issue-29 --force ? I've put all bindings as optional...

Thovi98 commented 2 years ago

I can confirm it works for me :D

Limezy commented 2 years ago

I can confirm it works for me :D

Wow great ! I'm creating a PR and will merge once confirmed working by @brimwats and @centralscrutinizer21

brimwats commented 2 years ago

it works for me!

Limezy commented 2 years ago

@centralscrutinizer21 I have merged and will close that issue. Please reopen it in case the fix didn't work for you.

centralscrutinizer21 commented 2 years ago

@centralscrutinizer21 I have merged and will close that issue. Please reopen it in case the fix didn't work for you.

I can confirm it works for me. Great Job