nextcloud / nextcloudpi

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

curl-installer fails on systems without either systemd-resovled or resolvconf #1926

Open Schniefel opened 4 months ago

Schniefel commented 4 months ago

When trying to install nextcloudpi via the curl-script on a freshly flashed Raspberry Pi OS (Bookworm) i get the following error:

Downloading updates Performing updates PHP Warning: Undefined variable $CONFIG in Command line code on line 1 PHP Warning: Trying to access array offset on value of type null in Command line code on line 1 PHP Warning: Undefined variable $CONFIG in Command line code on line 1 PHP Warning: Trying to access array offset on value of type null in Command line code on line 1 Installing clear-php-opcache Installing dnsmasq

Schniefel commented 4 months ago

Update: I was able to install nextcloudpi by running apt install systemd-resolved before running the script

vcbranco commented 4 months ago

Is also a problem with the curl installation on Debian 12 x86_64.

vcbranco commented 4 months ago

In my case, all I had to do was install systemd-resolved, configure the dns server address and then run the script. The curl installation was done correctly.

Schniefel commented 4 months ago

I haven't even configured a dns-server.

vcbranco commented 4 months ago

I had to configure the address of the dns server because after installing systemd-resolved I restarted the server and was left without dns. It probably wouldn't have been necessary to configure the dns if I ran the script without restarting the server after installing the package. But I haven't tested that.

Schniefel commented 4 months ago

right, a restart fixed it for me

darguez commented 4 months ago

When I tried to install nextcloudpi on my Raspberry Pi OS Lite 64-bit Debian 12 (bookworm) via curl script: curl -sSL https://raw.githubusercontent.com/nextcloud/nextcloudpi/master/install.sh | sudo bash I got the same error: Unit systemd-resolved.service could not be found

So, I manually installed the missing package apt install systemd-resolved but I missed DNS with the change and I had to manually add DNS in /etc/systemd/resolved.conf. Also I had to drop the ncp created mysql database sudo mysqladmin drop nextcloud to start over with ncp installation script.

Then the installation went on, but finished with a weird sql error (not sure if the script finished at all): Table "nextcloud.appconfig" doesn't exist

However, I checked ncp installation by accessing https://my-ip/ and the web installer was working, so after the initial setup everything seemed to work fine.

The only thing that wasn't work properly was letsencrypt, because after enabling it (without errors), the certificate was not updated, so I had to edit apache2 site config file to set the correct paths to the certificates in /etc/apache2/sites-enabled/001-nextcloud.conf.

And now everything seems to work fine.

darguez commented 4 months ago

And now everything seems to work fine.

Well, I've just realized the HPB service is always down, so something went wrong with installation after all... Also there is no /var/www/nextcloud/apps/notify_push folder and command /occ notify_push:setup returns:

_There are no commands defined in the "notifypush" namespace.

darguez commented 4 months ago

And now everything seems to work fine.

Well, I've just realized the HPB service is always down, so something went wrong with installation after all... Also there is no /var/www/nextcloud/apps/notify_push folder and command /occ notify_push:setup returns:

_There are no commands defined in the "notifypush" namespace.

It seems "Client Push" app was not installed, so after installing it from appstore and executing occ notify_push:setup HPB service is up now

ovpc commented 4 months ago

I have same issue on Proxmox VM with installer script ends with: Failed to stop resolvconf.service: Unit resolvconf.service not loaded When i install resolv.conf it breaks the dns and apt canot connect anymore

vcbranco commented 4 months ago

You can configure the systemd-resolved to have DNS. https://unix.stackexchange.com/questions/442598/how-to-configure-systemd-resolved-and-systemd-networkd-to-use-local-dns-server-f

Edit: You can just set up the DNS

ovpc commented 4 months ago

Ran curl installer again (on a clean install) to reproduce and get and save full output System is running in Proxmox VM I used debian-12.5-amd64-netinst.iso installed basic system tools and ssh. After reboot installed curl net-tools and sudo, before running installer. ncp-installer-log.txt

Can confirm after installing resolvconf the installer completed fine

m-breitbach commented 1 month ago

Encountering same problem on fresh install (RaspberryPi OS Lite, arm64, Bookworm). Any plans to fix the install script?

e8johan commented 1 month ago

Can confirm on a fresh version of Raspberry Pi OS Lite (64-bit), release date 2024-07-04.

e8johan commented 1 month ago

I had another go tonight. Started from a fresh RaspberryPi OS Lite (64-bit) image, then applies the following tricks to covert to systemd-networkd (over wlan0): https://raspberrypi.stackexchange.com/questions/108592/use-systemd-networkd-for-general-networking . Finally, I ran the nextcloudpi install script and ran into the following (new) error:

Setting up unattended-upgrades (2.9.1+nmu3) ...
locale: Cannot set LC_ALL to default locale: No such file or directory

Creating config file /etc/apt/apt.conf.d/20auto-upgrades with new version

Creating config file /etc/apt/apt.conf.d/50unattended-upgrades with new version
Created symlink /etc/systemd/system/multi-user.target.wants/unattended-upgrades.service → /lib/systemd/system/unattended-upgrades.service.
Synchronizing state of unattended-upgrades.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable unattended-upgrades
Processing triggers for man-db (2.11.2-2) ...
Running unattended-upgrades
Unattended upgrades active: yes (autoreboot true)
NextcloudPi updated to version v1.54.3
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libavahi-core7 libdaemon0
Suggested packages:
  avahi-autoipd
Recommended packages:
  libnss-mdns
The following NEW packages will be installed:
  avahi-daemon libavahi-core7 libdaemon0
The following held packages will be changed:
  avahi-daemon
0 upgraded, 3 newly installed, 0 to remove and 1 not upgraded.
E: Held packages were changed and -y was used without --allow-change-held-packages.

I can see where the holding comes from, but also got the impression that systemd-resolved and avahi-daemon sort of, kind of, did the same job, so I was surprised to see the mix of avahi-daemon and systemd-resolved.

e8johan commented 1 month ago

So, third try it is. I did exactly what I did above, except holding avahi-daemon. Now it seems to work. I'm activating NextCloudPi right now. :-)

theCalcaholic commented 1 month ago

@e8johan Glad to hear you made it work.

Out of curiosity: is there a reason why using the official NCP image for RPi 5 was not an option?

e8johan commented 1 month ago

I guess two parts: first reason is that I did that last time installing NextCloudPi (on a 32-bit install on a Pi3), second reason is the feeling of control - having the user and ssh keys that I'm used to from start, instead of having to add that afterwards for that seamless ssh admin experience ;-)

HervePruvost commented 1 month ago

@e8johan Glad to hear you made it work.

Out of curiosity: is there a reason why using the official NCP image for RPi 5 was not an option?

In my case, I don't use the headless OS but rather the RaspberryPi OS Full with the desktop environment. The NCP image comes with the headless OS only.

So that is practical for me to be able to install NCP ad-hoc afterwards. Instead of having to reinstall desktop environment and related packages separately.

ksd73429udmn commented 1 month ago

Are you still planning to make the curl script work some day? It would also help me a lot.

theCalcaholic commented 1 month ago

@ksd73429udmn I do, after NC 30 support

HervePruvost commented 1 month ago

@ksd73429udmn I do, after NC 30 support

Is there an approximate timeline for this?

theCalcaholic commented 4 weeks ago

@HervePruvost There's an approximate timeline for the NC29 update (should arrive until the end of next week). Other than that, I can't give an ETA