nextcloud / vm

💻☁📦 The Nextcloud VM (virtual machine appliance), Home/SME Server and scripts for RPi (4-5). Community developed and maintained.
https://download.nextcloudvm.com
GNU General Public License v3.0
1.32k stars 663 forks source link

Installation fails - clean ubuntu install #2624

Closed xKEVKx closed 6 months ago

xKEVKx commented 7 months ago

Steps To Reproduce

Installation fails once Nextcloud installation begins:

Installing Nextcloud, it might take a while...
Console has to be executed with the user that owns the data directory
Current user id: 33
Owner id of the data directory: 0
Try adding 'sudo -u #0' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 0' to the docker command (without the single quotes)
{"reqId":"tm9PPIaCj3duEaDJjbe7","level":3,"time":"2024-04-24T22:32:46+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/var/www/nextcloud/config/config.php): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Config.php#225","userAgent":"--","version":"","data":{"app":"PHP"}}
Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you!
sudo -u www-data php /var/www/nextcloud/occ maintenance:install --data-dir=/mnt/ncdata --database=pgsql --database-name=nextcloud_db --database-user=nextcloud_db_user --database-pass=byQOvZvcrdwZXZOaBnnX3jPBqeFGl --admin-user=ncadmin --admin-pass=nextcloud failed
Checking connection...
Home/SME Server not detected. No worries, just testing the function.
postgresql is installed, it must be a clean server.
kevin@cloud:~$ 

Fresh and fully updated ubuntu server install. sudo wget https://raw.githubusercontent.com/nextcloud/vm/master/nextcloud_install_production.sh sudo bash nextcloud_install_production.sh Let is run until errors out.

Expected Result

Full installation on ubuntu server.

Actual Result

Installing Nextcloud, it might take a while... Console has to be executed with the user that owns the data directory Current user id: 33 Owner id of the data directory: 0 Try adding 'sudo -u #0' to the beginning of the command (without the single quotes) If running with 'docker exec' try adding the option '-u 0' to the docker command (without the single quotes) {"reqId":"tm9PPIaCj3duEaDJjbe7","level":3,"time":"2024-04-24T22:32:46+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/var/www/nextcloud/config/config.php): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Config.php#225","userAgent":"--","version":"","data":{"app":"PHP"}} Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you! sudo -u www-data php /var/www/nextcloud/occ maintenance:install --data-dir=/mnt/ncdata --database=pgsql --database-name=nextcloud_db --database-user=nextcloud_db_user --database-pass=byQOvZvcrdwZXZOaBnnX3jPBqeFGl --admin-user=ncadmin --admin-pass=nextcloud failed Checking connection... Home/SME Server not detected. No worries, just testing the function. postgresql is installed, it must be a clean server. kevin@cloud:~$

Screenshots, Videos, or Pastebins

No response

Additional Context

No response

Build Version

28

Environment

By using the scripts

Environment Details

Promox Ubuntu 22.04 Server (clean install and fully updated)

enoch85 commented 7 months ago

Hi, please try Ubuntu 22.04.

Thanks!

jshore1296 commented 7 months ago

I'm seeing similar. it looks like something is really confused in occ when your data directory is accessible by www-data, but not OWNED by it.

xKEVKx commented 7 months ago

Hi, please try Ubuntu 22.04.

Thanks!

Sorry I mis-typed and I am using 22.04.

xKEVKx commented 7 months ago

I'm seeing similar. it looks like something is really confused in occ when your data directory is accessible by www-data, but not OWNED by it.

Just did a clean install of the VM and this time with only one 4TB disk. Still the same error.

Creating possible missing Directories chmod Files and Directories ⣾⣽⣻chown Directories chmod/chown .htaccess ] Installing Nextcloud, it might take a while... Console has to be executed with the user that owns the data directory Current user id: 33 Owner id of the data directory: 0 Try adding 'sudo -u #0' to the beginning of the command (without the single quotes) If running with 'docker exec' try adding the option '-u 0' to the docker command (without the single quotes) {"reqId":"bDSmIRh1HpWnUUpC2huY","level":3,"time":"2024-04-25T05:45:20+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/var/www/nextcloud/config/config.php): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Config.php#225","userAgent":"--","version":"","data":{"app":"PHP"}} Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you! sudo -u www-data php /var/www/nextcloud/occ maintenance:install --data-dir=/mnt/ncdata --database=pgsql --database-name=nextcloud_db --database-user=nextcloud_db_user --database-pass=nkP8NFtUqab7n66ebO*@iEieZ --admin-user=ncadmin --admin-pass=nextcloud failed Checking connection... Home/SME Server not detected. No worries, just testing the function. postgresql is installed, it must be a clean server. kevin@cloud:~$

vjatsjeslav commented 7 months ago

same issue, also with 22.04.

Installing Nextcloud, it might take a while... Console has to be executed with the user that owns the data directory Current user id: 33 Owner id of the data directory: 0 Try adding 'sudo -u #0' to the beginning of the command (without the single quotes) If running with 'docker exec' try adding the option '-u 0' to the docker command (without the single quotes) {"reqId":"T2YfMZnrQHjGj7aMM6HK","level":3,"time":"2024-04-26T16:13:00+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/var/www/nextcloud/config/config.php): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Config.php#225","userAgent":"--","version":"","data":{"app":"PHP"}} Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you! sudo -u www-data php /var/www/nextcloud/occ maintenance:install --data-dir=/mnt/ncdata --database=pgsql --database-name=nextcloud_db --database-user=nextcloud_db_user --database-pass=rK0BcaqjQBc1zO3m2IyOFqFwN3nEL --admin-user=ncadmin --admin-pass=nextcloud failed

enoch85 commented 7 months ago

Hmm, okay... It worked the last 10 times I did it today with the latest master. I'll have another look.

jshore1296 commented 7 months ago

It only happened for me with two things true at the same time:

vjatsjeslav commented 7 months ago

it happens also on VM with only 1 drive (just for test) tried 10 different combination with users, no success :-(, may be is issued by nexcloud version 29.0.0???? ScreenshotNextOnUbuntu24

xKEVKx commented 7 months ago

it happens also on VM with only 1 drive (just for test) tried 10 different combination with users, no success :-(, may be is issued by nexcloud version 29.0.0???? ScreenshotNextOnUbuntu24

I also tried a bunch of combinations of disk numbers, sizes, users etc. all resulted in the above error.

enoch85 commented 7 months ago

Ok, we'll have a look. Sorry for the waiting time, been working 70 hours this week.

domukas2 commented 7 months ago

Hello

First time to comment and i am eager to have the nextcloud up and running again. From my point of view (i'm not linux guy or scripto guy) but it looks like the problem is here

image

in the check_command there is written sudo -u www-data if you change to root, the installation continues but after that it just only spams like this:

image

LIke i said in the beggining, like the product and was using and will still use it so hoping that the problem is not big and we can install again very soon :)

domukas2 commented 7 months ago

forgot to ask in yesterday comment. is there any possibility to download not the newest Nextcloud but like previous version like v28. because the problem i'm seeing it started with the newest nextcloud update, and until fix i could use previous versions until it is okay with the newer v29.

domukas2 commented 7 months ago

Update

took for my head to see and find the --not-latest flag in the nextcloud_install_production.sh, after trying to use this flag the installation was normal without the error and it installed 28.0.5 Nextcloud without the problems.

vjatsjeslav commented 7 months ago

--not-latest

where did you add the flag in nextcloud_install_production.sh?

xKEVKx commented 7 months ago

Update

took for my head to see and find the --not-latest flag in the nextcloud_install_production.sh, after trying to use this flag the installation was normal without the error and it installed 28.0.5 Nextcloud without the problems.

After a successful install, were you able to update to 29.x just fine?

domukas2 commented 7 months ago

vjatsjeslav - when you are writing sudo bash nextcloud_install_production.sh need to only then add so it will be sudo bash nextcloud_install_production.sh --not-latest you see in the scrip file that it checks for that flag

image

xKEVKx - didn't tried but will now go install in my prod server and try that again. because now tested in VM to see that i can have nextcloud runing up. but now will test normally in my prod server with domain and etc. and can come back to you about that.

xKEVKx commented 7 months ago

so I ran sudo bash nextcloud_install_production.sh --not-latest and everything installed without issue. I was then able to update to 29.x without further issue. Thanks for finding that option!

domukas2 commented 7 months ago

Yep can also confirm that after installing 28.0.5 you can trigger update to 29 without the problems.

But after upgrade int he administration settings it comes with these errors image

I don't know how i need to react to that. if it is okay or it is not so okay to have those errors.

also in logging see this errors but maybe this is normal errors and don't need to think about it. image

xKEVKx commented 7 months ago

Yep can also confirm that after installing 28.0.5 you can trigger update to 29 without the problems.

But after upgrade int he administration settings it comes with these errors image

I don't know how i need to react to that. if it is okay or it is not so okay to have those errors.

also in logging see this errors but maybe this is normal errors and don't need to think about it. image

I can confirm I am getting similar errors.

Screenshot 2024-04-29 at 4 01 46 PM
xKEVKx commented 7 months ago

I'm getting some cron errors/notices about memory usage growing. I have plenty of overhead allocated (64GB ram) so not sure why these are happening.

Screenshot 2024-04-29 at 6 28 17 PM
domukas2 commented 7 months ago

not related to last message to xKEVKx, but i came back to 28.0.5 version until further and it seems okay only warning about the maintenance windows and imagick and the log for now shows no warnings also or error so my opinion something has changed with the updater version 29 from nextcloud when they seems also updated the hub version also. That it began to check more or different now and maybe thats why we get error when installing and error after that or etc. Don't know what more from my side i can help to test more.

But if i can help with something let me know. But i'm not linux or script guy so for me won't be easy to understand or to diagnose more of that hehe :-)

enoch85 commented 7 months ago

Thanks for the debugging on this, will have a look when time allows.

Probably something changed in Nextcloud 29. We don't recommend going for the latest instantly, but to wait for the next minor, so 29.0.1 in this case.

Regarding the change in NC 29, maybe @szaimen knows more?

szaimen commented 7 months ago

There are some bug reports open in server...

YtachY commented 7 months ago

If running with 'docker exec' try adding the option '-u 0' to the docker command (without the single quotes) {"reqId":"tm9PPIaCj3duEaDJjbe7","level":3,"time":"2024-04-24T22:32:46+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/var/www/nextcloud/config/config.php): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Config.php#225","userAgent":"--","version":"","data":{"app":"PHP"}} Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you! sudo -u www-data php /var/www/nextcloud/occ maintenance:install --data-dir=/mnt/ncdata --database=pgsql --database-name=nextcloud_db --database-user=nextcloud_db_user --database-pass=byQOvZvcrdwZXZOaBnnX3jPBqeFGl --admin-user=ncadmin --admin-pass=nextcloud failed Checking connection... Home/SME Server not detected. No worries, just testing the function. postgresql is installed, it must be a clean server. kevin@cloud:~$



Fresh and fully updated ubuntu server install. sudo wget https://raw.githubusercontent.com/nextcloud/vm/master/nextcloud_install_production.sh sudo bash nextcloud_install_production.sh Let is run until errors out.

### Expected Result
Full installation on ubuntu server.

### Actual Result
Installing Nextcloud, it might take a while... Console has to be executed with the user that owns the data directory Current user id: 33 Owner id of the data directory: 0 Try adding 'sudo -u #0' to the beginning of the command (without the single quotes) If running with 'docker exec' try adding the option '-u 0' to the docker command (without the single quotes) {"reqId":"tm9PPIaCj3duEaDJjbe7","level":3,"time":"2024-04-24T22:32:46+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/var/www/nextcloud/config/config.php): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Config.php#225","userAgent":"--","version":"","data":{"app":"PHP"}} Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you! sudo -u www-data php /var/www/nextcloud/occ maintenance:install --data-dir=/mnt/ncdata --database=pgsql --database-name=nextcloud_db --database-user=nextcloud_db_user --database-pass=byQOvZvcrdwZXZOaBnnX3jPBqeFGl --admin-user=ncadmin --admin-pass=nextcloud failed Checking connection... Home/SME Server not detected. No worries, just testing the function. postgresql is installed, it must be a clean server.

I got the same error

ENV:

Installing Nextcloud, it might take a while...
Console has to be executed with the user that owns the data directory
Current user id: 33
Owner id of the data directory: 0
Try adding 'sudo -u #0' to the beginning of the command (without the single quotes)
If running with 'docker exec' try adding the option '-u 0' to the docker command (without the single quotes)
{"reqId":"lgPjpwbqRAsTd2fx0B6J","level":3,"time":"2024-05-05T10:08:16+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"fopen(/var/www/nextcloud/config/config.php): Failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Config.php#225","userAgent":"--","version":"","data":{"app":"PHP"}}
Sorry but something went wrong. Please report this issue to https://github.com/nextcloud/vm/issues and include the output of the error message. Thank you!
sudo -u www-data php /var/www/nextcloud/occ maintenance:install --data-dir=/mnt/ncdata --database=pgsql --database-name=nextcloud_db --database-user=nextcloud_db_user --database-pass=JdJcFR4LGo6Ykpp#FF6w1866tep2B --admin-user=admin --admin-pass=administrator failed
Checking connection...
Home/SME Server not detected. No worries, just testing the function.
postgresql is installed, it must be a clean server.
zynexiz commented 7 months ago

Having the same issue after updated to Nextcloud Hub 8 (29.0.0). Started getting Console has to be executed with the user that owns the data directory error to, both with occ and the cron jobb. Haven't had this issue before.

My data dir is on a different RAID storage, that needs to be accessed by multiple VM's in running on my system. It's owned by user 1000, and belongs to storage group. HTTP user have access to it, but isn't the owner. This is the way my system is set up, and must be for the other VM's to be able to access it (using KVM Type 1 virtualisation on Arch Linux for the servers). Forcing me to change the owner to http would break my setup.

[EDIT]

Temporary solution is to comment ut the checks in both cron.php and console.php. Then it skips the checks. This issue needs to be addressed. Forcing the data dir to be owned by http user us not subtile in all environments. Screenshot_20240505_190408 Screenshot_20240505_190433

chrisfonte commented 6 months ago

Same issue for me when I installed with

sudo ./nextcloud_install_production.sh --not-latest

But I have a feeling it's because I created the ncadmin user as part of the install, at which point the script restarted the process on its own, probably not with the flag...just a theory.

chrisfonte commented 6 months ago

Same issue for me when I installed with

sudo ./nextcloud_install_production.sh --not-latest

But I have a feeling it's because I created the ncadmin user as part of the install, at which point the script restarted the process on its own, probably not with the flag...just a theory.

Yes that was it, the flag does not persist if the user running the script is not the same as when the command was initially run. Thank God for VM snapshots for testing!

enoch85 commented 6 months ago

Hi guys, just released a new OS version, so now it works on Ubuntu 24.04!

Added the --not-latest flag per default, and will have a closer look at the real issue.

Please test the latest script!

enoch85 commented 6 months ago

Just tested, working in current state!

enoch85 commented 6 months ago

Now we are able to install NC 29, so please run it and be happy. :)

vjatsjeslav commented 6 months ago

20240508_223308.png