DNS error, can't connect via domain anymore

Nextcloud version: 22.2.2.0
Operating system and version: NextCloudPi 1.46.7 (Debian GNU/Linux 10. 5.10.63-v8+)
NextcloudPi image: NextCloudPi_11-27-20
Database: mysql 10.3.31
PHP version: 7.3.31-1~deb10u1
Modules loaded: Core, date, libxml, openssl, pcre, zlib, filter, hash, Reflection, SPL, sodium, session, standard, cgi-fcgi, mysqlnd, PDO, xml, bcmath, bz2, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, gmp, iconv, igbinary, intl, json, ldap, exif, mysqli, pdo_mysql, Phar, posix, readline, redis, shmop, SimpleXML, smbclient, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, libsmbclient, Zend OPcache

Seemingly after my FritzBox had been updated (or it could have been a Nextcloud update as well, I can’t pinpoint the exact date) I can’t to open Nextcloud from my domain anymore, it won’t load due to a DNS error: albistorage.cloudns.cl’s DNS address could not be found. On my local network everything works fine and . All the necessary ports are open, too. I contacted the provider ClouDNS and they told me that the automatic IP redirection for DDNS is working fine (using a crontab job), but that there is a server error whenever trying to connect and gave me these details:

wget albistorage.cloudns.cl
--2022-01-22 13:55:08-- http://albistorage.cloudns.cl/
Resolving albistorage.cloudns.cl (albistorage.cloudns.cl)... 95.112.89.205
Connecting to albistorage.cloudns.cl (albistorage.cloudns.cl)|95.112.89.205|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://albistorage.cloudns.cl/ [following]
--2022-01-22 13:55:08-- https://albistorage.cloudns.cl/
Connecting to albistorage.cloudns.cl (albistorage.cloudns.cl)|95.112.89.205|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://albistorage.cloudns.cl/index.php/login [following]
--2022-01-22 13:55:28-- https://albistorage.cloudns.cl/index.php/login
Reusing existing connection to albistorage.cloudns.cl:443.
HTTP request sent, awaiting response...

The output of your Nextcloud log in Admin > Logging:

Warning	no app in context	Host 192.168.178.25 was not connected to because it violates local access rules		2022-01-22T13:12:29+0100
Warning	no app in context	Host 192.168.178.25 was not connected to because it violates local access rules		2022-01-22T02:14:33+0100
Warning	no app in context	Host 192.168.178.25 was not connected to because it violates local access rules		2022-01-22T01:52:43+0100
Warning	no app in context	Host 192.168.178.25 was not connected to because it violates local access rules		2022-01-22T01:27:45+0100
Warning	appstoreFetcher	Could not connect to appstore: cURL error 7: Failed to connect to apps.nextcloud.com port 443: Connection timed out (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json		2022-01-21T07:25:35+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 9134080 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-16T17:08:27+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 5496832 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-16T17:08:27+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 9265152 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-16T17:08:27+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 2809856 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-16T17:08:27+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 9068544 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-16T06:01:53+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 4841472 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-16T06:01:53+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 352256 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-16T06:01:53+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: System is in maintenance mode.		2022-01-16T04:00:11+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 3465216 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-15T22:10:23+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 2400256 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-15T22:10:23+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 5808128 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-15T22:10:23+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 10485760 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 8478720 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-15T22:10:19+0100
Error	no app in context	Sabre\DAV\Exception\BadRequest: Expected filesize of 734003200 bytes but read (from Nextcloud client) and wrote (to Nextcloud storage) 173449216 bytes. Could either be a network problem on the sending side or a problem writing to the storage on the server side.		2022-01-15T00:31:26+0100
Warning	appstoreFetcher	Could not connect to appstore: cURL error 28: Operation timed out after 60001 milliseconds with 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json		2022-01-14T07:26:05+0100
Warning	no app in context	Host 192.168.178.25 was not connected to because it violates local access rules		2022-01-13T12:50:22+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: System is in maintenance mode.		2022-01-13T04:00:35+0100
Fatal	webdav	Sabre\DAV\Exception\ServiceUnavailable: System is in maintenance mode.		2022-01-13T04:00:20+0100

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

{
    "passwordsalt": "***REMOVED SENSITIVE VALUE***",
    "secret": "***REMOVED SENSITIVE VALUE***",
    "trusted_domains": {
        "0": "localhost",
        "5": "nextcloudpi.local",
        "7": "nextcloudpi",
        "8": "nextcloudpi.lan",
        "11": "2a01:c22:9124:4400:837f:47a:1b97:87a1",
        "1": "192.168.178.25",
        "20": "albistorage.cloudns.cl",
        "12": "albistorage.cloudns.cl",
        "3": "nextcloudpi",
        "": "nextcloudpi",
        "14": "nextcloudpi"
    },
    "datadirectory": "***REMOVED SENSITIVE VALUE***",
    "dbtype": "mysql",
    "version": "22.2.2.0",
    "overwrite.cli.url": "https:\/\/nextcloudpi\/",
    "dbname": "***REMOVED SENSITIVE VALUE***",
    "dbhost": "***REMOVED SENSITIVE VALUE***",
    "dbport": "",
    "dbtableprefix": "oc_",
    "mysql.utf8mb4": true,
    "dbuser": "***REMOVED SENSITIVE VALUE***",
    "dbpassword": "***REMOVED SENSITIVE VALUE***",
    "installed": true,
    "instanceid": "***REMOVED SENSITIVE VALUE***",
    "memcache.local": "\\OC\\Memcache\\Redis",
    "memcache.locking": "\\OC\\Memcache\\Redis",
    "redis": {
        "host": "***REMOVED SENSITIVE VALUE***",
        "port": 0,
        "timeout": 0,
        "password": "***REMOVED SENSITIVE VALUE***"
    },
    "tempdirectory": "\/media\/myCloudDrive\/ncdata\/tmp",
    "mail_smtpmode": "smtp",
    "mail_from_address": "***REMOVED SENSITIVE VALUE***",
    "mail_domain": "***REMOVED SENSITIVE VALUE***",
    "preview_max_x": "2048",
    "preview_max_y": "2048",
    "jpeg_quality": "60",
    "overwriteprotocol": "https",
    "maintenance": false,
    "logfile": "\/media\/myCloudDrive\/ncdata\/nextcloud.log",
    "loglevel": "2",
    "log_type": "file",
    "mail_sendmailmode": "smtp",
    "mail_smtpauthtype": "LOGIN",
    "mail_smtpauth": 1,
    "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
    "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
    "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
    "theme": "",
    "updater.release.channel": "stable",
    "has_rebuilt_cache": true,
    "trusted_proxies": "***REMOVED SENSITIVE VALUE***"
}

How can I further track down the problem? What could I do to debug it, because it seems like a thousand things could be the reason? Again, in my LAN everything works fine. My NCP is sucessfully connected to the internet, retrieving data like weather information. It’s just that I can’t access it anymore through my custom domain, although DDNS and port forwarding are configured properly.

I think it is not a DNS error. 302 is normal.
Please re-test and post only new logs and errors.

Well, if I now try to connect through my browser, I get this error message: albistorage.cloudns.cl’s DNS address could not be found. Diagnosing the problem.

Since the last log, these were the new entries:

Warning	appstoreFetcher	Could not connect to appstore: cURL error 28: Operation timed out after 60001 milliseconds with 0 out of 0 bytes received (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json		2022-01-24T07:26:05+0100
Warning	no app in context	Login failed: ergwergeg (Remote IP: 83.144.131.164)		2022-01-23T23:57:25+0100
Warning	core	Renewing session token failed		2022-01-23T23:14:39+0100
Warning	no app in context	Host 192.168.178.25 was not connected to because it violates local access rules		2022-01-22T13:12:29+0100
Warning	no app in context	Host 192.168.178.25 was not connected to because it violates local access rules		2022-01-22T02:14:33+0100

Hi @timothys_monster

Does this also happen if you try to access your Nextcloud from externally, e.g. from a cell phone via a cellular connection?

--2022-01-22 13:55:08-- http://albistorage.cloudns.cl/
Resolving albistorage.cloudns.cl (albistorage.cloudns.cl)... 95.112.89.205
Connecting to albistorage.cloudns.cl (albistorage.cloudns.cl)|95.112.89.205|:80... connected.
HTTP request sent, awaiting response... 302 Found

This means that DNS resolves to a public IP address, which is normal if you use an external DNS service.

Check if it resolves to the current public IP address of your internet connection. You can check your public IP address here: https://whatismyipaddress.com/. Also check if Ports 80 and 443 are forwarded to the correct internal IP address in your router setup.

In order for connections to work from the internal network (LAN), either NAT Loopback / NAT Reflection must be active in your router or an internal DNS server must be present, which resolves your domain name to the correct local IP address.

Warning	appstoreFetcher	Could not connect to appstore: cURL error 7: Failed to connect to apps.nextcloud.com port 443: Connection timed out (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://apps.nextcloud.com/api/v1/apps.json		2022-01-21T07:25:35+0100

This means that the site apps.nextcloud.com was not accessible. Either the server had no Internet connection or the page was offline at that time. Check if your server has internet connection. If e.g. apt update works, everything is ok and you can ignore the message.

Wow, I can’t believe it didn’t cross my mind to check on cellular connection. It actually works.
The dynamic IP address resolves fine through the crontab job. I just got it confirmed by the people from ClouDNS, too.
sudo apt update works. So internet is connected properly.
LAN works even without the NAT Loopback option in my router.

EDIT: I only get to my login screen but when I login, it takes several minutes to load the Dashboard. And that is on cellular connection. WiFi is not possible at all.

Which options do I have to solve it?

Ah ok. Then maybe the FritzBox supports NAT-Loopback out of the box. And I guess with LAN you mean with an ethernet cable…?

That can be caused by slow upload speeds of your internet connection or it could be the configuration of your Nextcloud. See my post here… Nextcloud und Performance - #2 by bb77

Is it possible that your cell phone or laptop is connected to an isolated guest WiFi network? If so it will have no access to other devices inside your local network. Make sure that the device you want to connect from gets an IP in the same subnet as your Nextcloud server.

Yes, connected via Ethernet on the 1Gbit port of my router.

I will give this a good read, because upload speeds are perfectly fine.

No isolated networks. The strange thing is that it all had been working perfectly with the exact same setup up until a week ago.

I just factory reset my router and did the port forwarding again. Now I can’t even access it through cellular connection. Is there no more detailed way to troubleshoot? It’s like stabbing in the dark right now.

I’m pretty sure that the fritzbox causes this somehow. You said that there was an upgrade to it. In theory it could also be caused by an upgrade of your server (OS or Nextcloud), but since you have not changed anything there and did not upgrade to a new major release of Nextctcloud, I put my bets on the router. :wink: Unfortunatley I can not help you there with exact instructions. But the Fritzbox is widley used here… Maybe you can search the forums for similiar issues. Or search the internet for issues with the latest FritzOS upgrade…