Nextcloud: An error occurred inside the app installation script

Hello everyone. This is amazing software. Thanks to everyone involved.

:uk:/:us:

My YunoHost server

Hardware: Raspberry Pi at home /
YunoHost version: 11.1.21.4
I have access to my server : Through SSH | through the webadmin |
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain: I moved my home and var folders, following these instructions: Adding an external storage to your server | Yunohost Documentation
If your request is related to an app, specify its name and version: nextcloud app 26.0.3~ynh1

Description of my issue

I attempted to install Nextcloud through the applications section of the administration page of my newly-set up Yunohost machine. It failed and gave me the error log linked below. I searched for further information but have found nothing.

error log

I had got all green on the diagnosis page before I attempted this. I am using a subdomain of my secondary tld. I wonder whether this might complicate things. Also, I have a RAID array set up through a SATA hat on my Pi. Before I attempted to install any apps, I moved my ā€˜home’ and ā€˜var’ folders to this, as mentioned above.

I have noticed this line in the error log:

Cannot create or write into the data directory /home/yunohost.app/nextcloud/data

I’m wondering whether I’ve got the permissions wrong on the folders in my RAID mount. I’m peering into that rabbit hole now, trying to work it out, but if anyone can help to clarify, I’d be really grateful.

Is this a matter of the Nextcloud Yunohost app being broken, or have I done something wrong?

Any help much appreciated,

Kind regards,

Peter


Well, it installed after I had done nothing but a server restart.

However, now it’s installed, I can’t connect to it through the url the server gives me. I get a firefox ā€œUnable to connectā€ page.

I’ll try another restart.

@Danceswithcats
You should check the permissions of your directories. As /home is obviously mounted on another disk, it may be that only root has rights on this partition.

Normally, permissions should be as follows

sudo chown root:root /home
sudo chmod 755 -R /home

sudo chown -R root:root /home/yunohost.app
sudo chmod 755 -R /home/yunohost.app

sudo chown -R nextcloud:nextcloud /home/yunohost.app/nextcloud
sudo chmod 755 -R /home/yunohost.app/nextcloud

sudo chown -R nextcloud:nextcloud /home/yunohost.app/nextcloud/data
sudo chmod 750 -R /home/yunohost.app/nextcloud/data
1 Like

Thanks @mib

I got these permissions from an ls query:

peter@danceswithcats:~ $ ls -l /
total 60
lrwxrwxrwx   1 root root     7 Dec  6  2022 bin -> usr/bin
drwxr-xr-x   3 root root  4096 Jan  1  1970 boot
drwxr-xr-x  17 root root  4160 Jul  2 15:35 dev
drwxr-xr-x 107 root root  4096 Jul  2 15:08 etc
drwxr-xr-x   7 root root  4096 Jul  2 15:08 home
lrwxrwxrwx   1 root root     7 Dec  6  2022 lib -> usr/lib
drwx------   2 root root 16384 Dec  6  2022 lost+found
drwxr-xr-x   2 root root  4096 Dec  6  2022 media
drwxr-xr-x   3 root root  4096 Jun 18 13:31 mnt
drwxr-xr-x   2 root root  4096 Dec  6  2022 opt
dr-xr-xr-x 256 root root     0 Jan  1  1970 proc
drwx------   3 root root  4096 Jul  2 15:05 root
drwxr-xr-x  36 root root  1080 Jul  2 16:16 run
lrwxrwxrwx   1 root root     8 Dec  6  2022 sbin -> usr/sbin
drwxr-xr-x   2 root root  4096 Dec  6  2022 srv
dr-xr-xr-x  12 root root     0 Jan  1  1970 sys
drwxrwxrwt  12 root root  4096 Jul  2 16:11 tmp
drwxr-xr-x  11 root root  4096 Dec  6  2022 usr
drwxr-xr-x  13 root root  4096 Jul  2 13:37 var
peter@danceswithcats:~ $ ls -l /mnt/md0
total 24
drwxr-xr-x 5 root root  4096 Jul  2 13:21 home
drwx------ 2 root root 16384 Jun 18 16:19 lost+found
drwxr-xr-x 3 root root  4096 Jul  2 13:20 var

Can I just enter the commands you showed into an ssh terminal and solve it?

@Danceswithcats

First run the command :

ls -l /home/yunohost.app

You should get the following feedback for Nextcloud

drwxr-xr-x+ 3 nextcloud     nextcloud     4096  7 fƩvr.  2017 nextcloud

My commands must be launched to have the right permissions on the /home partition.

Hello @mib

Firstly, I really appreciate your help. Thanks to the encouragement I drew from your replies, I have also been reading about permissions, and learning from your pointers. This is the true value of informed sharing of knowledge. I am really grateful.

Bad news!

ls -l /home/yunohost.app

gave me

Total: 0

Apparently, I did a bad job of moving the directories, and it confused the Nextcloud installer.

With a couple of posts, you’ve made me see that I have to rethink.

I don’t think that installing the system on the sd card and then trying to move components to the RAID disks is a sensible process and it will not lead to a resilient server. Once I start playing with the basic Yunohost installation, things get complicated and an sd card isn’t the best medium for a system drive on an always-on machine anyway.

It occurs to me that if I installed Raspberry Pi OS onto my sd card then installed raspberry pi imager and gparted onto that system, I could install Yunohost directly onto my RAID array. This would mean that Yunohost could just do its thing, unmuddled by my blundering, and I wouldn’t be relying upon an sd card to run my server. I am not easy about having a server running from a little bit of plastic and foil. Resilience is one of the reasons for using RAID.

Do you think that sounds sensible?

@Danceswithcats

Could I see the contents of /etc/fstab

I remember it was possible to install the operating system on the external storage of the Raspberry Pi, the SD Card is there only for boot.
There are various documentations on how to do this.

I … nope

Nope nope nope nope nope nope

Oh god please don’t type this

Recursively setting root:root as owner on every file in /home is a disaster

And so is setting 755 recursively …

This fucks so much things, I don’t even know where to begin

Maybe this is legit WITHOUT the -R, but oh god … If you ran this command, you’re probably off for a good entire day trying to fix permissions …

1 Like

Indeed, I went too fast with my copy/paste.
Error corrected.

Hello again, @mib,

Busy couple of days at work. Sorry for the delay.

/etc/fstab:

xproc            /proc           proc    defaults          0       0
PARTUUID=374a5168-01  /boot           vfat    defaults          0       2
PARTUUID=374a5168-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
# /dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0
/dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0
UUID="8efea0e5-0e05-4fdb-8d5e-c7ac207e15c9" /mnt/md0/ ext4 defaults,nofail 0 0
/mnt/md0/home/yunohost.app /home/yunohost.app none defaults,bind 0 0
/mnt/md0/home/yunohost.multimedia /home/yunohost.multimedia none defaults,bind 0 0
/mnt/md0/home/yunohost.backup /home/yunohost.backup none defaults,bind 0 0
/mnt/md0/var/mail /var/mail none defaults,bind 0 0

I … nope
Nope nope nope nope nope nope
Oh god please don’t type this

@Aleks, you’re my new favourite person.

I promise I will never type that, tempting as it now is.

1 Like

I do not understand your mount storage devices

/dev/md0 /mnt/md0 ext4 defaults,nofail,discard 0 0
UUID="8efea0e5-0e05-4fdb-8d5e-c7ac207e15c9" /mnt/md0/ ext4 defaults,nofail 0 0
/mnt/md0/home/yunohost.app /home/yunohost.app none defaults,bind 0 0
/mnt/md0/home/yunohost.multimedia /home/yunohost.multimedia none defaults,bind 0 0
/mnt/md0/home/yunohost.backup /home/yunohost.backup none defaults,bind 0 0
/mnt/md0/var/mail /var/mail none defaults,bind 0 0

If UUID=8efea0e5-0e05-4fdb-8d5e-c7ac207e15c9 is your RAID disk, why didn’t you mount it this way?

UUID=8efea0e5-0e05-4fdb-8d5e-c7ac207e15c9  /home   ext4    defaults,relatime,nodiratime    0   2

You can also make two partitions on this RAID, one for /home and one for /var.
This results in an fstab file like this one

xproc            /proc           proc    defaults          0       0
PARTUUID=374a5168-01  /boot           vfat    defaults          0       2
PARTUUID=374a5168-02  /               ext4    defaults,noatime  0       1
UUID=8efea0e5-0e05-4fdb-8d5e-c7ac207e15c9  /home   ext4    defaults,relatime,nodiratime   0   2
UUID=var-partition-uuid  /var   ext4    defaults,relatime,nodiratime   0   2

Hi @mib,

do you know where these documentations are? I have found this, but it’s not precisely what I’m looking for. What you describe would be perfect.

Since we last spoke, I have tried booting with a Raspberry Pi OS and putting a Yunohost image onto my RAID array with dd. That didn’t work, but I think I know why: I’ll look at fstab again when I have time, but I’m too tired now.

Anyway, I hope you’re well.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.