Moving from bare metal to vm - running into installation issues (502, looping etc)

hey all,

been trying to troubleshoot this on my own but i think i need help. i originally had nextcloud-aio docker working on a bare metal ubuntu machine, with an entry in my fstab for a director on my nas.

i was able to move everything else to my vm (mostly through copying the home folder), but nextcloud is still not working.

the issue is when i try to route to my reverse proxied domain (through caddy which i havenā€™t changed and is working for my other services), i got a 502 error. if i try localip:11000, that gives me a connection refused. localip:8080 works, hereā€™s what i see

image

if i docker ps in my vm, it looks like nextcloud-aio-nextcloud is stuck restarting, but apache and push seem to be up and healthy. everything else pertaining to nextcloud seems up and healthy too.

if i check docker logs for nextcloud, or click on ā€˜startingā€™ for the nextcloud container from the iplocal:8080 page, hereā€™s what it says:

+ '[' -f /dev-dri-group-was-added ']'

++ find /dev -maxdepth 1 -mindepth 1 -name dri

+ '[' -n '' ']'

+ set +x

Configuring Redis as session handler...

The initial Nextcloud installation failed.

Please reset AIO properly and try again. For further clues what went wrong, check the logs above.

See https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance

i tried properly resetting 2-3 times, but still leads to the same result. i have ports 443 and 80 open. i think i deleted some local nextcloud volumes (i try to keep things in a local folder for my services or on my nas or a mix of both) so i deleted some of those folders and let docker re-create them, but that didnā€™t work either. iā€™m assuming my caddy and docker compose are fine since i didnā€™t touch them, but i can post those or anything else that would help.

thanks a lot all.

quick edit: iā€™ve seen posts with similar issues, can link some of the ones iā€™ve tried, but only making a most since i havenā€™t found a solution yet.

Hi, see GitHub - nextcloud/all-in-one: Nextcloud AIO stands for Nextcloud All-in-One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.

hello, i tried following that, a few times actually, and i still got the same result.

Did you see step 10?

would that include the drive on my nas? wouldnā€™t that delete any data i have? could i move that directory and copy it back in later to keep my data?

Ah trueā€¦

Btw, using the built-in backup solution would have helped you here but I guess you didnt use it? You could have restored the whole instance on the new server.

Btw, did you also back up all docker volumes on the old server and restored it to the new one?

actually i think i can still backup on the old server. let me try that.

i did not do a backup, i just copy and pasted my home folder over and that did most of the work for me

No, it is not including all persistent data as you can see. I would recommend to use the built-in backup solution of AIO to back up and then restore on a new server.

hello,
i was able to make a backup. how should i proceed to restore? should i properly reset including deleting the directory with all my data and let it re-create everything when i restore from the admin interface?

okay so i tried what i said.

  • ā€œdeletedā€ (moved somewhere else) my data_dir
  • properly reset aio
  • restored the backup on initial setup, said it restored succesfully

image

now the logs for the nextcloud container is what i posted before:

+ '[' -f /dev-dri-group-was-added ']'
++ find /dev -maxdepth 1 -mindepth 1 -name dri
+ '[' -n '' ']'
+ set +x
Configuring Redis as session handler...
The initial Nextcloud installation failed.
Please reset AIO properly and try again. For further clues what went wrong, check the logs above.
See https://github.com/nextcloud/all-in-one#how-to-properly-reset-the-instance

and apache logs:
getaddrinfo for host "nextcloud-aio-nextcloud" port 9000: Name does not resolve

anything else i can try?

edit:
on my previous server, i havenā€™t done a full wipe yet, which is why i was able to make a backup. would that impact this new installation? i usually keep that machine in sleep or powered off.

@szaimen anything you can recommend?

Can you check if you have such a file in your datadir and remove that by hand?

sorry for the delay, i checked but forgot to reply.

my local folder and my nas folder are completely either removed or empty. my local config folder does not exist since i deleted that folder and i guess it didnā€™t re-create it when it ran, and my nas folder is there but completely empty.

@szaimen
okay finally getting a new error

+ '[' -f /dev-dri-group-was-added ']'
++ find /dev -maxdepth 1 -mindepth 1 -name dri
+ '[' -n '' ']'
+ set +x
Installing imagemagick via apk...
Enabling Imagick...
WARNING: opening from cache https://dl-cdn.alpinelinux.org/alpine/v3.18/main: No such file or directory
WARNING: opening from cache https://dl-cdn.alpinelinux.org/alpine/v3.18/community: No such file or directory
Configuring Redis as session handler...
The www-data user doesn't seem to have access rights in the datadir.
Most likely are the files located on a drive that does not follow linux permissions.
Please adjust the permissions like mentioned below.
The found permissions are:
1000:1000 755
(userID:groupID permissions)
but they should be:
33:0 750
(userID:groupID permissions)
Also make sure that the parent directories on the host of the directory that you've chosen as datadir are publicly readable with e.g. 'sudo chmod +r /mnt' (adjust the command accordingly to your case) and the same for all subdirectories.
Additionally, if you want to use a Fuse-mount as datadir, set 'allow_other' as additional mount option.
For SMB/CIFS mounts as datadir, see https://github.com/nextcloud/all-in-one#can-i-use-a-cifssmb-share-as-nextclouds-datadir

i tried running sudo chmod +r in the parent folder (shown below) and in the nextcloud folder.

hereā€™s my ls -la of the parent folder of where my nextcloud datadir is, i just blocked out some sensitive data and my name, but they all have the name listed.
image

edit:
heres my /etc/fstab
//localip/nas-root /mnt/nas cifs username=,password=,rw,uid=1000,gid=1000,nobrl,vers=2.0,nodfs
//localip/nas-root /mnt/nas/home_server/nextcloud cifs username=,password=,rw,mfsymlinks,seal,uid=33,gid=0,file_mode=0770,dir_mode=0770 0 0

edit2:
i tried some small things, no luck, restarted the entire vm (before was just restarting the containers), and now im getting the initial error of ā€œinitial setup failedā€. might try to do the proper reset again and see if i can get back to the point of the permissions error

See GitHub - nextcloud/all-in-one: Nextcloud AIO stands for Nextcloud All-in-One and provides easy deployment and maintenance with most features included in this one Nextcloud instance.

the part about using a cifs share? yes, i added that in one of my edits, my /etc/fstab, the first one is not related but i left it there for context

Yes

(10 characters)

does my /etc/fstab look incorrect to you? it was working before my migration so i assumed it would be fine even now

It doesnt look correct. Please compare the docs that I send with the one you are using

the only difference i found was the way i handled credentials. i still tried it, but it did not change the error. i will try again with a proper reset + backup and checking permissions prior to starting the containers and will report back when i do.