Nextcloud server disconnects from wireless network after a few hours

Nextcloud version (eg, 12.0.2): 16.0.3.0
Operating system and version (eg, Ubuntu 17.04): Rraspbian
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.38-3
PHP version (eg, 7.1): 7.3.4-2

The issue you are facing: The server disconnects from the Internet after a while, with wpa_supplicant still running.

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

Steps to replicate it:

  1. Turn on server
  2. Leave for a few hours, could be active/inactive during this time
  3. rPi will still be switched on, but will have disconnected to Internet. wpa_supplicant still running.

The output of your Nextcloud log in Admin > Logging:

I’d have to restart the server for this if I need to access the online “Admin” section, but I want to investigate the server in this state so I can’t get these logs right now.

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

<?php
$CONFIG = array (
  'passwordsalt' => 'REDACTED',
  'secret' => 'REDACTED',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    5 => 'nextcloudpi.local',
    7 => 'nextcloudpi',
    8 => 'nextcloudpi.lan',
    11 => 'REDACTED',
    1 => 'REDACTED',
    2 => 'REDACTED',
    4 => 'REDACTED',
  ),
  'datadirectory' => '/var/www/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '16.0.3.0',
  'overwrite.cli.url' => 'REDACTED',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'ncadmin',
  'dbpassword' => 'REDACTED',
  'installed' => true,
  'instanceid' => 'REDACTED',
  'memcache.local' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => '/var/run/redis/redis.sock',
    'port' => 0,
    'timeout' => 0.0,
    'password' => 'REDACTED',
  ),
  'tempdirectory' => '/var/www/nextcloud/data/tmp',
  'mail_smtpmode' => 'sendmail',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'admin',
  'mail_domain' => 'ownyourbits.com',
  'overwriteprotocol' => 'https',
  'jpeg_quality' => '60',
  'loglevel' => '2',
  'log_type' => 'file',
  'maintenance' => false,
  'twofactor_enforced' => 'true',
  'twofactor_enforced_groups' => 
  array (
    0 => 'admin',
  ),
  'twofactor_enforced_excluded_groups' => 
  array (
  ),
  'theme' => '',
);

The output of your Apache/nginx/system log in /var/log/____:

First time opening this folder and there are a lot of things in here (60 files, most of them archives). There are two logs called error.log and error.log.1. error.log:

[Wed Aug 21 00:00:02.376393 2019] [ssl:warn] [pid 857:tid 1996074400] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Wed Aug 21 00:00:02.378530 2019] [mpm_event:notice] [pid 857:tid 1996074400] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1c configured -- resuming normal operations
[Wed Aug 21 00:00:02.378575 2019] [core:notice] [pid 857:tid 1996074400] AH00094: Command line: '/usr/sbin/apache2'

error.log.1:

[Tue Aug 20 00:00:02.742772 2019] [ssl:warn] [pid 883:tid 1995759008] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 20 00:00:02.744916 2019] [mpm_event:notice] [pid 883:tid 1995759008] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1c configured -- resuming normal operations
[Tue Aug 20 00:00:02.744974 2019] [core:notice] [pid 883:tid 1995759008] AH00094: Command line: '/usr/sbin/apache2'
[Tue Aug 20 08:17:25.278037 2019] [ssl:warn] [pid 732:tid 1995820448] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 20 08:17:25.319590 2019] [ssl:warn] [pid 882:tid 1995820448] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 20 08:17:25.325273 2019] [mpm_event:notice] [pid 882:tid 1995820448] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1c configured -- resuming normal operations
[Tue Aug 20 08:17:25.325430 2019] [core:notice] [pid 882:tid 1995820448] AH00094: Command line: '/usr/sbin/apache2'
[Tue Aug 20 22:37:14.594439 2019] [mpm_event:notice] [pid 882:tid 1995820448] AH00491: caught SIGTERM, shutting down
[Tue Aug 20 22:37:36.952483 2019] [ssl:warn] [pid 704:tid 1995378080] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 20 22:37:37.012490 2019] [ssl:warn] [pid 882:tid 1995378080] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 20 22:37:37.019237 2019] [mpm_event:notice] [pid 882:tid 1995378080] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1c configured -- resuming normal operations
[Tue Aug 20 22:37:37.019391 2019] [core:notice] [pid 882:tid 1995378080] AH00094: Command line: '/usr/sbin/apache2'
[Tue Aug 20 22:41:08.610337 2019] [mpm_event:notice] [pid 882:tid 1995378080] AH00491: caught SIGTERM, shutting down
[Tue Aug 20 22:41:31.033122 2019] [ssl:warn] [pid 708:tid 1996144032] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 20 22:41:31.109475 2019] [ssl:warn] [pid 878:tid 1996144032] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 20 22:41:31.115543 2019] [mpm_event:notice] [pid 878:tid 1996144032] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1c configured -- resuming normal operations
[Tue Aug 20 22:41:31.115713 2019] [core:notice] [pid 878:tid 1996144032] AH00094: Command line: '/usr/sbin/apache2'
[Tue Aug 20 23:21:34.342092 2019] [mpm_event:notice] [pid 878:tid 1996144032] AH00491: caught SIGTERM, shutting down
[Tue Aug 20 23:22:03.136906 2019] [ssl:warn] [pid 683:tid 1996074400] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 20 23:22:03.187025 2019] [ssl:warn] [pid 857:tid 1996074400] AH01909: localhost:4443:0 server certificate does NOT include an ID which matches the server name
[Tue Aug 20 23:22:03.193080 2019] [mpm_event:notice] [pid 857:tid 1996074400] AH00489: Apache/2.4.38 (Raspbian) OpenSSL/1.1.1c configured -- resuming normal operations
[Tue Aug 20 23:22:03.193243 2019] [core:notice] [pid 857:tid 1996074400] AH00094: Command line: '/usr/sbin/apache2'
[Wed Aug 21 00:00:02.342109 2019] [mpm_event:notice] [pid 857:tid 1996074400] AH00493: SIGUSR1 received.  Doing graceful restart

I restarted the server at about midnight. I think syslog after this point is most interesting:

Aug 21 02:21:03 nextcloudpi kernel: [10752.335710] [UFW BLOCK] IN=wlan0 OUT= MAC=01:00:5e:00:00:01:54:64:d9:21:7d:88:08:00 SRC=192.168.1.254 DST=224.0.0.1 LEN=36 TOS=0x00 PREC=0xC0 TTL=1 ID=0 DF PROTO=2 
Aug 21 02:22:34 nextcloudpi dhcpcd[576]: wlan0: carrier lost
Aug 21 02:22:34 nextcloudpi dhcpcd[576]: wlan0: deleting address fe80::bce6:ebbd:333:f73c
Aug 21 02:22:34 nextcloudpi avahi-daemon[392]: Withdrawing address record for fe80::bce6:ebbd:333:f73c on wlan0.
Aug 21 02:22:34 nextcloudpi avahi-daemon[392]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::bce6:ebbd:333:f73c.
Aug 21 02:22:34 nextcloudpi avahi-daemon[392]: Interface wlan0.IPv6 no longer relevant for mDNS.
Aug 21 02:22:34 nextcloudpi avahi-daemon[392]: Withdrawing address record for 192.168.1.177 on wlan0.
Aug 21 02:22:34 nextcloudpi avahi-daemon[392]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.177.
Aug 21 02:22:34 nextcloudpi avahi-daemon[392]: Interface wlan0.IPv4 no longer relevant for mDNS.
Aug 21 02:22:34 nextcloudpi dhcpcd[576]: wlan0: deleting route to 192.168.1.0/24
Aug 21 02:22:34 nextcloudpi dhcpcd[576]: wlan0: deleting default route via 192.168.1.254
Aug 21 02:22:38 nextcloudpi wicd[393]: sending commands to master dhcpcd process
Aug 21 02:22:38 nextcloudpi dhcpcd[9533]: sending commands to master dhcpcd process
Aug 21 02:22:38 nextcloudpi dhcpcd[576]: control command: /sbin/dhcpcd -k wlan0
Aug 21 02:22:38 nextcloudpi dhcpcd[576]: wlan0: removing interface
Aug 21 02:22:38 nextcloudpi kernel: [10847.936561] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Aug 21 02:22:38 nextcloudpi kernel: [10847.936586] brcmfmac: power management disabled
Aug 21 02:22:39 nextcloudpi wicd[393]: sending commands to master dhcpcd process
Aug 21 02:22:39 nextcloudpi dhcpcd[9566]: sending commands to master dhcpcd process
Aug 21 02:22:39 nextcloudpi dhcpcd[576]: control command: /sbin/dhcpcd -k eth0
Aug 21 02:22:39 nextcloudpi dhcpcd[576]: eth0: removing interface
Aug 21 02:22:39 nextcloudpi kernel: [10848.231782] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Aug 21 02:22:39 nextcloudpi kernel: [10848.231813] 8021q: adding VLAN 0 to HW filter on device eth0
Aug 21 02:22:39 nextcloudpi wicd[393]: Failed to connect to non-global ctrl_ifname: eth0  error: No such file or directory
Aug 21 02:22:43 nextcloudpi kernel: [10852.195720] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Aug 21 02:22:43 nextcloudpi kernel: [10852.195765] brcmfmac: power management disabled
Aug 21 02:27:23 nextcloudpi ddclient[834]: WARNING:  cannot connect to checkip.dyndns.org:80 socket: IO::Socket::INET: Bad hostname 'checkip.dyndns.org'
Aug 21 02:30:01 nextcloudpi CRON[9787]: (www-data) CMD (php -f /var/www/nextcloud/cron.php)
Aug 21 02:32:23 nextcloudpi ddclient[834]: WARNING:  cannot connect to checkip.dyndns.org:80 socket: IO::Socket::INET: Bad hostname 'checkip.dyndns.org'
Aug 21 02:36:03 nextcloudpi wicd[393]: Starting automatic reconnect process
Aug 21 02:36:03 nextcloudpi wicd[393]: Starting automatic reconnect process
Aug 21 02:36:03 nextcloudpi wicd[393]: Starting automatic reconnect process
Aug 21 02:36:03 nextcloudpi wicd[393]: Starting automatic reconnect process
Aug 21 02:36:03 nextcloudpi wicd[393]: Throttling autoreconnect

The log from then on is nextcloudpi wicd[393]: Throttling autoreconnect almost constantly. Does anyone have any ideas what’s going on? Thanks

e: Even if the disconnect is normal, I guess the issue is that the Pi is unable to then reconnect to the network. In fact, despite wpa_supplicant still running, raspi-config will complain that it “Could not communicate with wpa_supplicant”. Not sure if that’s related.

This problem is likely not nextcloud related. Here is what I found googling. It might help you:
https://www.raspberrypi.org/forums/viewtopic.php?f=36&t=234058&p=1432916#p1432916

you should configure your server with a fixed ip (instead of dhcp) and (at least some form of local) dns if you intend for services to work.
GOOD LUCK!

wpa_supplicant is the service that manages the wireless connection. The cause of a wireless disconnect could be any sort of hardware or software issue, poor signal, channel interference, problem on the access point, etc… However it is not likely Nextcloud related in any fashion. I would start by troubleshooting it as any other WiFi problem.

While true, this is also likely unrelated to the problem. What he’s describing is a lower level network issue than IP.

of course meaning configure all relevant parts of your system to keep the connection up at all times, if necessary, re-connect.
CHEERS, pd

I would start by troubleshooting it as any other WiFi problem.

I’ll do this. I’d just like to add that this problem has arisen seemingly out of nowhere – that is, the server has been fine for a few months now. afaik nothing’s changed and now it’s unable to reconnect.

When you say it disconnects from the internet, you mean the WiFi connection disconnects? Or is it still connected but unresponsive? Could you possibly cable it to see if that fixes it?

When you say it disconnects from the internet, you mean the WiFi connection disconnects? Or is it still connected but unresponsive?

I don’t know what you mean, but I think it just disconnects. I can’t ssh into it from any other machine, but the rPi is still running

I can’t test it with a cable anytime soon unfortunately.

It may be an overheating problem. And that the system dies. Is there any way you can look at the temperature near that time frame?

Hey guys,

I’m facing the very same problem the OT posted. Can any of you commenters confirm if you face the problem, too?
I am pretty sure that we have a reproducible problem that somehow propagated in to our envs through the upgrade of either raspbian (buster?), wpa_supplicant, raspi 3b(+) wifi driver or maybe an other part of the os. While suspecting the above systems, I am also kind of confident that neither NC nor NCP themselves are not the root cause (apache, php, db, redis).

My observations and specs:
I used the same RPI, at the same physical location and with the same Router successfully for several months without said connectivity problems. My router logs show that the RPI gracefully disconnected itself from the Router. I only update my os and nc through NCP utils.
The below logs show that all interfaces (eth0 and wlan0) randomly get shut down and routes get deleted. So just bringing up the interface itself is not sufficent. A Restart of the Raspberry does the trick and brings everything up again, however this breaks again within the next day.

Env:

Router: Fritzbox 7560 - DHCP enabled
DNS: Pihole on Raspberry 1B
NCP HW: Raspberry PI 3b+
NCP OS: Raspbian 10 (Buster) - updates only run through nextcloudpi
NCP Kernel: Linux nextcloudpi 4.19.66-v7+ #1253 SMP Thu Aug 15 11:49:46 BST 2019 armv7l GNU/Linux
NCP Interfaces: using onboard wifi - ipv4 addr fixed in router’s dhcp and ipv6 autogenerated through raspbian

syslog from wifi drop
pi@ncp:/var/log $ grep "Oct  8 10:" syslog | grep -v CRON | grep -v postfix

Oct 8 10:09:01 nextcloudpi systemd[1]: Starting Clean php session files…
Oct 8 10:09:01 nextcloudpi sessionclean[14793]: Cannot load Zend OPcache - it was already loaded
Oct 8 10:09:02 nextcloudpi systemd[1]: phpsessionclean.service: Succeeded.
Oct 8 10:09:02 nextcloudpi systemd[1]: Started Clean php session files.
Oct 8 10:32:08 nextcloudpi dhcpcd[514]: wlan0: DHCPv6 REPLY: in stateless mode
Oct 8 10:39:01 nextcloudpi systemd[1]: Starting Clean php session files…
Oct 8 10:39:01 nextcloudpi sessionclean[16975]: Cannot load Zend OPcache - it was already loaded
Oct 8 10:39:02 nextcloudpi systemd[1]: phpsessionclean.service: Succeeded.
Oct 8 10:39:02 nextcloudpi systemd[1]: Started Clean php session files.
Oct 8 10:57:39 nextcloudpi dhcpcd[514]: wlan0: carrier lost
Oct 8 10:57:39 nextcloudpi dhcpcd[514]: wlan0: deleting address fd00::ba27:ebff:fe5e:89a8/64
Oct 8 10:57:39 nextcloudpi dhcpcd[514]: wlan0: deleting address 2001:XXXXXXXXXX
Oct 8 10:57:39 nextcloudpi dhcpcd[514]: wlan0: deleting route to fd00::/64
Oct 8 10:57:39 nextcloudpi dhcpcd[514]: wlan0: deleting route to 2001:xxxxxxxxxxxxxx
Oct 8 10:57:39 nextcloudpi dhcpcd[514]: wlan0: deleting default route via fe80::7eff:4dff:fe97:49ee
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Withdrawing address record for fd00::ba27:ebff:fe5e:89a8 on wlan0.
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Withdrawing address record for 2001:XXXXXXXXXXXXXXXXXXX on wlan0.
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Leaving mDNS multicast group on interface wlan0.IPv6 with address 2001:XXXXXXXXXXX.
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::ba27:ebff:fe5e:89a8.
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Registering new address record for fe80::ba27:ebff:fe5e:89a8 on wlan0.*.
Oct 8 10:57:39 nextcloudpi dhcpcd[514]: wlan0: deleting address fe80::ba27:ebff:fe5e:89a8
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Withdrawing address record for fe80::ba27:ebff:fe5e:89a8 on wlan0.
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::ba27:ebff:fe5e:89a8.
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Interface wlan0.IPv6 no longer relevant for mDNS.
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Withdrawing address record for 192.168.178.26 on wlan0.
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.178.26.
Oct 8 10:57:39 nextcloudpi avahi-daemon[286]: Interface wlan0.IPv4 no longer relevant for mDNS.
Oct 8 10:57:39 nextcloudpi dhcpcd[514]: wlan0: deleting route to 192.168.178.0/24
Oct 8 10:57:39 nextcloudpi dhcpcd[514]: wlan0: deleting default route via 192.168.178.1
Oct 8 10:57:44 nextcloudpi dhcpcd[18487]: sending commands to master dhcpcd process
Oct 8 10:57:44 nextcloudpi dhcpcd[514]: control command: /sbin/dhcpcd -k wlan0
Oct 8 10:57:44 nextcloudpi dhcpcd[514]: wlan0: removing interface
Oct 8 10:57:44 nextcloudpi kernel: [58675.147503] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Oct 8 10:57:44 nextcloudpi kernel: [58675.147514] brcmfmac: power management disabled
Oct 8 10:57:44 nextcloudpi dhcpcd[18520]: sending commands to master dhcpcd process
Oct 8 10:57:44 nextcloudpi dhcpcd[514]: control command: /sbin/dhcpcd -k eth0
Oct 8 10:57:44 nextcloudpi dhcpcd[514]: eth0: removing interface
Oct 8 10:57:45 nextcloudpi kernel: [58675.486597] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
Oct 8 10:57:45 nextcloudpi kernel: [58675.486614] 8021q: adding VLAN 0 to HW filter on device eth0
Oct 8 10:57:48 nextcloudpi kernel: [58679.407957] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
Oct 8 10:57:48 nextcloudpi kernel: [58679.407990] brcmfmac: power management disabled

Has anyone tried to downgrade the os or the wifi drivers or alternatively dug into debug logs of those.

Cheers,
Dom

Hi guys! Is there any solution to the problem yet?

I am facing the very same problem on my system as well now. It appearantly happened to me after an update to Raspian Buster. Before I was running on Stretch and it never had these problems for over a year before.

The server looses internet connection after a random time span. Can’t ssh into it anymore but from what I can read in the logs the system is still running. In /var/log/syslog it lists tons of “Throttling autoreconnect” messages

I think it is a Raspian Buster or Debian Buster - problem and no nextcloud problem. Ask in an Raspian or debian forum. I also have problems with wlan (Debian Buster). I use sometime my wlan client TL-WR802N . Can you not use LAN?

Sadly no… I am depending on WiFi. This seems to be a common problem with Buster but there are no known good solutions that can be found

Yes. 20 euros for additional hardware. You can use client mode or wisp client mode.

https://www.tp-link.com/de/support/faq/2524/
https://www.tp-link.com/us/support/faq/2526/