Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails - clean ubuntu install #2624

Closed
xKEVKx opened this issue Apr 24, 2024 · 31 comments
Closed

Installation fails - clean ubuntu install #2624

xKEVKx opened this issue Apr 24, 2024 · 31 comments
Labels

Comments

@xKEVKx
Copy link

xKEVKx commented Apr 24, 2024

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 xKEVKx added the bug label Apr 24, 2024
@enoch85
Copy link
Member

enoch85 commented Apr 25, 2024

Hi, please try Ubuntu 22.04.

Thanks!

@jshore1296
Copy link

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
Copy link
Author

xKEVKx commented Apr 25, 2024

Hi, please try Ubuntu 22.04.

Thanks!

Sorry I mis-typed and I am using 22.04.

@xKEVKx
Copy link
Author

xKEVKx commented Apr 25, 2024

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
Copy link

vjatsjeslav commented Apr 26, 2024

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
Copy link
Member

enoch85 commented Apr 26, 2024

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

@jshore1296
Copy link

jshore1296 commented Apr 26, 2024

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.

@vjatsjeslav
Copy link

vjatsjeslav commented Apr 27, 2024

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
Copy link
Author

xKEVKx commented Apr 27, 2024

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
Copy link
Member

enoch85 commented Apr 28, 2024

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

@domukas2
Copy link

domukas2 commented Apr 28, 2024

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
Copy link

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
Copy link

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
Copy link

vjatsjeslav commented Apr 29, 2024

--not-latest

where did you add the flag in nextcloud_install_production.sh?

@xKEVKx
Copy link
Author

xKEVKx commented Apr 29, 2024

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
Copy link

domukas2 commented Apr 29, 2024

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
Copy link
Author

xKEVKx commented Apr 29, 2024

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
Copy link

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
Copy link
Author

xKEVKx commented Apr 29, 2024

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
Copy link
Author

xKEVKx commented Apr 30, 2024

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
Copy link

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
Copy link
Member

enoch85 commented Apr 30, 2024

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
Copy link
Collaborator

szaimen commented Apr 30, 2024

There are some bug reports open in server...

@YtachY
Copy link

YtachY commented May 5, 2024

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.

@zynexiz
Copy link

zynexiz commented May 5, 2024

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
Copy link

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
Copy link

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
Copy link
Member

enoch85 commented May 7, 2024

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
Copy link
Member

enoch85 commented May 7, 2024

Just tested, working in current state!

@enoch85 enoch85 closed this as completed May 7, 2024
@enoch85
Copy link
Member

enoch85 commented May 8, 2024

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

@vjatsjeslav
Copy link

20240508_223308.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants