nextcloud / nextcloudpi

📦 Build code for NextcloudPi: Raspberry Pi, Odroid, Rock64, curl installer...
https://nextcloudpi.com
2.44k stars 293 forks source link

installation via curl failed #1911

Closed ksd73429udmn closed 2 months ago

ksd73429udmn commented 2 months ago

Installed via # curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash on RP5 on fresh Bookworm. ncp-config returns cat: /usr/local/etc/ncp-version: No such file or directory but starts up. no options available. "NextCloudPi configuration ver. " Does not show any version.

System information

NextcloudPi diagnostics ``` cat: /usr/local/etc/ncp-version: No such file or directory Nextcloud is not installed - only a limited number of commands are available grep: /etc/apache2/sites-available/nextcloud.conf: No such file or directory NextcloudPi version OS Debian GNU/Linux 12. 6.6.28+rpt-rpi-2712 (aarch64) automount no USB devices none datadir (doesn't exist) rootfs usage 5.2G/28G swapfile /var/swap dbdir /var/lib/mysql Nextcloud check ok Nextcloud version 28.0.5.1 HTTPD service up PHP service up MariaDB service up Redis service down HPB service down Postfix service up Internet check ok Public IPv4 ***REMOVED SENSITIVE VALUE*** Public IPv6 ***REMOVED SENSITIVE VALUE*** Port 80 open Port 443 open IP ***REMOVED SENSITIVE VALUE*** Gateway ***REMOVED SENSITIVE VALUE*** Interface wlan0 Certificates ***REMOVED SENSITIVE VALUE*** NAT loopback no Uptime 38min ```
Nextcloud configuration ``` Nextcloud is not installed - only a limited number of commands are available There are no commands defined in the "config" namespace. ```
HTTPd logs ``` ```
Database logs ``` tail: cannot open '/var/log/mysql/*.log' for reading: No such file or directory ```
Nextcloud logs ``` tail: cannot open '/nextcloud.log' for reading: No such file or directory ```

-->

theCalcaholic commented 2 months ago

That likely means that there was a previous error in the installation process. Can you check that or share the full installation log?

Other than that, feel free to use the available, readily built and tested image for the RPi5 from the official release page

ksd73429udmn commented 2 months ago

Sure. ncp.log

theCalcaholic commented 2 months ago

Thank you, that will be very helpful. However, I will focus on issues with the upgrade script first (I prioritize preventing breakage of existing installations over issues with setting up new ones, I hope you understand :) )

theCalcaholic commented 2 months ago

The logs look strange in some places... Could you run the installation (on a fresh system) again with the following command:

curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash |& /var/log/ncp-install.log

That will result in a full installation log file at /var/log/ncp-install.log

ksd73429udmn commented 2 months ago

Sorry for my noobism, but

sudo curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash |& /var/log/ncp-install.log zsh: permission denied: /var/log/ncp-install.log

I can create the file manually and also permissions seem right, but I can not manage to write the logfile

theCalcaholic commented 2 months ago

Ah, sorry, my bad! The correct command is:

curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash |& sudo tee /var/log/ncp-install.log
ksd73429udmn commented 2 months ago

❯ curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash |& sudo tee /var/log/ncp-install.log

WARNING: existing mysqld configuration will be changed <<< The 'nextcloud' database already exists. Aborting

ksd73429udmn commented 2 months ago

The nextcloud installtion seems to be in place, all folders are in /var/www/nextcloud, but ncp-config looks like this and the web-ui is also not accesible.

Screenshot 2024-05-02 at 13 48 44 Screenshot 2024-05-02 at 13 48 49
theCalcaholic commented 2 months ago

You need to reflash the sd with a clean debian installation before attempting the installation of NCP again

ksd73429udmn commented 2 months ago

Hmm, still no luck. ncp-install.log

systemctl status systemd-resolved Unit systemd-resolved.service could not be found.

ksd73429udmn commented 2 months ago

https://forums.debian.net/viewtopic.php?p=790454&sid=c78c1b2ca4badc26978cd4d656f63dbf#p790454

ksd73429udmn commented 2 months ago

Manually installed systemd-resolved . Problem seems resolved. Unfortunatly running into this now:

Running nc-init Setting up a clean Nextcloud instance... wait until message 'NC init done' Setting up database...

FATAL CONFIG FILE ERROR (Redis 7.0.15) Reading the configuration file, at line 2277

'maxmemory' wrong number of arguments

theCalcaholic commented 2 months ago

Hmm, still no luck. ncp-install.log

systemctl status systemd-resolved Unit systemd-resolved.service could not be found.

You're still not installing into a fresh Debian system according to these logs, so you I'm not surprised that this breaks again

theCalcaholic commented 2 months ago

I'm closing this issue for now, because it's an unsupported use case and I'm not sure, if there's actually an issue with the installer if run on a fresh debian system as supposed to.

Feel free to post here again, if you try installing in a supported environment

ksd73429udmn commented 2 months ago

Ok, I see, you are right. I will try flashing the provided image. Thanks for your help so far!

theCalcaholic commented 2 months ago

You're welcome and good luck! :)

NuclearPhoenixx commented 2 months ago

Getting the same error with a clean install of the latest Raspberry Pi OS Lite (Bookworm) that I flashed using the Raspberry Pi Imager:

Applying workaround for dnsmasq bug (compare issue #1446)
+ mkdir -p /etc/systemd/resolved.conf.d
+ systemctl status systemd-resolved
Unit systemd-resolved.service could not be found.
+ systemctl stop resolvconf
Failed to stop resolvconf.service: Unit resolvconf.service not loaded.

it stops after that with an unfinished install just like with @ksd73429udmn. I'm using a Raspberry Pi 4.

ksd73429udmn commented 2 months ago

Same here. I also tried flashing the provided image (NextcloudPi_RaspberryPi5_v1.54.0.zip). It installed and did the inital setup. I was not able to access via SSH though.

NuclearPhoenixx commented 2 months ago

Ah, sorry, my bad! The correct command is:

curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | bash |& sudo tee /var/log/ncp-install.log

Here is the log file: ncp-install.log

This is the same error as described above:

+ systemctl status systemd-resolved
Unit systemd-resolved.service could not be found.
+ systemctl stop resolvconf
Failed to stop resolvconf.service: Unit resolvconf.service not loaded.

Notably, look at these lines just before that, relating to the dnsmasq install:

+ apt-get install --no-install-recommends -y dnsmasq
Reading package lists...
Building dependency tree...
Reading state information...
Suggested packages:
  resolvconf
The following NEW packages will be installed:
  dnsmasq
0 upgraded, 1 newly installed, 0 to remove and 36 not upgraded.

For whatever reason you specify --no-install-recommends, however this results in resolvconf not being installed as well, so obviously it can neither start nor stop the service and stops the install.

I ended up nuking mysql using sudo apt purge mysql* to get rid of the WARNING: existing mysqld configuration will be changed.

Then I manually installed resolvconf and ran the installer again. This time it successfully concluded the install. I'm guessing this whole problem is a result of the new Debian version either not pre-installing resolvconf or no longer requiring it for the install of dnsmasq. Whatever it is, once again, just manually installing resolvconf fixed everything for me. I have opened a PR for this: #1917

How things like this aren't tested even once before pushing a new release is beyond me. Please just run the installer once before release to mitigate issues like this. I wanted to migrate from Bullseye to Bookworm today, which would've been an easy process mainly just re-installing NCP on a fresh image since using a new install is the recommended way for Debian to upgrade. Instead we all had to deal with this now.

ksd73429udmn commented 2 months ago

There is no need to be upset.

theCalcaholic commented 2 months ago

@ksd73429udmn You need to activate NCP via the web browser (go to https://nextcloudpi.local or https://[ncp-ip]). After that you can enable SSH from the admin webinterface

theCalcaholic commented 2 months ago

@NuclearPhoenixx

For whatever reason you specify --no-install-recommends, however this results in resolvconf not being installed

Because that wasn't necessary in any tested scenario and would break (not fix) most installations, because it collides with alternative DNS resolvers like systemd-resolved. NCP favors systemd-resolved over resolvconf, because it's the standard for most non-VM/non-cloud setups nowadays, however resolvconf also works. Generally though, the installer expects you to already have a working network configuration.

How things like this aren't tested even once before pushing a new release is beyond me Behind me lie about two weeks of nonstop testing this release. I don't think you understand the complexity of testing entire operating system setups. However, for your information:

There are automatic tests which are ran on every release (and prevent a release to be published if they fail) which cover the following scenarios:

Running the installer in Raspberry Pi OS is not one of them, because the official support for the Raspberry Pi is provided via the prebuilt images. However, I will still try to fix your configuration.

These automatic tests cover the following:

There are more tests planned, but that's what we have now.

Additional, before a release like this, I'm running countless manual tests on various configurations (aided by volunteers within the NCP community) to see if there are issues that might not be covered by the automatic tests. I'm sorry to hear that the installer didn't work for your specific system configuration, but that risk always exists, especially shortly after swapping the used OS version, which changes lots of services, packages and configurations.

NuclearPhoenixx commented 2 months ago

Because that wasn't necessary in any tested scenario and would break (not fix) most installations, because it collides with alternative network managers like systemd-resolved. NCP favors systemd-resolved over resolvconf, because it's the standard for most non-VM/non-cloud setups nowadays, however resolvconf also works.

I see, so does adding resolvconf to the installer break other installs by any chance? Don't want to cause more harm than good.

Generally though, the installer expects you to already have a working network configuration.

I would expect so too if I'm able to curl the installer. If I understand correctly now, resolvconf is not necessarily the best way to go with new installs, because systemd-resolved is favored. Then why does the installer check resolvconf and crashes if the service isn't there? Sounds like a deeper issue in that it shouldn't be absolutely expecting resolvconf to be there in order to work.

In that case, the installer shouldn't be installing resolvconf like in my PR and instead check for different DNS resolvers for better compat with different systems, no?

I'm sorry to hear that the installer didn't work for your specific system configuration, but that risk always exists, especially shortly after swapping the used OS version, which changes lots of services, packages and configurations.

Like I said, I am using the official, unmodified image of Raspberry Pi OS Lite (64-bit). So nothing out of the ordinary for a Raspberry Pi. I'd have fully expected this issue to get caught in any of the automatic tests. Of course there is always a risk of breakage, more so with a new OS version. However, I'm not running some weird edge case or something, so I'm guessing then this is only a problem with Raspberry Pi OS?

theCalcaholic commented 2 months ago

Then why does the installer check resolvconf and crashes if the service isn't there?

It first checks for systemd-resolved and if that's not found checks for resolvconf. If that's not found either, the installation fails.

In that case, the installer shouldn't be installing resolvconf like in my PR and instead check for different DNS resolvers for better compat with different systems, no?

Yes, exactly, but that's basically what it's doing in dnsmasq.conf. It doesn't seem to find neither resolvconf nor systemd-resolved so maybe Raspberry Pi OS is using something different still? I will check next week when I'm home and have a Raspberry Pi available for testing.

Like I said, I am using the official, unmodified image of Raspberry Pi OS Lite (64-bit). So nothing out of the ordinary for a Raspberry Pi

Generally, because of how hard it is to test images that are meant to run on specific hardware, we don't have installation tests for those boards, but rather provide readily built images (that are, of course, tested) in the releases. That means that the installer will always be more likely to fail when installing on a custom OS for single board computers (other than Armbian, because that's the one we use to build everything). It's still something I intend to support, but I can only react to issues once users found them, while I can actively test the official NCP images.

NuclearPhoenixx commented 2 months ago

It doesn't seem to find neither resolvconf nor systemd-resolved so maybe Raspberry Pi OS is using something different still?

That's my best bet now too. Uninstalling resolvconf after the install did not break anything either, so I presume some package is simply not checked for at install that's being used in Raspberry Pi OS. From what I can tell, Raspberry Pi OS uses the network-manager package. Any chance you can re-open the issue to get more attention to this problem?

@ksd73429udmn Did you try to replicate my method by any chance? Would be good to hear a second opinion on this, if not don't worry about it.

ksd73429udmn commented 2 months ago

Yes, I did exactly the same. But could not get it running on my RP5 like you on RP4. I had another Redis error afterwards. Will try again though with a fresh image and report back.

ksd73429udmn commented 2 months ago

*also running the latest Raspberry Pi OS Lite (64-bit), like you. Vanilla.

REAPERSbattlecry commented 2 months ago

Just for the record. Had the same issue (aborting install at resolve dns) with Debian 12 clean in a VM. Only thing. I use an own dns specified in /etc/network/interfaces. This seesm to cause some trouble. Installed systemd-resolved manually an restarted "networking". Now everything works fine.

ksd73429udmn commented 2 months ago

So I tried again with installing systemd-resolved prior to runnning the script and ran into this now: ...

theCalcaholic commented 2 months ago

@ksd73429udmn That still sounds like there are some remnants from a previous installation of mariadb/mysql - are you running the installer on a system where you tried to run it (or something else) before?