-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug in DnsPinMiddleware.php, "DNS Query failed" #28105
Comments
This comment has been minimized.
This comment has been minimized.
@szaimen I have upgraded to 22.1.0 (from freebsd pkg repo) The logging tab says:
|
Also running on freebsd 12, same error#83, nextcloud 22.1.1. |
This is still an issue. Please reopen @szaimen . FreeBSD 12.2, Nextcloud 22.1.1.
|
This comment has been minimized.
This comment has been minimized.
I don't have a FreeBSD environment to debug this, neither is it part of our recommended setup environment. So someone else will have to dive into this as I won't have capacity. :-) |
It's an issue under TrueNAS FreeBSD jail. So far I discovered two issues and I don't know if they're related to the below error or not
The NextCloud log is filling (every ~30min ) with below messages:
|
I don't use LDAP, so I can't speak for that. I can log into the Android app with no issues as well as the web browser. I am getting the DNS errors, though. Which is why I'm here.
|
I can confirm @gavsiu observations. I can't speak for LDAP neither.
Apache is running in a jail.
Any ideas where to start? |
cc @artonge |
I'll take a look this week. |
That problem is not related to FreeBSD. The Problem is that, eg When you try to get a DNS record via PHP Warning: dns_get_record(): DNS Query failed in Command line code on line 1
bool(false) The question is, how to handle missing records? |
FYI I just get that error... and it appears issue was in my DNS host configuration ( |
I have reason to believe this is because some of my federated shared have went offline or migrated to a new server (and new domain) |
Debian 11, Linux 5.10.0-9-686-pae
|
I just did a fresh installation on my unraid server and I am encountering the same issue. Is there any updates on how to fix this? {"reqId":"RtkwbR2egqa1mmfua41w","level":3,"time":"2021-12-03T00:26:34+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"dns_get_record(): A temporary server error occurred. at /config/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"--","version":"23.0.0.10","exception":{"Exception":"Error","Message":"dns_get_record(): A temporary server error occurred. at /config/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\Log\ErrorHandler","type":"::"},{"file":"/config/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record"},{"file":"/config/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\Http\Client\DnsPinMiddleware","type":"->"},{"file":"/config/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\Http\Client\{closure}","class":"OC\Http\Client\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced "]},{"file":"/config/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\PrepareBodyMiddleware","type":"->"},{"file":"/config/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\{closure}","class":"GuzzleHttp\Middleware","type":"::","args":[" sensitive parameters replaced "]},{"file":"/config/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\RedirectMiddleware","type":"->"},{"file":"/config/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\{closure}","class":"GuzzleHttp\Middleware","type":"::","args":[" sensitive parameters replaced ***"]},{"file":"/config/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\HandlerStack","type":"->"},{"file":"/config/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\Client","type":"->"},{"file":"/config/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\Client","type":"->"},{"file":"/config/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\Client","type":"->"},{"file":"/config/www/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php","line":120,"function":"get","class":"OC\Http\Client\Client","type":"->"},{"file":"/config/www/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php","line":87,"function":"fetch","class":"OC\App\AppStore\Fetcher\Fetcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php","line":192,"function":"fetch","class":"OC\App\AppStore\Fetcher\AppFetcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php","line":186,"function":"get","class":"OC\App\AppStore\Fetcher\Fetcher","type":"->"},{"file":"/config/www/nextcloud/lib/private/Installer.php","line":433,"function":"get","class":"OC\App\AppStore\Fetcher\AppFetcher","type":"->"},{"file":"/config/www/nextcloud/apps/updatenotification/lib/Notification/BackgroundJob.php","line":280,"function":"isUpdateAvailable","class":"OC\Installer","type":"->"},{"file":"/config/www/nextcloud/apps/updatenotification/lib/Notification/BackgroundJob.php","line":168,"function":"isUpdateAvailable","class":"OCA\UpdateNotification\Notification\BackgroundJob","type":"->"},{"file":"/config/www/nextcloud/apps/updatenotification/lib/Notification/BackgroundJob.php","line":92,"function":"checkAppUpdates","class":"OCA\UpdateNotification\Notification\BackgroundJob","type":"->"},{"file":"/config/www/nextcloud/lib/private/BackgroundJob/Job.php","line":51,"function":"run","class":"OCA\UpdateNotification\Notification\BackgroundJob","type":"->"},{"file":"/config/www/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":58,"function":"execute","class":"OC\BackgroundJob\Job","type":"->"},{"file":"/config/www/nextcloud/cron.php","line":128,"function":"execute","class":"OC\BackgroundJob\TimedJob","type":"->"}],"File":"/config/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"61a96f6d08108"} |
Run a |
Thanks for the quick reply. I tried running this in the nextcloud container and command not found. I also ran it inside unraid on the terminal and got the same command not found. Could you share where did you ran the command? |
oh I'm not running in a container but you don't need to run it in the container. you can run it in the host. you're wanting to capture network traffic leaving the machine, and all processes (any container, any vm, any host process) will use port 53 to reach internet. so try installing tcpdump via your package manager |
I did a TCPdump, and I found out that there were some cname Records that looked quite odd. I don't know how to find or delete this in my Mariadb database. |
https://mariadb.com/kb/en/mysqldump/ and then search that file using your tool of choice. Maybe grep. I used VSCode with Ctrl+F. Unfortunately I can't help anymore than that since I don't recognize the .domain.com suffix - my case was for my own domain I recognized. |
I was able to install TCPdump and ran the command and I saw it reaching out to: nextcloud.com, www.nextcloud.com, updates.nextcloud.com, lookup.nextcloud.com, apps.nextcloud.com, usercontent.apps.nextcloud.com. None of those belong to me and belong to nextcloud itself. I am on version 23.0.0 and I believe there are some errors in GitHub about something similar to this. I just wished I can get it to work, but I guess I will have to wait. |
Ok, i edited in the changes in the container and didnt restart it so the changes dont get lost. I'll let it run for a while and see how it goes. :) |
The LSIO container uses 7.4.26 (doh! lol) |
Okay, it seems like this is indeed fixed in newer PHP releases. So I vote for closing this. For anyone that has this issue, please upgrade your php version! See #28105 (comment) |
I use PHP 8.0.16 on a Debian System and I have the same issue. |
"So, you have lots of scars in your face? Well then, we remove your eyes so you don't see them anymore. Problem solved." Suppressing the error message doesn't fix the issue, so IMHO no. Edit: Just updated my FreeBSD box to php-7.4.29 and it seems to be fixed now (at least for the 7.4 branch):
|
Since this seems to be an issue within php-src I am not sure what we can do here except supressing the error message. That is why I supposed this solution. The other way is simply closing this issue because it needs to be fixed in php-src... |
Well, what about another approach... we could catch the error and output a more reasonable message instead, like |
I tried that but it seems like you cannot catch php errors. See #32243 (comment) |
@NCC1701G Which issue do you have? After re-reading the ticket I think this can be closed and people having failures in dns_get_record actually have a different problem.
@GitKalle I cannot reproduce this problem, if someone can, please share your PHP version? |
@come-nc {"reqId":"bCryT46lgPkdsnMNSItX","level":3,"time":"2022-05-08T23:37:19+02:00","remoteAddr":"192.168.1.102","user":"Unimatrix","app":"PHP","method":"GET","url":"/settings/ajax/checksetup","message":"dns_get_record(): A temporary server error occurred. at /var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#57","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36","version":"24.0.0.12","exception":{"Exception":"Error","Message":"dns_get_record(): A temporary server error occurred. at /var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#57","Code":0,"Trace":[{"function":"onError","class":"OC\Log\ErrorHandler","type":"::"},{"file":"/var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":57,"function":"dns_get_record"},{"file":"/var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":74,"function":"soaRecord","class":"OC\Http\Client\DnsPinMiddleware","type":"->"},{"file":"/var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\Http\Client\DnsPinMiddleware","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php","line":35,"function":"OC\Http\Client\{closure}","class":"OC\Http\Client\DnsPinMiddleware","type":"->","args":["*** sensitive parameters replaced "]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\PrepareBodyMiddleware","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\{closure}","class":"GuzzleHttp\Middleware","type":"::","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":99,"function":"__invoke","class":"GuzzleHttp\RedirectMiddleware","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":73,"function":"checkRedirect","class":"GuzzleHttp\RedirectMiddleware","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/FulfilledPromise.php","line":41,"function":"GuzzleHttp\{closure}","class":"GuzzleHttp\RedirectMiddleware","type":"->","args":[" sensitive parameters replaced "]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/TaskQueue.php","line":48,"function":"GuzzleHttp\Promise\{closure}","class":"GuzzleHttp\Promise\FulfilledPromise","type":"::","args":[" sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":248,"function":"run","class":"GuzzleHttp\Promise\TaskQueue","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":224,"function":"invokeWaitFn","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":269,"function":"waitIfPending","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":226,"function":"invokeWaitList","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/promises/src/Promise.php","line":62,"function":"waitIfPending","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"wait","class":"GuzzleHttp\Promise\Promise","type":"->"},{"file":"/var/www/nextcloud/lib/private/Http/Client/Client.php","line":218,"function":"request","class":"GuzzleHttp\Client","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/CheckSetupController.php","line":213,"function":"get","class":"OC\Http\Client\Client","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/CheckSetupController.php","line":193,"function":"isSiteReachable","class":"OCA\Settings\Controller\CheckSetupController","type":"->"},{"file":"/var/www/nextcloud/apps/settings/lib/Controller/CheckSetupController.php","line":855,"function":"hasInternetConnectivityProblems","class":"OCA\Settings\Controller\CheckSetupController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":225,"function":"check","class":"OCA\Settings\Controller\CheckSetupController","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":133,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":172,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":298,"function":"main","class":"OC\AppFramework\App","type":"::"},{"file":"/var/www/nextcloud/lib/base.php","line":1023,"function":"match","class":"OC\Route\Router","type":"->"},{"file":"/var/www/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::"}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"62783814accdd"} |
@NCC1701G This may not be the same error as you get "A temporary server error occurred" and not "DNS Query failed". It happens when trying to get the SOA for the test site. |
I have no "connectivity_check_domains" in my config.php. |
Can you test the following code on your setup and see if any warning is shown: <?php
function soaRecord(string $target): ?array {
echo "$target\n";
$labels = explode('.', $target);
$top = count($labels) >= 2 ? array_pop($labels) : '';
$second = array_pop($labels);
$hostname = $second . '.' . $top;
echo "$hostname\n";
$responses = dns_get_record($hostname, DNS_SOA);
if ($responses === false || count($responses) === 0) {
return null;
}
return reset($responses);
}
$siteArray = [
'www.nextcloud.com', 'www.startpage.com', 'www.eff.org', 'www.edri.org'
];
foreach ($siteArray as $site) {
if (preg_match('/^https?:\/\//', $site) !== 1) {
$httpSite = 'http://' . $site;
echo(json_encode(soaRecord($httpSite)));
$httpsSite = 'https://' . $site;
echo(json_encode(soaRecord($httpSite)));
} else {
echo(json_encode(soaRecord($httpSite)));
}
} |
@come-nc How can I test the code? I'm not a php developer. |
Save it in a file, ie test.php. You can also save it next to your nextcloud index.php file and open through your browser |
Tested your code and receive the following output in latest docker-image of nextcloud, running behind pihole also in docker-image: Hope it helps. |
@forestvogo And you have errors in your nextcloud log on the same instance? |
Hi @come-nc , my error is probably the same in short ""args":[2,"dns_get_record(): A temporary server error occurred."" One long response for startpage.com and others (edri, ...) checking for internet connectivity: Volker |
I get some errors when I run your php file.
|
@NCC1701G So it seems your PHP setup is indeed unable to query the DNS server to get the SOA record for these domains, for some reason. |
@come-nc I found the bug. The bug was in my network infrastructure. My fritz.box had an incorrect PPPOE mode. I have now replaced my router with a DrayTek modem and now everything works fine. This was very crazy. |
Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you! |
How to use GitHub
Steps to reproduce
/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php
according to Check if dns_get_record returns non-false #27922Expected behaviour
Beautiful wallpaper
Actual behaviour
No wallpaper, error in log.
Server configuration
Operating system: FreeBSD 12.2
Web server: nginx
Database: postgre
PHP version: 8.0.8
Nextcloud version: 22.0.0 + manual patch
/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php
according to #27922Updated from an older Nextcloud/ownCloud or fresh install: updated
Where did you install Nextcloud from: pkg repositories
Signing status:
Signing status
List of activated apps:
App list
Nextcloud configuration:
Config report
Are you using external storage, if yes which one: no
Are you using encryption: no
Are you using an external user-backend, if yes which one: no
Client configuration
Browser: Firefox 90.0.1
Operating system: Archlinux
Logs
Web server error log
Web server error log
Nextcloud log (data/nextcloud.log)
Nextcloud log
Browser log
Browser log
The text was updated successfully, but these errors were encountered: