Problem accessing Nextcloud via LAN

[details=“Support intro”]
Nextcloud = 1.20.1
OS = Debian GNU/Linux 10 (buster)
Arch = 5.4.6-sunxi arm71
Hardware = Banana Pi M1

I encountered a bug, a configuration problem or a documentation leak.

After installed nextcloud with the proper image provided by nextcloudpi I setted up console, drives and maschine name via ssh on console.
After rebooting the pi, it comes up, using the proper settings. In the next step I tried to set up nextcloud as described in the HOW-TO.
Even on the first start nextcloud via https://“mypiname.local” wasn’t accessable.
The admin interface was accessable at port 4443, but it seems to be without function.
So I configured via ssh and ncp-config.
After setting up nextcloud proper with ncp-config the access error via https still persists.
As a workaround I did ncp-config / networking / dnsforwarding and in additional ncp-config / networking / nc-forward-ports. After these steps my nextcloud became accessable via https://“mypiname.myddnsprovider”, but NOT via https://“mypiname.local”.

The next morning my nextcloud wasn’t accessable via browser at all. My internet provider is changing my ip in the early morning, and I thought my DDNS provider wasn’t informed by my router. So I checked my record, figuring out that my router works fine, updating my DDNS record after having a new ip address from my provider. Next step was to check out my router, but there where still the proper port forwardings active.
For quick solution I did ncp-config / networking / nc-forward-ports, and after that at least nextcloud was accessable via https://“mypiname.myddnsprovider”.

Next day, the same problem occured again. So decided to investigate a little more and basicly I found out, that the problem is caused renaming my pi to “mypiname”.
In /var/www/nextcloud/config/config.php in trusted domains the records 5, 7 and 8 still had the values nextcloudpi, nextcloudpi.local, nextcloudpi.lan but in my understanding there should be the values “mypiname”, “mypiname.local” and “mypiname.lan”.
After changing the records to “mypiname” and restarting, everything works fine now.

Normaly I shouldn’t edit config.php myself. I suggested that nextcloud put the machine name in the proper places by itself. Or did I “forgot” to tell nextcloud to do so, and how can I do this?

Otherways it might be a bug or, if renaming of a machine is not supported, a hint in the documentation would be usefull for newbies like me.

Thank’s a lot for reading. Would be nice, if this problem and its workaround and proper solve would be documented somewhere.

Kind regards
Elric

A dot (.) is not a valid name of a device, but a separator between different parts of the fully qualified domain name. Make sure that you set the name correctly and must problems will most likely vanish.

Hostnames are domains, where a domain is a hierarchical, dot- separated list of subdomains; for example, the machine “monet”, in the “example” subdomain of the “com” domain would be represented as “monet.example.com”.
Each element of the hostname must be from 1 to 63 characters long and the entire hostname, including the dots, can be at most 253 characters long. Valid characters for hostnames are ASCII(7) letters from a to z , the digits from 0 to 9 , and the hyphen (-). A hostname may not start with a hyphen.

→ hostname(7) - Linux manual page

Fortsetzung der Diskussion von Problem accessing Nextcloud via LAN:

Excuse my improper quoting of device name. I edited the text, now it’s clear, that the name wasn’t the problem. “mypiname” is an alias for the real machine name which is 9 characters long, containing only lowercase characters.

The problem seems to me is the “hard encoded” machine name “nextcloudpi” in config.php, instead of having the real machine name at this place.

Thank you for reading.

Kind regards
Elric

I’m personally not using NextcloudPi but afaik you need to rename the server first on the command line and then adjust the Nextcloud settings accordingly. How this is done the “official” way is described on the NextcloudPi website, e.g. changing the trusted domain setting etc.:

https://docs.nextcloudpi.com/en/how-to-configure-nextcloudpi/
https://docs.nextcloudpi.com/en/configuration-reference/#nc-init

as I described first:
Before I configured nextcloud I opened up a ssh connection:

  1. apt-get install console-data
  2. dpkg-reconfigure keyboard-configuration
  3. udevadm trigger --subsystem-match=input --action=change
  4. nano /etc/hosts
    edited first line 127.0.0.1 localhost “mypiname”
    second line : : 1 localhost “mypiname” ip6-localhost ip6-loopback
    last line 127.0.0.1 “mypiname”
  5. nano /etc/hostname
    just putted “mypiname” there
  6. hostname -F /etc/hostname
  7. shutdown -r now

After additional configuration (set up pi’s sata drive and mounted it in /etc/fstab) I tried to start configration with webbrowser https://“mypiname”.local (as shown in the HOW-TO), but it ended up with the problems described above.

But even if I wouldn’t had the problems: the wizard (configration) under address https://“mypiname”.local:4443/wizard is easy to use for raspberry pi users, but kind of useless for banana pi users which use a sata hdd / ssd and not USB for storage. (It was a specific distrubution from nextcloudpi for banana pi. Therefore I thought the wizard would be costomized for banana pi, but it isn’t)

What about the cli program, couldn’t you use that instead of the web gui?

As I wrote “So I configured via ssh and ncp-config”.

When you have the same problem as I had, you are able accessing the admin interface by adding port “mypiname.mydnsprovider”:4443 BUT everything you do in this webpanel has no output, which meens that it’s not setting your values.
If you keep this webinterface on screen, establish a ssh and do the simular step in ncp-config you have the output for the action not only in ncp-config but although in the webbrowser view. That meens: it’s working.

With other words: if I haven’t had done the configuration with ncp-config, my system wouldn’t work at all.

addum: This morning my nextcloud was accessable via https://“mypiname”.local but not via https://“myipname.myddnsprovider”. So I checked my router, and yes, “mypiname” still has the permission to do upnp. But “mypiname” didn’t claimed any ports. So disabled upnp on my router and at my pi, and added 2 permanent forwardings. After this my nextcloud became accessable from internet, without any futher action.

I think my problem will only occur with image-based installation. If you do a regular install via curl you normally have set machines name before installation. I suppose this way nextcloud will initalize themself with the proper machine name. In the image-based installation everything is preconfigured with “nextcloudpi”. If you do a name-change, nextcloud will not re-init themself with the new machine name.

And that is / was my question: what do I have to do, after I did something like a name-change?