Nextcloud server is only intermittently accessible after switching ISPs/routers/static IPs

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

example

Or for longer, use three backticks above and below the code snippet:

longer
example
here

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 29.0.5): 29.0.6.1
Operating system and version (eg, Ubuntu 24.04): Linux 6.1.0-0.deb11.21-amd64 x86_64 (OpenMediaVault 6.9.16-1)
Apache or nginx version (eg, Apache 2.4.25): nginx, can't find the version
PHP version (eg, 8.3): 8.3.10

The issue you are facing:
On Thursday, I switched to a new ISP (AT&T Fiber) which required the use of their own router (the BGW320). The new router would not allow my Nextcloud server to have the same static IP address. Ever since the ISP change/new router/new static IP, my server has only allowed intermittent connection.

I have 3 methods of accessing Nextcloud:

  1. Phone using the Android Nextcloud app - this has not been able to connect to the server at all.
  2. Desktop using the Windows Nextcloud app - this syncs ~50% of the time, and the rest of the time cannot access the server (“Host not found”, etc).
  3. Browser via duckdns - this also works ~50% of the time, and the rest of the time cannot access the server.

Note that the desktop & browser issues do not seem to coincide - for example at the moment my Windows app cannot connect to the Nextcloud server, but I’m accessing it via browser with no problem.

I have updated my config.php with the appropriate new static IP.
I have also set up the same port forwarding in my new router as my old router.

The int

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

Steps to replicate it: N/A

The output of your Nextcloud log in Admin > Logging:

Error	PHP	
Allowed memory size of 536870912 bytes exhausted (tried to allocate 12288 bytes) at /config/www/nextcloud/apps/logreader/lib/Log/LogIterator.php#89
# Several similar errors are the only entries since the new router/ISP switch

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

<?php
$CONFIG = array (
  'datadirectory' => '/data',
  'instanceid' => 'XXXX',
  'passwordsalt' => 'XXXX',
  'secret' => 'XXXX',
  'trusted_domains' =>
  array (
    0 => '192.168.1.202:450',
    1 => 'nextcloud.XXXXX.duckdns.org',
  ),
  'dbtype' => 'mysql',
  'version' => '29.0.6.1',
  'dbname' => 'nextcloud',
  'dbhost' => 'mariadb',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'XXXX',
  'dbpassword' => 'XXXX',
  'installed' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => 'true',
  'memcache.locking' => '\\OC\\Memcache\\APCu',
  'overwritehost' => 'nextcloud.XXXXX.duckdns.org',
  'overwriteprotocol' => 'https',
  'overwrite.cli.url' => 'https://nextcloud.XXXXX.duckdns.org',
  'loglevel' => 2,
  'maintenance' => false,
  'upgrade.disable-web' => true,
);

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

cat error.log
2024/09/10 11:55:34 [error] 435#435: *861 upstream timed out (110: Operation timed out) while reading response header from upstream, client: 192.168.1.254, server: _, request: "GET /settings/ajax/checksetup HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.XXXX.duckdns.org", referrer: "https://nextcloud.XXXXX.duckdns.org/settings/admin/overview"
2024/09/10 11:57:08 [error] 437#437: *893 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Allowed memory size of 536870912 bytes exhausted (tried to allocate 20480 bytes) in /config/www/nextcloud/apps/logreader/lib/Log/LogIterator.php on line 68" while reading response header from upstream, client: 192.168.1.254, server: _, request: "GET /apps/logreader/api/poll?lastReqId=ZVAu6nRBds0oDEZY2sg6 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "nextcloud.XXXXX.duckdns.org", referrer: "https://nextcloud.XXXXX.duckdns.org/settings/admin/logging"

Output errors in nextcloud.log in /var/www/ or as admin user in top right menu, filtering for errors. Use a pastebin service if necessary.

See the PHP memory size errors above.

I assume you need to use a dynamic DNS service to make sure that name resolution is working. Further details can e.g. be found here:

https://www.comparitech.com/net-admin/dynamic-dns-providers/

j-ed, thank you for the reply. I should have mentioned that - I do use DuckDNS for name resolution, which appears to be working correctly.

The new static IP is referring to the IP on my home network.

  • If the IP address is up-to-date how should your provider block an access?
  • Are you speaking about an IPv4 or IPv6 address?

This is an IPv4 address.

Sorry, I’m not sure I understand your first question. I hope that my provider is not blocking access.

Okay, I think I have found the issue, although not the fix or cause.

It seems that only one client can connect to Nextcloud at a time.
If my Windows app is connected, accessing via browser or Android will not work. But if I close the Windows app, I’m able to access Nextcloud via browser, or sync from my phone - as long as I don’t try to do both at once.

Does anyone understand why this might happen, or how I could debug this further?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.