Skip to content
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

Closed
moviuro opened this issue Jul 22, 2021 · 56 comments
Closed

Bug in DnsPinMiddleware.php, "DNS Query failed" #28105

moviuro opened this issue Jul 22, 2021 · 56 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug help wanted needs info

Comments

@moviuro
Copy link

moviuro commented Jul 22, 2021

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Hand-patch /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php according to Check if dns_get_record returns non-false #27922
  2. Navigate to the Dashboard page

Expected 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 #27922

Updated from an older Nextcloud/ownCloud or fresh install: updated

Where did you install Nextcloud from: pkg repositories

Signing status:

Signing status
Technical information
=====================
The following list covers which files have failed the integrity check. Please read
the previous linked documentation to learn more about the errors and how to fix
them.

Results
=======
- core
	- INVALID_HASH
		- lib/private/Http/Client/DnsPinMiddleware.php
	- EXTRA_FILE
		- .well-known/security.txt
		- bandwidth.jpg

Raw output
==========
Array
(
    [core] => Array
        (
            [INVALID_HASH] => Array
                (
                    [lib/private/Http/Client/DnsPinMiddleware.php] => Array
                        (
                            [expected] => 881f287a6f87290c844e5fc75302af235ab1abd0fa1345c876f3897b03a2063ac112786e40ea7c74981241d7efcf88a89b9c1a0bcfad672a65c9fc8998929cce
                            [current] => 5263329ee8cf2c3deb5f5d764f11324f9af80752828ca32e45bf2263db04c52b14389ab876d556d162b717f4e9cd67dd12fedc472546bf066d817c72ab49b3c2
                        )

                )

            [EXTRA_FILE] => Array
                (
                    [.well-known/security.txt] => Array
                        (
                            [expected] => 
                            [current] => d872b4772cb6fa731d1cce15e12f77f4a04b86529ed97d9f35effc32e83b28ec251b8cded5d3afd804078b0a7ef63f128272a731e4b795412a3bc027b3a3db4b
                        )

                    [bandwidth.jpg] => Array
                        (
                            [expected] => 
                            [current] => dd66d8b17693ad507037db328e3c1cbc912a00770a8f8c1b625e8e27b71ab753317787da1da974ef6d250596e95e5a72d80f20d7878fa3496799ced77a60e4df
                        )

                )

        )

)

List of activated apps:

App list
Enabled:
  - accessibility: 1.7.0
  - activity: 2.15.0
  - circles: 22.0.0
  - cloud_federation_api: 1.4.0
  - comments: 1.11.0
  - contactsinteraction: 1.2.0
  - cospend: 1.3.7
  - dashboard: 7.1.0
  - dav: 1.18.0
  - federatedfilesharing: 1.11.0
  - federation: 1.11.0
  - files: 1.16.0
  - files_pdfviewer: 2.3.0
  - files_rightclick: 1.1.0
  - files_sharing: 1.13.2
  - files_trashbin: 1.11.0
  - files_versions: 1.14.0
  - files_videoplayer: 1.11.0
  - firstrunwizard: 2.11.0
  - logreader: 2.7.0
  - lookup_server_connector: 1.9.0
  - music: 1.2.1
  - nextcloud_announcements: 1.11.0
  - notifications: 2.10.1
  - oauth2: 1.9.0
  - password_policy: 1.12.0
  - photos: 1.4.0
  - privacy: 1.6.0
  - provisioning_api: 1.11.0
  - recommendations: 1.1.0
  - serverinfo: 1.12.0
  - settings: 1.3.0
  - sharebymail: 1.11.0
  - support: 1.5.0
  - survey_client: 1.10.0
  - systemtags: 1.11.0
  - text: 3.3.0
  - theming: 1.12.0
  - twofactor_backupcodes: 1.10.1
  - twofactor_totp: 6.1.0
  - updatenotification: 1.11.0
  - user_status: 1.1.1
  - viewer: 1.6.0
  - weather_status: 1.1.0
  - workflowengine: 2.3.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - ocdownloader
  - previewgenerator
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "SECRETVALUE"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/SECRETVALUE",
        "dbtype": "pgsql",
        "version": "22.0.0.11",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "FR",
        "installed": true,
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_smtpsecure": "ssl",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpauth": 1,
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "theme": "",
        "loglevel": 2,
        "log_type": "syslog",
        "maintenance": false,
        "apps_paths": [
            {
                "path": "\/usr\/local\/www\/nextcloud\/apps",
                "url": "\/apps",
                "writable": true
            },
            {
                "path": "\/usr\/local\/www\/nextcloud\/apps-pkg",
                "url": "\/apps-pkg",
                "writable": false
            }
        ],
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mail_sendmailmode": "smtp",
        "app_install_overwrite": [
            "ocdownloader",
            "previewgenerator"
        ]
    }
}

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
{"reqId":"0yEG9SEo7MCCiVjQwIwM","level":3,"time":"2021-07-22T07:20:41+00:00","remoteAddr":"10.21.10.12","user":"moviuro","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/weather_status/api/v1/forecast","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#66","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":"22.0.0.11","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#66","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"dns_get_record(): DNS Query failed","/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php",66]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":66,"function":"dns_get_record","args":["api.met.no",16]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":113,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["api.met.no",0]},{"file":"/usr/local/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":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->","args":["get",{"__class__":"GuzzleHttp\\Psr7\\Uri"},{"verify":"/usr/local/www/nextcloud/resources/config/ca-bundle.crt","timeout":30,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"nextcloud":{"allow_local_address":false},"synchronous":true,"0":"And 6 more entries, set log level to debug to see all entries"}]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=XXX&lon=XXX&altitude=XXX",{"verify":"/usr/local/www/nextcloud/resources/config/ca-bundle.crt","timeout":30,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"headers":{"User-Agent":"NextcloudWeatherStatus/1.1.0 nextcloud.com","Accept-Encoding":"gzip"},"nextcloud":{"allow_local_address":false},"0":"And 1 more entries, set log level to debug to see all entries"}]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":415,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=XXX&lon=XXX&altitude=XXX",{"headers":{"User-Agent":"NextcloudWeatherStatus/1.1.0 nextcloud.com"}}]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":380,"function":"requestJSON","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":["https://api.met.no/weatherapi/locationforecast/2.0/compact",{"lat":"45.76","lon":"4.83","altitude":175}]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":358,"function":"forecastRequest","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":[45.7578137,4.8320114,175]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Controller/WeatherStatusController.php","line":118,"function":"getForecast","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":[]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getForecast","class":"OCA\\WeatherStatus\\Controller\\WeatherStatusController","type":"->","args":[]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\WeatherStatus\\Controller\\WeatherStatusController"},"getForecast"]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\WeatherStatus\\Controller\\WeatherStatusController"},"getForecast"]},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\WeatherStatus\\Controller\\WeatherStatusController","getForecast",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.weather_status.WeatherStatus.getForecast"}]},{"file":"/usr/local/www/nextcloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/weather_status/api/v1/forecast"]},{"file":"/usr/local/www/nextcloud/ocs/v2.php","line":23,"args":["/usr/local/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}

{"reqId":"MjfUCzjGgB1QnN0igWer","level":3,"time":"2021-07-22T07:29:18+00:00","remoteAddr":"10.21.10.12","user":"moviuro","app":"PHP","method":"GET","url":"/ocs/v2.php/apps/weather_status/api/v1/forecast","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#66","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:90.0) Gecko/20100101 Firefox/90.0","version":"22.0.0.11","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#66","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"dns_get_record(): DNS Query failed","/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php",66]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":66,"function":"dns_get_record","args":["api.met.no",16]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":113,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["api.met.no",0]},{"file":"/usr/local/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":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->","args":["get",{"__class__":"GuzzleHttp\\Psr7\\Uri"},{"verify":"/usr/local/www/nextcloud/resources/config/ca-bundle.crt","timeout":30,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"nextcloud":{"allow_local_address":false},"synchronous":true,"0":"And 6 more entries, set log level to debug to see all entries"}]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=XXX&lon=XXX&altitude=XXX",{"verify":"/usr/local/www/nextcloud/resources/config/ca-bundle.crt","timeout":30,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"headers":{"User-Agent":"NextcloudWeatherStatus/1.1.0 nextcloud.com","Accept-Encoding":"gzip"},"nextcloud":{"allow_local_address":false},"0":"And 1 more entries, set log level to debug to see all entries"}]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":415,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["https://api.met.no/weatherapi/locationforecast/2.0/compact?lat=XXX&lon=XXX&altitude=XXX",{"headers":{"User-Agent":"NextcloudWeatherStatus/1.1.0 nextcloud.com"}}]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":380,"function":"requestJSON","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":["https://api.met.no/weatherapi/locationforecast/2.0/compact",{"lat":"47.22","lon":"2.07","altitude":108}]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":358,"function":"forecastRequest","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":[47.2217489,2.0691421,108]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Controller/WeatherStatusController.php","line":118,"function":"getForecast","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":[]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"getForecast","class":"OCA\\WeatherStatus\\Controller\\WeatherStatusController","type":"->","args":[]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\WeatherStatus\\Controller\\WeatherStatusController"},"getForecast"]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\WeatherStatus\\Controller\\WeatherStatusController"},"getForecast"]},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\WeatherStatus\\Controller\\WeatherStatusController","getForecast",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.weather_status.WeatherStatus.getForecast"}]},{"file":"/usr/local/www/nextcloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/weather_status/api/v1/forecast"]},{"file":"/usr/local/www/nextcloud/ocs/v2.php","line":23,"args":["/usr/local/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@moviuro moviuro added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jul 22, 2021
@szaimen

This comment has been minimized.

@szaimen szaimen closed this as completed Aug 8, 2021
@moviuro
Copy link
Author

moviuro commented Aug 23, 2021

@szaimen I have upgraded to 22.1.0 (from freebsd pkg repo)

The logging tab says:

[PHP] Error: dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83

POST /ocs/v2.php/apps/survey_client/api/v1/report?format=json
from 10.21.10.12 by nextcloud-administrator at 2021-08-23T13:01:09+00:00
{"reqId":"oHG890RuGDEgS59KjvD6","level":3,"time":"2021-08-23T13:01:09+00:00","remoteAddr":"10.21.10.12","user":"nextcloud-administrator","app":"PHP","method":"POST","url":"/ocs/v2.php/apps/survey_client/api/v1/report?format=json","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0","version":"22.1.0.1","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"dns_get_record(): DNS Query failed","/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php",83]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record","args":["surveyserver.nextcloud.com",16]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["surveyserver.nextcloud.com",1]},{"file":"/usr/local/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":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->","args":["post",{"__class__":"GuzzleHttp\\Psr7\\Uri"},{"0":"And 7 more entries, set log level to debug to see all entries","verify":"/usr/local/www/nextcloud/resources/config/ca-bundle.crt","timeout":5,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"query":{"data":"{\"id\":\"ocbu7gdy84us\",\"items\":[[\"server\",\"version\",\"22.1.0.1\"],[\"server\",\"code\",\"other\"],[\"server\",\"enable_avatars\",\"yes\"],[\"server\",\"enable_previews\",\"yes\"],[\"server\",\"memcache.local\",\"\\\\OC\\\\Memcache\\\\APCu\"],[\"server\",\"memcache.distributed\",\"none\"],[\"server\",\"asset-pipeline.enabled\",\"no\"],[\"server\",\"filelocking.enabled\",\"yes\"],[\"server\",\"memcache.locking\",\"none\"],[\"server\",\"debug\",\"no\"],[\"server\",\"cron\",\"cron\"],[\"php\",\"version\",\"8.0.9\"],[\"php\",\"memory_limit\",536870912],[\"php\",\"max_execution_time\",3600],[\"php\",\"upload_max_filesize\",2097152],[\"database\",\"type\",\"pgsql\"],[\"database\",\"version\",\"PostgreSQL 9.6.22 on amd64-portbld-freebsd12.2, compiled by FreeBSD clang version 10.0.1 ([email protected]:llvm\\/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2), 64-bit\"],[\"database\",\"size\",1700649496],[\"apps\",\"provisioning_api\",\"1.11.0\"],[\"apps\",\"firstrunwizard\",\"2.11.0\"],[\"apps\",\"federation\",\"1.11.0\"],[\"apps\",\"password_policy\",\"1.12.0\"],[\"apps\",\"photos\",\"1.4.0\"],[\"apps\",\"oauth2\",\"1.9.0\"],[\"apps\",\"serverinfo\",\"1.12.0\"],[\"apps\",\"files_sharing\",\"1.13.2\"],[\"apps\",\"activity\",\"2.15.0\"],[\"apps\",\"files\",\"1.16.0\"],[\"apps\",\"bruteforcesettings\",\"disabled\"],[\"apps\",\"comments\",\"1.11.0\"],[\"apps\",\"gallery\",\"disabled\"],[\"apps\",\"nextcloud_announcements\",\"1.11.0\"],[\"apps\",\"notifications\",\"2.10.1\"],[\"apps\",\"files_texteditor\",\"disabled\"],[\"apps\",\"files_pdfviewer\",\"2.3.0\"],[\"apps\",\"systemtags\",\"1.11.0\"],[\"apps\",\"theming\",\"1.12.0\"],[\"apps\",\"ocdownloader\",\"disabled\"],[\"apps\",\"dashboard\",\"7.1.0\"],[\"apps\",\"files_versions\",\"1.14.0\"],[\"apps\",\"sharebymail\",\"1.11.0\"],[\"apps\",\"files_trashbin\",\"1.11.0\"],[\"apps\",\"survey_client\",\"1.10.0\"],[\"apps\",\"logreader\",\"2.7.0\"],[\"apps\",\"settings\",\"1.3.0\"],[\"apps\",\"twofactor_backupcodes\",\"1.10.1\"],[\"apps\",\"workflowengine\",\"2.3.0\"],[\"apps\",\"updatenotification\",\"1.11.0\"],[\"apps\",\"weather_status\",\"1.1.0\"],[\"apps\",\"lookup_server_connector\",\"1.9.0\"],[\"apps\",\"dav\",\"1.18.0\"],[\"apps\",\"federatedfilesharing\",\"1.11.0\"],[\"apps\",\"files_videoplayer\",\"1.11.0\"],[\"apps\",\"cospend\",\"1.3.12\"],[\"apps\",\"contactsinteraction\",\"1.2.0\"],[\"apps\",\"user_status\",\"1.1.1\"],[\"apps\",\"music\",\"1.2.1\"],[\"apps\",\"circles\",\"22.1.0\"],[\"apps\",\"files_rightclick\",\"1.1.0\"],[\"apps\",\"privacy\",\"1.6.0\"],[\"apps\",\"previewgenerator\",\"3.1.1\"],[\"apps\",\"cloud_federation_api\",\"1.4.0\"],[\"apps\",\"accessibility\",\"1.7.0\"],[\"apps\",\"recommendations\",\"1.1.0\"],[\"apps\",\"support\",\"1.5.0\"],[\"apps\",\"text\",\"3.3.0\"],[\"apps\",\"viewer\",\"1.6.0\"],[\"apps\",\"twofactor_totp\",\"6.1.0\"],[\"stats\",\"num_files\",1801384],[\"stats\",\"num_users\",7],[\"stats\",\"num_storages\",9],[\"stats\",\"num_storages_local\",1],[\"stats\",\"num_storages_home\",8],[\"stats\",\"num_storages_other\",0],[\"stats\",\"num_comments\",0],[\"stats\",\"num_comment_markers\",0],[\"stats\",\"num_systemtags\",0],[\"stats\",\"num_systemtags_mappings\",0],[\"files_sharing\",\"num_shares\",39],[\"files_sharing\",\"num_shares_user\",15],[\"files_sharing\",\"num_shares_groups\",9],[\"files_sharing\",\"num_shares_link\",2],[\"files_sharing\",\"num_shares_link_no_password\",2],[\"files_sharing\",\"num_fed_shares_sent\",0],[\"files_sharing\",\"num_fed_shares_received\",0],[\"files_sharing\",\"permissions_0_31\",5],[\"files_sharing\",\"permissions_1_31\",6],[\"files_sharing\",\"permissions_2_31\",13],[\"files_sharing\",\"permissions_0_19\",8],[\"files_sharing\",\"permissions_0_17\",2],[\"files_sharing\",\"permissions_3_17\",2],[\"files_sharing\",\"permissions_1_17\",3],[\"encryption\",\"enabled\",\"no\"],[\"encryption\",\"default_module\",\"no\"]]}"},"nextcloud":{"allow_local_address":false}}]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":294,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["post","https://surveyserver.nextcloud.com/ocs/v2.php/apps/survey_server/api/v1/survey",{"0":"And 2 more entries, set log level to debug to see all entries","verify":"/usr/local/www/nextcloud/resources/config/ca-bundle.crt","timeout":5,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"query":{"data":"{\"id\":\"ocbu7gdy84us\",\"items\":[[\"server\",\"version\",\"22.1.0.1\"],[\"server\",\"code\",\"other\"],[\"server\",\"enable_avatars\",\"yes\"],[\"server\",\"enable_previews\",\"yes\"],[\"server\",\"memcache.local\",\"\\\\OC\\\\Memcache\\\\APCu\"],[\"server\",\"memcache.distributed\",\"none\"],[\"server\",\"asset-pipeline.enabled\",\"no\"],[\"server\",\"filelocking.enabled\",\"yes\"],[\"server\",\"memcache.locking\",\"none\"],[\"server\",\"debug\",\"no\"],[\"server\",\"cron\",\"cron\"],[\"php\",\"version\",\"8.0.9\"],[\"php\",\"memory_limit\",536870912],[\"php\",\"max_execution_time\",3600],[\"php\",\"upload_max_filesize\",2097152],[\"database\",\"type\",\"pgsql\"],[\"database\",\"version\",\"PostgreSQL 9.6.22 on amd64-portbld-freebsd12.2, compiled by FreeBSD clang version 10.0.1 ([email protected]:llvm\\/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2), 64-bit\"],[\"database\",\"size\",1700649496],[\"apps\",\"provisioning_api\",\"1.11.0\"],[\"apps\",\"firstrunwizard\",\"2.11.0\"],[\"apps\",\"federation\",\"1.11.0\"],[\"apps\",\"password_policy\",\"1.12.0\"],[\"apps\",\"photos\",\"1.4.0\"],[\"apps\",\"oauth2\",\"1.9.0\"],[\"apps\",\"serverinfo\",\"1.12.0\"],[\"apps\",\"files_sharing\",\"1.13.2\"],[\"apps\",\"activity\",\"2.15.0\"],[\"apps\",\"files\",\"1.16.0\"],[\"apps\",\"bruteforcesettings\",\"disabled\"],[\"apps\",\"comments\",\"1.11.0\"],[\"apps\",\"gallery\",\"disabled\"],[\"apps\",\"nextcloud_announcements\",\"1.11.0\"],[\"apps\",\"notifications\",\"2.10.1\"],[\"apps\",\"files_texteditor\",\"disabled\"],[\"apps\",\"files_pdfviewer\",\"2.3.0\"],[\"apps\",\"systemtags\",\"1.11.0\"],[\"apps\",\"theming\",\"1.12.0\"],[\"apps\",\"ocdownloader\",\"disabled\"],[\"apps\",\"dashboard\",\"7.1.0\"],[\"apps\",\"files_versions\",\"1.14.0\"],[\"apps\",\"sharebymail\",\"1.11.0\"],[\"apps\",\"files_trashbin\",\"1.11.0\"],[\"apps\",\"survey_client\",\"1.10.0\"],[\"apps\",\"logreader\",\"2.7.0\"],[\"apps\",\"settings\",\"1.3.0\"],[\"apps\",\"twofactor_backupcodes\",\"1.10.1\"],[\"apps\",\"workflowengine\",\"2.3.0\"],[\"apps\",\"updatenotification\",\"1.11.0\"],[\"apps\",\"weather_status\",\"1.1.0\"],[\"apps\",\"lookup_server_connector\",\"1.9.0\"],[\"apps\",\"dav\",\"1.18.0\"],[\"apps\",\"federatedfilesharing\",\"1.11.0\"],[\"apps\",\"files_videoplayer\",\"1.11.0\"],[\"apps\",\"cospend\",\"1.3.12\"],[\"apps\",\"contactsinteraction\",\"1.2.0\"],[\"apps\",\"user_status\",\"1.1.1\"],[\"apps\",\"music\",\"1.2.1\"],[\"apps\",\"circles\",\"22.1.0\"],[\"apps\",\"files_rightclick\",\"1.1.0\"],[\"apps\",\"privacy\",\"1.6.0\"],[\"apps\",\"previewgenerator\",\"3.1.1\"],[\"apps\",\"cloud_federation_api\",\"1.4.0\"],[\"apps\",\"accessibility\",\"1.7.0\"],[\"apps\",\"recommendations\",\"1.1.0\"],[\"apps\",\"support\",\"1.5.0\"],[\"apps\",\"text\",\"3.3.0\"],[\"apps\",\"viewer\",\"1.6.0\"],[\"apps\",\"twofactor_totp\",\"6.1.0\"],[\"stats\",\"num_files\",1801384],[\"stats\",\"num_users\",7],[\"stats\",\"num_storages\",9],[\"stats\",\"num_storages_local\",1],[\"stats\",\"num_storages_home\",8],[\"stats\",\"num_storages_other\",0],[\"stats\",\"num_comments\",0],[\"stats\",\"num_comment_markers\",0],[\"stats\",\"num_systemtags\",0],[\"stats\",\"num_systemtags_mappings\",0],[\"files_sharing\",\"num_shares\",39],[\"files_sharing\",\"num_shares_user\",15],[\"files_sharing\",\"num_shares_groups\",9],[\"files_sharing\",\"num_shares_link\",2],[\"files_sharing\",\"num_shares_link_no_password\",2],[\"files_sharing\",\"num_fed_shares_sent\",0],[\"files_sharing\",\"num_fed_shares_received\",0],[\"files_sharing\",\"permissions_0_31\",5],[\"files_sharing\",\"permissions_1_31\",6],[\"files_sharing\",\"permissions_2_31\",13],[\"files_sharing\",\"permissions_0_19\",8],[\"files_sharing\",\"permissions_0_17\",2],[\"files_sharing\",\"permissions_3_17\",2],[\"files_sharing\",\"permissions_1_17\",3],[\"encryption\",\"enabled\",\"no\"],[\"encryption\",\"default_module\",\"no\"]]}"},"nextcloud":{"allow_local_address":false}}]},{"file":"/usr/local/www/nextcloud/apps-pkg/survey_client/lib/Collector.php","line":166,"function":"post","class":"OC\\Http\\Client\\Client","type":"->","args":["https://surveyserver.nextcloud.com/ocs/v2.php/apps/survey_server/api/v1/survey",{"timeout":5,"query":{"data":"{\"id\":\"ocbu7gdy84us\",\"items\":[[\"server\",\"version\",\"22.1.0.1\"],[\"server\",\"code\",\"other\"],[\"server\",\"enable_avatars\",\"yes\"],[\"server\",\"enable_previews\",\"yes\"],[\"server\",\"memcache.local\",\"\\\\OC\\\\Memcache\\\\APCu\"],[\"server\",\"memcache.distributed\",\"none\"],[\"server\",\"asset-pipeline.enabled\",\"no\"],[\"server\",\"filelocking.enabled\",\"yes\"],[\"server\",\"memcache.locking\",\"none\"],[\"server\",\"debug\",\"no\"],[\"server\",\"cron\",\"cron\"],[\"php\",\"version\",\"8.0.9\"],[\"php\",\"memory_limit\",536870912],[\"php\",\"max_execution_time\",3600],[\"php\",\"upload_max_filesize\",2097152],[\"database\",\"type\",\"pgsql\"],[\"database\",\"version\",\"PostgreSQL 9.6.22 on amd64-portbld-freebsd12.2, compiled by FreeBSD clang version 10.0.1 ([email protected]:llvm\\/llvm-project.git llvmorg-10.0.1-0-gef32c611aa2), 64-bit\"],[\"database\",\"size\",1700649496],[\"apps\",\"provisioning_api\",\"1.11.0\"],[\"apps\",\"firstrunwizard\",\"2.11.0\"],[\"apps\",\"federation\",\"1.11.0\"],[\"apps\",\"password_policy\",\"1.12.0\"],[\"apps\",\"photos\",\"1.4.0\"],[\"apps\",\"oauth2\",\"1.9.0\"],[\"apps\",\"serverinfo\",\"1.12.0\"],[\"apps\",\"files_sharing\",\"1.13.2\"],[\"apps\",\"activity\",\"2.15.0\"],[\"apps\",\"files\",\"1.16.0\"],[\"apps\",\"bruteforcesettings\",\"disabled\"],[\"apps\",\"comments\",\"1.11.0\"],[\"apps\",\"gallery\",\"disabled\"],[\"apps\",\"nextcloud_announcements\",\"1.11.0\"],[\"apps\",\"notifications\",\"2.10.1\"],[\"apps\",\"files_texteditor\",\"disabled\"],[\"apps\",\"files_pdfviewer\",\"2.3.0\"],[\"apps\",\"systemtags\",\"1.11.0\"],[\"apps\",\"theming\",\"1.12.0\"],[\"apps\",\"ocdownloader\",\"disabled\"],[\"apps\",\"dashboard\",\"7.1.0\"],[\"apps\",\"files_versions\",\"1.14.0\"],[\"apps\",\"sharebymail\",\"1.11.0\"],[\"apps\",\"files_trashbin\",\"1.11.0\"],[\"apps\",\"survey_client\",\"1.10.0\"],[\"apps\",\"logreader\",\"2.7.0\"],[\"apps\",\"settings\",\"1.3.0\"],[\"apps\",\"twofactor_backupcodes\",\"1.10.1\"],[\"apps\",\"workflowengine\",\"2.3.0\"],[\"apps\",\"updatenotification\",\"1.11.0\"],[\"apps\",\"weather_status\",\"1.1.0\"],[\"apps\",\"lookup_server_connector\",\"1.9.0\"],[\"apps\",\"dav\",\"1.18.0\"],[\"apps\",\"federatedfilesharing\",\"1.11.0\"],[\"apps\",\"files_videoplayer\",\"1.11.0\"],[\"apps\",\"cospend\",\"1.3.12\"],[\"apps\",\"contactsinteraction\",\"1.2.0\"],[\"apps\",\"user_status\",\"1.1.1\"],[\"apps\",\"music\",\"1.2.1\"],[\"apps\",\"circles\",\"22.1.0\"],[\"apps\",\"files_rightclick\",\"1.1.0\"],[\"apps\",\"privacy\",\"1.6.0\"],[\"apps\",\"previewgenerator\",\"3.1.1\"],[\"apps\",\"cloud_federation_api\",\"1.4.0\"],[\"apps\",\"accessibility\",\"1.7.0\"],[\"apps\",\"recommendations\",\"1.1.0\"],[\"apps\",\"support\",\"1.5.0\"],[\"apps\",\"text\",\"3.3.0\"],[\"apps\",\"viewer\",\"1.6.0\"],[\"apps\",\"twofactor_totp\",\"6.1.0\"],[\"stats\",\"num_files\",1801384],[\"stats\",\"num_users\",7],[\"stats\",\"num_storages\",9],[\"stats\",\"num_storages_local\",1],[\"stats\",\"num_storages_home\",8],[\"stats\",\"num_storages_other\",0],[\"stats\",\"num_comments\",0],[\"stats\",\"num_comment_markers\",0],[\"stats\",\"num_systemtags\",0],[\"stats\",\"num_systemtags_mappings\",0],[\"files_sharing\",\"num_shares\",39],[\"files_sharing\",\"num_shares_user\",15],[\"files_sharing\",\"num_shares_groups\",9],[\"files_sharing\",\"num_shares_link\",2],[\"files_sharing\",\"num_shares_link_no_password\",2],[\"files_sharing\",\"num_fed_shares_sent\",0],[\"files_sharing\",\"num_fed_shares_received\",0],[\"files_sharing\",\"permissions_0_31\",5],[\"files_sharing\",\"permissions_1_31\",6],[\"files_sharing\",\"permissions_2_31\",13],[\"files_sharing\",\"permissions_0_19\",8],[\"files_sharing\",\"permissions_0_17\",2],[\"files_sharing\",\"permissions_3_17\",2],[\"files_sharing\",\"permissions_1_17\",3],[\"encryption\",\"enabled\",\"no\"],[\"encryption\",\"default_module\",\"no\"]]}"}}]},{"file":"/usr/local/www/nextcloud/apps-pkg/survey_client/lib/Controller/EndpointController.php","line":94,"function":"sendReport","class":"OCA\\Survey_Client\\Collector","type":"->","args":[]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"sendReport","class":"OCA\\Survey_Client\\Controller\\EndpointController","type":"->","args":[]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Survey_Client\\Controller\\EndpointController"},"sendReport"]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Survey_Client\\Controller\\EndpointController"},"sendReport"]},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Survey_Client\\Controller\\EndpointController","sendReport",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.survey_client.Endpoint.sendReport"}]},{"file":"/usr/local/www/nextcloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/survey_client/api/v1/report"]},{"file":"/usr/local/www/nextcloud/ocs/v2.php","line":23,"args":["/usr/local/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"},"id":"61239c1c6fe83"}

@thijsjek
Copy link

Also running on freebsd 12, same error#83, nextcloud 22.1.1.
I suspect it's a soa record related because no issues other than in the log.
Same time exactly there are 2 requests (on my DNS server)
apps.nextcloud.com a record
nextcloud.com
SOA: ns.inwx.de. hostmaster.inwx.de. 2021071201 10800 3600 604800 3600 (ttl=32116)

@moviuro
Copy link
Author

moviuro commented Sep 7, 2021

This is still an issue. Please reopen @szaimen . FreeBSD 12.2, Nextcloud 22.1.1.

{"reqId":"6EdXnzRhj8Vah8JKncx5","level":3,"time":"2021-09-07T20:29:58+00:00","remoteAddr":"10.21.10.12","user":"nextcloud-administrator","app":"PHP","method":"PUT","url":"/ocs/v2.php/apps/weather_status/api/v1/location","message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0","version":"22.1.1.2","exception":{"Exception":"Error","Message":"dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"dns_get_record(): DNS Query failed","/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php",83]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record","args":["api.opentopodata.org",16]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["api.opentopodata.org",1]},{"file":"/usr/local/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":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->","args":["get",{"__class__":"GuzzleHttp\\Psr7\\Uri"},{"verify":"/usr/local/www/nextcloud/resources/config/ca-bundle.crt","timeout":30,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"nextcloud":{"allow_local_address":false},"synchronous":true,"0":"And 6 more entries, set log level to debug to see all entries"}]},{"file":"/usr/local/www/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","https://api.opentopodata.org/v1/srtm30m?locations=47.2217489%2C2.0691421",{"verify":"/usr/local/www/nextcloud/resources/config/ca-bundle.crt","timeout":30,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"headers":{"User-Agent":"NextcloudWeatherStatus/1.1.0 nextcloud.com","Accept-Encoding":"gzip"},"nextcloud":{"allow_local_address":false},"0":"And 1 more entries, set log level to debug to see all entries"}]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":415,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["https://api.opentopodata.org/v1/srtm30m?locations=47.2217489%2C2.0691421",{"headers":{"User-Agent":"NextcloudWeatherStatus/1.1.0 nextcloud.com"}}]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":232,"function":"requestJSON","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":["https://api.opentopodata.org/v1/srtm30m",{"locations":"47.2217489,2.0691421"}]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":292,"function":"getAltitude","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":[47.2217489,2.0691421]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Service/WeatherStatusService.php","line":196,"function":"setAddress","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":["LOCATION"]},{"file":"/usr/local/www/nextcloud/apps-pkg/weather_status/lib/Controller/WeatherStatusController.php","line":94,"function":"setLocation","class":"OCA\\WeatherStatus\\Service\\WeatherStatusService","type":"->","args":["LOCATION",null,null]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"setLocation","class":"OCA\\WeatherStatus\\Controller\\WeatherStatusController","type":"->","args":["LOCATION",null,null]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\WeatherStatus\\Controller\\WeatherStatusController"},"setLocation"]},{"file":"/usr/local/www/nextcloud/lib/private/AppFramework/App.php","line":156,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\WeatherStatus\\Controller\\WeatherStatusController"},"setLocation"]},{"file":"/usr/local/www/nextcloud/lib/private/Route/Router.php","line":301,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\WeatherStatus\\Controller\\WeatherStatusController","setLocation",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.weather_status.WeatherStatus.setLocation"}]},{"file":"/usr/local/www/nextcloud/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/apps/weather_status/api/v1/location"]},{"file":"/usr/local/www/nextcloud/ocs/v2.php","line":23,"args":["/usr/local/www/nextcloud/ocs/v1.php"],"function":"require_once"}],"File":"/usr/local/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}

@szaimen szaimen added 1. to develop Accepted and waiting to be taken care of and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Sep 15, 2021
@szaimen szaimen reopened this Sep 15, 2021
@szaimen

This comment has been minimized.

@LukasReschke
Copy link
Member

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. :-)

@evgenyvasilchenko
Copy link

evgenyvasilchenko commented Sep 15, 2021

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

  • LDAP integration does not work - any attempt to add an otherwise working LDAP (FreeIPA) ends with NextCloud "freezing"
  • Can't connect via NextCloud Android app and application password. Regular logins (web browser) are OK.
root@nextcloud-jail:~ # uname -a
FreeBSD nextcloud-jail 12.2-RELEASE-p9 FreeBSD 12.2-RELEASE-p9 2ee62d665f0(HEAD) TRUENAS  amd64
root@nextcloud-jail:~ # occ status
  - installed: true
  - version: 22.1.1.2
  - versionstring: 22.1.1
  - edition:

The NextCloud log is filling (every ~30min ) with below messages:

Error: dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83

    <<closure>>

    OC\Log\ErrorHandler::onError()

    /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php - line 83:

    dns_get_record()

    /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php - line 128:

    OC\Http\Client\DnsPinMiddleware->dnsResolve()

    /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php - line 35:

    OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensiti ... *")

    /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 31:

    GuzzleHttp\PrepareBodyMiddleware->__invoke()

    /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php - line 71:

    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensiti ... *")

    /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 63:

    GuzzleHttp\RedirectMiddleware->__invoke()

    /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php - line 75:

    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensiti ... *")

    /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 331:

    GuzzleHttp\HandlerStack->__invoke()

    /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 168:

    GuzzleHttp\Client->transfer()

    /usr/local/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 187:

    GuzzleHttp\Client->requestAsync()

    /usr/local/www/nextcloud/lib/private/Http/Client/Client.php - line 223:

    GuzzleHttp\Client->request()

    /usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php - line 226:

    OC\Http\Client\Client->get()

    /usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php - line 187:

    OCA\Settings\BackgroundJobs\VerifyUserData->queryLookupServer()

    /usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php - line 117:

    OCA\Settings\BackgroundJobs\VerifyUserData->verifyViaLookupServer()

    /usr/local/www/nextcloud/lib/public/BackgroundJob/Job.php - line 79:

    OCA\Settings\BackgroundJobs\VerifyUserData->run()

    /usr/local/www/nextcloud/apps-pkg/settings/lib/BackgroundJobs/VerifyUserData.php - line 98:

    OCP\BackgroundJob\Job->execute()

    /usr/local/www/nextcloud/cron.php - line 127:

    OCA\Settings\BackgroundJobs\VerifyUserData->execute()

@gavsiu
Copy link

gavsiu commented Oct 1, 2021

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.

root@Nextcloud:~ # uname -a
FreeBSD Nextcloud 12.2-RELEASE-p9 FreeBSD 12.2-RELEASE-p9 2ee62d665f0(HEAD) TRUENAS  amd64
root@Nextcloud:~ # occ status
  - installed: true
  - version: 22.1.1.2
  - versionstring: 22.1.1
  - edition:

@e-lange
Copy link

e-lange commented Oct 15, 2021

I can confirm @gavsiu observations. I can't speak for LDAP neither.

root@services:~ # uname -a
FreeBSD services 12.2-RELEASE-p7 FreeBSD 12.2-RELEASE-p7 GENERIC  amd64

Apache is running in a jail.
Issue seems to persist with 22.2.0.2.

root@services:/usr/local/www/apache24/data/nextcloud # sudo -u www php occ status
The process control (PCNTL) extensions are required in case you want to interrupt long running commands - see https://www.php.net/manual/en/book.pcntl.php
  - installed: true
  - version: 22.2.0.2
  - versionstring: 22.2.0
  - edition: 

Any ideas where to start?

@szaimen
Copy link
Contributor

szaimen commented Oct 15, 2021

cc @artonge

@artonge
Copy link
Contributor

artonge commented Oct 18, 2021

cc @artonge

I'll take a look this week.

@GitKalle
Copy link

GitKalle commented Nov 5, 2021

That problem is not related to FreeBSD. The Problem is that, eg apps.bextcloud.com, does not have a record for CNAME, see DNS Lookup.

image

When you try to get a DNS record via php -r "var_dump(dns_get_record('apps.nextcloud.com', DNS_CNAME));" than the PHP warning occurs:

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?

@Skip75
Copy link

Skip75 commented Nov 8, 2021

FYI I just get that error... and it appears issue was in my DNS host configuration (dig google.com was not resolving).
I fixed my DNS configuration, and issue disapeared.

@nettybun
Copy link

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)

@rsimenok
Copy link

Debian 11, Linux 5.10.0-9-686-pae
Same issue

Error: dns_get_record(): A temporary server error occurred. at /var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83
<<closure>>

OC\Log\ErrorHandler::onError()

/var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php - line 83:

dns_get_record()

/var/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php - line 128:

OC\Http\Client\DnsPinMiddleware->dnsResolve()

/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php - line 35:

OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensiti ... *")

/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 31:

GuzzleHttp\PrepareBodyMiddleware->__invoke()

/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php - line 71:

GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensiti ... *")

/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php - line 63:

GuzzleHttp\RedirectMiddleware->__invoke()

/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php - line 75:

GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensiti ... *")

/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 331:

GuzzleHttp\HandlerStack->__invoke()

/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 168:

GuzzleHttp\Client->transfer()

/var/www/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php - line 187:

GuzzleHttp\Client->requestAsync()

/var/www/nextcloud/lib/private/Http/Client/Client.php - line 223:

GuzzleHttp\Client->request()

/var/www/nextcloud/lib/private/legacy/OC_Util.php - line 1214:

OC\Http\Client\Client->get()

/var/www/nextcloud/lib/private/Setup.php - line 229:

OC_Util->isHtaccessWorking()

/var/www/nextcloud/core/Controller/SetupController.php - line 57:

OC\Setup->getSystemInfo()

/var/www/nextcloud/lib/base.php - line 939:

OC\Core\Controller\SetupController->run("*** sensiti ... *")

/var/www/nextcloud/index.php - line 36:

OC::handleRequest()

@Tucubanito07
Copy link

Tucubanito07 commented Dec 3, 2021

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"}

@nettybun
Copy link

nettybun commented Dec 3, 2021

Run a tcudump udp port 53 and see who nextcloud is reaching out to. For me it was an old decommissioned federated server that I decided to not renew the domain for. I searched for the domain in a pg_dump of my Postgres database which showed me the rows that had it. I deleted those rows.

@Tucubanito07
Copy link

Tucubanito07 commented Dec 3, 2021

Run a tcudump udp port 53 and see who nextcloud is reaching out to. For me it was an old decommissioned federated server that I decided to not renew the domain for. I searched for the domain in a pg_dump of my Postgres database which showed me the rows that had it. I deleted those rows.

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?

@nettybun
Copy link

nettybun commented Dec 3, 2021

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

@thijsjek
Copy link

thijsjek commented Dec 3, 2021

Run a tcudump udp port 53 and see who nextcloud is reaching out to. For me it was an old decommissioned federated server that I decided to not renew the domain for. I searched for the domain in a pg_dump of my Postgres database which showed me the rows that had it. I deleted those rows.

I did a TCPdump, and I found out that there were some cname Records that looked quite odd.
06:28:04.576507 IP test.38614 > 192.168.2.241.domain: 57995+ CNAME? nextcloud.com.mydomain.com. (48)

I don't know how to find or delete this in my Mariadb database.

@nettybun
Copy link

nettybun commented Dec 3, 2021

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.

@Tucubanito07
Copy link

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 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.

@YouveGotMeowxy
Copy link

Hello, I tried to create a fix for this. Can you please try out #32243 and report back if that fixes the issue? Thank you!

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. :)

@YouveGotMeowxy
Copy link

7.4.27

The LSIO container uses 7.4.26 (doh! lol)

@szaimen
Copy link
Contributor

szaimen commented May 4, 2022

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)

@NCC1701G
Copy link

NCC1701G commented May 4, 2022

I use PHP 8.0.16 on a Debian System and I have the same issue.
I think the problem isn't fixed.

@szaimen
Copy link
Contributor

szaimen commented May 4, 2022

In this case, should we suppress the error message? @kesselb @come-nc?

@frank42hh
Copy link

frank42hh commented May 4, 2022

"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):

root@murphy:~ 0# php -r "var_dump(dns_get_record('api.pwnedpasswords.com', DNS_A | DNS_AAAA | DNS_CNAME ));"
array(4) {
[...]

@szaimen
Copy link
Contributor

szaimen commented May 4, 2022

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...

@frank42hh
Copy link

Well, what about another approach... we could catch the error and output a more reasonable message instead, like
Error: dns_get_record(): DNS Query failed at /usr/local/www/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php#83. Please upgrade to at least php [insert relevant version here] to get rid of this error
?

@szaimen
Copy link
Contributor

szaimen commented May 4, 2022

I tried that but it seems like you cannot catch php errors. See #32243 (comment)

@come-nc
Copy link
Contributor

come-nc commented May 5, 2022

I use PHP 8.0.16 on a Debian System and I have the same issue. I think the problem isn't fixed.

@NCC1701G Which issue do you have?
Please explain which error you see.

After re-reading the ticket I think this can be closed and people having failures in dns_get_record actually have a different problem.

When you try to get a DNS record via php -r "var_dump(dns_get_record('apps.nextcloud.com', DNS_CNAME));" than the PHP warning occurs:

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?

@GitKalle I cannot reproduce this problem, if someone can, please share your PHP version?

@NCC1701G
Copy link

NCC1701G commented May 8, 2022

@come-nc
This is the output from my error log:

{"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"}

@come-nc
Copy link
Contributor

come-nc commented May 9, 2022

@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.
What do you have in connectivity_check_domains, anything special?

@NCC1701G
Copy link

I have no "connectivity_check_domains" in my config.php.

@come-nc
Copy link
Contributor

come-nc commented May 12, 2022

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)));
		}
	}

@NCC1701G
Copy link

@come-nc How can I test the code? I'm not a php developer.

@come-nc
Copy link
Contributor

come-nc commented May 19, 2022

@come-nc How can I test the code? I'm not a php developer.

Save it in a file, ie test.php.
Then run it through php with command php ./test.php

You can also save it next to your nextcloud index.php file and open through your browser <nextcloudurl>/test.php

@forestvogo
Copy link

forestvogo commented May 20, 2022

@come-nc How can I test the code? I'm not a php developer.

Save it in a file, ie test.php. Then run it through php with command php ./test.php

You can also save it next to your nextcloud index.php file and open through your browser <nextcloudurl>/test.php

Tested your code and receive the following output in latest docker-image of nextcloud, running behind pihole also in docker-image:
www-data@nextcloud-app:~/html$ php ./text.php http://www.nextcloud.com nextcloud.com {"host":"nextcloud.com","class":"IN","ttl":49510,"type":"SOA","mname":"ns.inwx.de","rname":"hostmaster.inwx.de","serial":2022050206,"refresh":10800,"retry":3600,"expire":604800,"minimum-ttl":3600}http://www.nextcloud.com nextcloud.com {"host":"nextcloud.com","class":"IN","ttl":49510,"type":"SOA","mname":"ns.inwx.de","rname":"hostmaster.inwx.de","serial":2022050206,"refresh":10800,"retry":3600,"expire":604800,"minimum-ttl":3600}http://www.startpage.com startpage.com {"host":"startpage.com","class":"IN","ttl":3600,"type":"SOA","mname":"dns1.p01.nsone.net","rname":"hostmaster.nsone.net","serial":1650927622,"refresh":3600,"retry":600,"expire":1209600,"minimum-ttl":3600}http://www.startpage.com startpage.com {"host":"startpage.com","class":"IN","ttl":3600,"type":"SOA","mname":"dns1.p01.nsone.net","rname":"hostmaster.nsone.net","serial":1650927622,"refresh":3600,"retry":600,"expire":1209600,"minimum-ttl":3600}http://www.eff.org eff.org {"host":"eff.org","class":"IN","ttl":7200,"type":"SOA","mname":"ns1.eff.org","rname":"hostmaster.eff.org","serial":2022051700,"refresh":600,"retry":1800,"expire":604800,"minimum-ttl":1800}http://www.eff.org eff.org {"host":"eff.org","class":"IN","ttl":7200,"type":"SOA","mname":"ns1.eff.org","rname":"hostmaster.eff.org","serial":2022051700,"refresh":600,"retry":1800,"expire":604800,"minimum-ttl":1800}http://www.edri.org edri.org {"host":"edri.org","class":"IN","ttl":10800,"type":"SOA","mname":"ns1.gandi.net","rname":"hostmaster.gandi.net","serial":1652918400,"refresh":10800,"retry":3600,"expire":604800,"minimum-ttl":10800}http://www.edri.org edri.org {"host":"edri.org","class":"IN","ttl":10800,"type":"SOA","mname":"ns1.gandi.net","rname":"hostmaster.gandi.net","serial":1652918400,"refresh":10800,"retry":3600,"expire":604800,"minimum-ttl":10800}

Hope it helps.

@come-nc
Copy link
Contributor

come-nc commented May 23, 2022

@forestvogo And you have errors in your nextcloud log on the same instance?

@forestvogo
Copy link

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:
{"reqId":"xD6wM4E3LUdWohN4pRez","level":3,"time":"2022-05-18T23:19:42+00:00","remoteAddr":"93.131.156.177","user":"Vogo-Admin","app":"PHP","method":"GET","url":"/settings/ajax/checksetup","message":"dns_get_record(): A temporary server error occurred. at /var/www/html/lib/private/Http/Client/DnsPinMiddleware.php#83","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.67 Safari/537.36","version":"23.0.4.1","exception":{"Exception":"Error","Message":"dns_get_record(): A temporary server error occurred. at /var/www/html/lib/private/Http/Client/DnsPinMiddleware.php#83","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::","args":[2,"dns_get_record(): A temporary server error occurred.","/var/www/html/lib/private/Http/Client/DnsPinMiddleware.php",83]},{"file":"/var/www/html/lib/private/Http/Client/DnsPinMiddleware.php","line":83,"function":"dns_get_record","args":["www.startpage.com",1]},{"file":"/var/www/html/lib/private/Http/Client/DnsPinMiddleware.php","line":128,"function":"dnsResolve","class":"OC\\Http\\Client\\DnsPinMiddleware","type":"->","args":["www.startpage.com",1]},{"file":"/var/www/html/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/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameterreplaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["***sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->","args":["*** sensitive parameter replaced ***","*** sensitive parameter replaced ***"]},{"file":"/var/www/html/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->","args":["get",{"__class__":"GuzzleHttp\\Psr7\\Uri"},{"verify":"/var/www/html/resources/config/ca-bundle.crt","timeout":30,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"nextcloud":{"allow_local_address":false},"synchronous":true,"handler":{"__class__":"GuzzleHttp\\HandlerStack"},"http_errors":true,"decode_content":true,"cookies":false,"idn_conversion":false,"_conditional":{"User-Agent":"GuzzleHttp/7"}}]},{"file":"/var/www/html/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","http://www.startpage.com/",{"verify":"/var/www/html/resources/config/ca-bundle.crt","timeout":30,"allow_redirects":{"on_redirect":{"__class__":"Closure"}},"nextcloud":{"allow_local_address":false},"headers":{"User-Agent":"Nextcloud Server Crawler","Accept-Encoding":"gzip"},"synchronous":true}]},{"file":"/var/www/html/apps/settings/lib/Controller/CheckSetupController.php","line":211,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["http://www.startpage.com/"]},{"file":"/var/www/html/apps/settings/lib/Controller/CheckSetupController.php","line":193,"function":"isSiteReachable","class":"OCA\\Settings\\Controller\\CheckSetupController","type":"->","args":["www.startpage.com"]},{"file":"/var/www/html/apps/settings/lib/Controller/CheckSetupController.php","line":855,"function":"hasInternetConnectivityProblems","class":"OCA\\Settings\\Controller\\CheckSetupController","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"check","class":"OCA\\Settings\\Controller\\CheckSetupController","type":"->","args":[]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\CheckSetupController"},"check"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Settings\\Controller\\CheckSetupController"},"check"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Settings\\Controller\\CheckSetupController","check",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"settings.CheckSetup.check"}]},{"file":"/var/www/html/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/settings/ajax/checksetup"]},{"file":"/var/www/html/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Log/ErrorHandler.php","Line":92,"CustomMessage":"--"}}

Volker

@NCC1701G
Copy link

NCC1701G commented May 23, 2022

@come-nc

I get some errors when I run your php file.

http://www.nextcloud.com
nextcloud.com
PHP Warning:  dns_get_record(): A temporary server error occurred. in /root/test.php on line 12
nullhttp://www.nextcloud.com
nextcloud.com
PHP Warning:  dns_get_record(): A temporary server error occurred. in /root/test.php on line 12
nullhttp://www.startpage.com
startpage.com
PHP Warning:  dns_get_record(): A temporary server error occurred. in /root/test.php on line 12
nullhttp://www.startpage.com
startpage.com
PHP Warning:  dns_get_record(): A temporary server error occurred. in /root/test.php on line 12
nullhttp://www.eff.org
eff.org
PHP Warning:  dns_get_record(): A temporary server error occurred. in /root/test.php on line 12
nullhttp://www.eff.org
eff.org
PHP Warning:  dns_get_record(): A temporary server error occurred. in /root/test.php on line 12
nullhttp://www.edri.org
edri.org
PHP Warning:  dns_get_record(): A temporary server error occurred. in /root/test.php on line 12
nullhttp://www.edri.org
edri.org
PHP Warning:  dns_get_record(): A temporary server error occurred. in /root/test.php on line 12

@come-nc
Copy link
Contributor

come-nc commented May 23, 2022

@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.
If you run host -t SOA nextcloud.com or dig nextcloud.com soa on the same machine do you also get an error?

@NCC1701G
Copy link

@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.
Thank you for your help.

@szaimen
Copy link
Contributor

szaimen commented Jan 9, 2023

Hi, please update to 24.0.8 or better 25.0.2 and report back if it fixes the issue. Thank you!

@szaimen szaimen added needs info 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed 2. developing Work in progress labels Jan 9, 2023
@szaimen szaimen closed this as completed Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug help wanted needs info
Projects
None yet
Development

Successfully merging a pull request may close this issue.