Switching from WiFi to Ethernet -> Nextcloud no longer reachable


first of all, here the details:

Nextcloud version (eg, 12.0.2): 18.0.3
Operating system and version (eg, Ubuntu 17.04): Raspbian Buster Linux rpi4 4.19.97-v7l+ #1294 SMP Thu Jan 30 13:21:14 GMT 2020 armv7l GNU/Linux
Apache or nginx version (eg, Apache 2.4.25): Default NextcloudPi

NextCloudPi version v1.24.0
NextCloudPi image NextCloudPi_docker_04-06-20
distribution Debian GNU/Linux 10 \n \l
automount no
USB devices sda sdb
datadir /data/nextcloud/data
data in SD yes
data filesystem ext2/ext3
data disk usage 6.2G/29G
rootfs usage 6.2G/29G
swapfile /var/swap
dbdir /data/database
Nextcloud check ok
Nextcloud version
HTTPD service up
PHP service up
MariaDB service up
Redis service up
Postfix service up
internet check ok
port check 80 closed
port check 443 closed
interface eth0
certificates none
NAT loopback no
uptime 6min

PHP version (eg, 7.1): Default NextcloudPi

The issue you are facing:
I have just set up a Raspberry Pi 4 with docker as my new “home server”.
It uses the latest raspian buster. I installed docker and nginx as reverse proxy. I also use NextcloudPI as docker container.
Everything works as expected, as long as my Raspberry Pi uses the WiFi network interface. Now I have installed some cables and would like to have it use the wired connection.
During configuration I made sure to always only use the hostname of the raspberry: “rpi4”. So I disabled WiFi on the RPI in “/boot/config.txt” and plugged in the ethernet cable. The nginx docker container is reachable, portainer docker container also. Also the NextcloudPi Admin Webinterface is reachable, but I can’t connect to the Nextcloud in any way (unreachable). I have no Idea where to look, but expect it to be some kind of Nextcloud configuration, but couldn’t find anything.
If I reactivate WiFi, everything works again.

Here is my docker-compose.yml
pi@rpi4:~ $ cat docker-compose.yml
version: “3”
image: jc21/nginx-proxy-manager:latest
restart: unless-stopped
container_name: nginx-proxy-manager
# Public HTTP Port:
- ‘80:80’
# Public HTTPS Port:
- ‘443:443’
# Admin Web Port:
- ‘81:81’
# Make sure this config.json file exists as per instructions above:
- /mnt/usb1/nginx-proxy-manager/config.json:/app/config/production.json
- /mnt/usb1/nginx-proxy-manager/data:/data
- /mnt/usb1/nginx-proxy-manager/letsencrypt:/etc/letsencrypt
- mariadb
image: yobasystems/alpine-mariadb:latest
restart: unless-stopped
container_name: mariadb
- /mnt/usb1/nginx-proxy-manager/mysql:/var/lib/mysql
image: ownyourbits/nextcloudpi:latest
- “4444:443”
- “4443:4443”
- /mnt/usb1/nextcloudpi:/data
- /etc/localtime:/etc/localtime:ro
container_name: nextcloudpi
restart: unless-stopped
image: portainer/portainer
command: -H unix:///var/run/docker.sock
restart: unless-stopped
- 9000:9000
- 8000:8000
container_name: portainer
- /var/run/docker.sock:/var/run/docker.sock
- /mnt/usb1/portainer/data:/data

Is this the first time you’ve seen this error? (Y/N):
Steps to replicate it:

  1. Install Docker on RPI (all over wifi)
  2. Install nextcloudpi Docker Container
  3. Configure containers
  4. Switch of WiFi and use ethernet

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

pi@rpi4:~ $ sudo cat /mnt/usb1/nextcloudpi/nextcloud/config/config.php

$CONFIG = array (
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    11 => '',
    1 => '',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
    20 => 'rpi4',
    21 => 'nextcloud.MYNAME.duckdns.org',
  'datadirectory' => '/data/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'http://localhost',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => ''
  'installed' => true,
  'instanceid' => 'ocof344kq2sc',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => '',
  'tempdirectory' => '/var/www/nextcloud/data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'overwriteprotocol' => 'https',
  'overwritehost' => 'nextcloud.MYNAME.duckdns.org:4444',
  'maintenance' => false,

I am glad for any hint!!!

Kind regards

Looks like a Docker issue…

Thanks for the reply!!!

I solved the issue. The error was caused by my Fritzbox. The raspberry has the same name obviously both when connecting via WiFi or ethernet, so regardless of the connection I could reach it using the name. This does not seem to be the case for port forwarding, where although the UI makes you believe you forwarded the ports to the name RPI4, you forward them to the IP. So after deleting and recreating the portforwarding, everything is fine.

Have a good day folks!