N26/27 : This server has no working internet connection after upgrade

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:


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


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, 20.0.5): 27.1.2
Operating system and version (eg, Ubuntu 20.04): Oracle Linux Server release 8
Apache or nginx version (eg, Apache 2.4.25): 1.20.1
PHP version (eg, 7.4): 8.2.11

The issue you are facing:
Since I migrated to version 26.0.7 then 27.1.2 , In Administration > overview, I have this error :
This server has no working internet connection: Multiple endpoints could not be reached. This means that some of the features like mounting external storage, notifications about updates or installation of third-party apps will not work. Accessing files remotely and sending of notification emails might not work, either. Establish a connection from this server to the internet to enjoy all features.

Is this the first time you’ve seen this error? (Y):
This was working in past without any error. My server has no direct connexion to internet but use proxy.
so DNS lookup is no working directly when I try for example : nslookup www.nextcloud.com, give no response.
but wget www.nextcloud.com, for example, is working because I use proxy.

Output errors in nextcloud.log in /var/www/ :

{"reqId":"ut47NCSoxwaHPiEKbGsQ","level":3,"time":"2023-10-12T14:34:44+02:00","remoteAddr":"x.x.x.x","user":"admin","app":"internet_connection_check","method":"GET","url":"/settings/ajax/checksetup","message":"Cannot connect to: www.nextcloud.com","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36","version":"","exception":{"Exception":"OCP\\Http\\Client\\LocalServerException","Message":"No DNS record found for www.nextcloud.com"
File":"/u01/app/nextcloud_install/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","Line":132,"message":"Cannot connect to: www.nextcloud.com","exception":{},"CustomMessage":"Cannot connect to: www.nextcloud.com"}}

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

  'has_internet_connection' => true,
  'proxy' => 'myproxy:port',

Seems in the file DnsPinMiddleware.php, this add had been done some times ago, causing my error :

              if (empty($targetIps)) {
                      throw new LocalServerException('No DNS record found for ' . $hostName);

When I comment this 3 lines, error connexion disappear and I can again have connexion to internet (when I check Overview page or Apps page to have the update of apps).
Can someone say me if it can be this adding in DnsPinMiddleware.php which can be the root cause ?

Other point : When I made the same upgrade to 26.0.7 then 27.1.2 on another server where connexion internet is UP, all is OK. So I can suppose the modification in DnsPinMiddleware.php can affect a server in a LAN, as in my case. Because my 2 servers have the same configuration.

Thanks for help

Since these lines of code are new: enh: skip processing for empty response · nextcloud/server@03f1f1e · GitHub and the developers themselves cannot always provide all possible environments to test it, so you should file an issue in → the issue tracker ← about the behavior you are observing so that it can be resolved down to the bottom.

Much luck,

Thanks for reponse. I opened [Bug]: N26/27 : This server has no working internet connection after upgrade · Issue #40901 · nextcloud/server · GitHub