vm icon indicating copy to clipboard operation
vm copied to clipboard

Installation fails - clean ubuntu install

Open xKEVKx opened this issue 1 year ago • 23 comments

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)

xKEVKx avatar Apr 24 '24 22:04 xKEVKx

Hi, please try Ubuntu 22.04.

Thanks!

enoch85 avatar Apr 25 '24 01:04 enoch85

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.

jshore1296 avatar Apr 25 '24 03:04 jshore1296

Hi, please try Ubuntu 22.04.

Thanks!

Sorry I mis-typed and I am using 22.04.

xKEVKx avatar Apr 25 '24 05:04 xKEVKx

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:~$

xKEVKx avatar Apr 25 '24 05:04 xKEVKx

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

vjatsjeslav avatar Apr 26 '24 16:04 vjatsjeslav

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

enoch85 avatar Apr 26 '24 19:04 enoch85

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

  • upgrade to 29 (the code that triggers this is only in NC29 as far as I can tell from the commit history, before that it checked perms on config.php, not on the data directory)
  • data directory is not chown-able to www-data. This happens with mounted directories in VMs for sure, but it might exist in other cases.

jshore1296 avatar Apr 26 '24 19:04 jshore1296

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

vjatsjeslav avatar Apr 27 '24 10:04 vjatsjeslav

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.

xKEVKx avatar Apr 27 '24 14:04 xKEVKx

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

enoch85 avatar Apr 28 '24 08:04 enoch85

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 avatar Apr 28 '24 21:04 domukas2

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 avatar Apr 29 '24 10:04 domukas2

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.

domukas2 avatar Apr 29 '24 18:04 domukas2

--not-latest

where did you add the flag in nextcloud_install_production.sh?

vjatsjeslav avatar Apr 29 '24 19:04 vjatsjeslav

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?

xKEVKx avatar Apr 29 '24 19:04 xKEVKx

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.

domukas2 avatar Apr 29 '24 19:04 domukas2

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!

xKEVKx avatar Apr 29 '24 21:04 xKEVKx

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

domukas2 avatar Apr 29 '24 22:04 domukas2

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 avatar Apr 29 '24 23:04 xKEVKx

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

xKEVKx avatar Apr 30 '24 01:04 xKEVKx

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 :-)

domukas2 avatar Apr 30 '24 02:04 domukas2

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?

enoch85 avatar Apr 30 '24 06:04 enoch85

There are some bug reports open in server...

szaimen avatar Apr 30 '24 07:04 szaimen

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:

  • GCE: ubuntu 22.04 LTS minimal
  • Clean
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.

YtachY avatar May 05 '24 10:05 YtachY

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

zynexiz avatar May 05 '24 16:05 zynexiz

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 avatar May 06 '24 22:05 chrisfonte

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!

chrisfonte avatar May 06 '24 22:05 chrisfonte

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 avatar May 07 '24 17:05 enoch85

Just tested, working in current state!

enoch85 avatar May 07 '24 18:05 enoch85

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

enoch85 avatar May 08 '24 19:05 enoch85