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]: RuntimeException: Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6". #33567

Closed
6 of 9 tasks
tessus opened this issue Aug 16, 2022 · 24 comments · Fixed by #44475
Closed
6 of 9 tasks
Labels
1. to develop Accepted and waiting to be taken care of 25-feedback bug

Comments

@tessus
Copy link

tessus commented Aug 16, 2022

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
  • Nextcloud Server is running on 64bit capable CPU, PHP and OS.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

The update server could not be reached since 3 days to check for new updates.
Please check the Nextcloud and server log files for errors.

{
  "reqId": "NCNhjvyso8guXr9TQyzs",
  "level": 2,
  "time": "2022-08-16T18:32:01+02:00",
  "remoteAddr": "XX.XX.XX.XX",
  "user": "xxxx",
  "app": "appstoreFetcher",
  "method": "GET",
  "url": "/apps/serverinfo/update",
  "message": "Unable to check Ipv6. Check that PHP was not compiled with option \"disable-ipv6\".",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:103.0) Gecko/20100101 Firefox/103.0",
  "version": "23.0.8.1",
  "exception": {
    "Exception": "RuntimeException",
    "Message": "Unable to check Ipv6. Check that PHP was not compiled with option \"disable-ipv6\".",
    "Code": 0,
    "Trace": [
      {
        "file": "/data/projects/nextcloud/lib/private/Http/IpUtils.php",
        "line": 45,
        "function": "checkIp6",
        "class": "OC\\Http\\IpUtils",
        "type": "::",
        "args": [
          "2a01:4f8:130:32f1::53",
          "100.64.0.0/10"
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/Http/Client/LocalAddressChecker.php",
        "line": 49,
        "function": "checkIp",
        "class": "OC\\Http\\IpUtils",
        "type": "::",
        "args": [
          "2a01:4f8:130:32f1::53",
          [
            "100.64.0.0/10",
            "192.0.0.0/24"
          ]
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php",
        "line": 136,
        "function": "ThrowIfLocalIp",
        "class": "OC\\Http\\Client\\LocalAddressChecker",
        "type": "->",
        "args": [
          "2a01:4f8:130:32f1::53"
        ]
      },
      {
        "file": "/data/projects/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": "/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",
        "line": 31,
        "function": "__invoke",
        "class": "GuzzleHttp\\PrepareBodyMiddleware",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***",
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php",
        "line": 71,
        "function": "GuzzleHttp\\{closure}",
        "class": "GuzzleHttp\\Middleware",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php",
        "line": 63,
        "function": "__invoke",
        "class": "GuzzleHttp\\RedirectMiddleware",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***",
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php",
        "line": 75,
        "function": "GuzzleHttp\\{closure}",
        "class": "GuzzleHttp\\Middleware",
        "type": "::",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
        "line": 331,
        "function": "__invoke",
        "class": "GuzzleHttp\\HandlerStack",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***",
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
        "line": 168,
        "function": "transfer",
        "class": "GuzzleHttp\\Client",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***",
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php",
        "line": 187,
        "function": "requestAsync",
        "class": "GuzzleHttp\\Client",
        "type": "->",
        "args": [
          "get",
          {
            "__class__": "GuzzleHttp\\Psr7\\Uri"
          },
          [
            "/data/projects/nextcloud/resources/config/ca-bundle.crt",
            60,
            [
              {
                "__class__": "Closure"
              }
            ],
            [
              false
            ],
            true,
            {
              "__class__": "GuzzleHttp\\HandlerStack"
            },
            true,
            true,
            false,
            false,
            [
              "GuzzleHttp/7"
            ]
          ]
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/Http/Client/Client.php",
        "line": 223,
        "function": "request",
        "class": "GuzzleHttp\\Client",
        "type": "->",
        "args": [
          "get",
          "https://apps.nextcloud.com/api/v1/apps.json",
          [
            "/data/projects/nextcloud/resources/config/ca-bundle.crt",
            60,
            [
              {
                "__class__": "Closure"
              }
            ],
            [
              false
            ],
            [
              "Nextcloud Server Crawler",
              "gzip"
            ],
            true
          ]
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php",
        "line": 120,
        "function": "get",
        "class": "OC\\Http\\Client\\Client",
        "type": "->",
        "args": [
          "https://apps.nextcloud.com/api/v1/apps.json",
          [
            60
          ]
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php",
        "line": 87,
        "function": "fetch",
        "class": "OC\\App\\AppStore\\Fetcher\\Fetcher",
        "type": "->",
        "args": [
          "",
          ""
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php",
        "line": 192,
        "function": "fetch",
        "class": "OC\\App\\AppStore\\Fetcher\\AppFetcher",
        "type": "->",
        "args": [
          "",
          "",
          false
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php",
        "line": 186,
        "function": "get",
        "class": "OC\\App\\AppStore\\Fetcher\\Fetcher",
        "type": "->",
        "args": [
          false
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/Installer.php",
        "line": 433,
        "function": "get",
        "class": "OC\\App\\AppStore\\Fetcher\\AppFetcher",
        "type": "->",
        "args": [
          false
        ]
      },
      {
        "file": "/data/projects/nextcloud/apps/serverinfo/lib/SystemStatistics.php",
        "line": 181,
        "function": "isUpdateAvailable",
        "class": "OC\\Installer",
        "type": "->",
        "args": [
          "accessibility"
        ]
      },
      {
        "file": "/data/projects/nextcloud/apps/serverinfo/lib/SystemStatistics.php",
        "line": 90,
        "function": "getAppsInfo",
        "class": "OCA\\ServerInfo\\SystemStatistics",
        "type": "->",
        "args": []
      },
      {
        "file": "/data/projects/nextcloud/apps/serverinfo/lib/Controller/PageController.php",
        "line": 60,
        "function": "getSystemStatistics",
        "class": "OCA\\ServerInfo\\SystemStatistics",
        "type": "->",
        "args": []
      },
      {
        "file": "/data/projects/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 217,
        "function": "update",
        "class": "OCA\\ServerInfo\\Controller\\PageController",
        "type": "->",
        "args": [
          "*** sensitive parameters replaced ***"
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 126,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\ServerInfo\\Controller\\PageController"
          },
          "update"
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/AppFramework/App.php",
        "line": 157,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->",
        "args": [
          {
            "__class__": "OCA\\ServerInfo\\Controller\\PageController"
          },
          "update"
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/private/Route/Router.php",
        "line": 302,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::",
        "args": [
          "OCA\\ServerInfo\\Controller\\PageController",
          "update",
          {
            "__class__": "OC\\AppFramework\\DependencyInjection\\DIContainer"
          },
          [
            "serverinfo.page.update"
          ]
        ]
      },
      {
        "file": "/data/projects/nextcloud/lib/base.php",
        "line": 1008,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->",
        "args": [
          "/apps/serverinfo/update"
        ]
      },
      {
        "file": "/data/projects/nextcloud/index.php",
        "line": 36,
        "function": "handleRequest",
        "class": "OC",
        "type": "::",
        "args": []
      }
    ],
    "File": "/data/projects/nextcloud/lib/private/Http/IpUtils.php",
    "Line": 116,
    "CustomMessage": "Unable to check Ipv6. Check that PHP was not compiled with option \"disable-ipv6\"."
  },
  "id": "62fbc681e3834"
}

My server has IPv6 completely disabled and thus PHP was also compiled with disable-ipv6. This issue only became apparent after the lat update from 23.0.7 to 23.0.8.

It makes no sense to force people to setup IPv6 or compile IPv6 into PHP when IPv6 is not used at all.

Steps to reproduce

  1. Go to Settings -> Overview
  2. or wait a few days
  3. check log file

Expected behavior

Nestcloud should ignore IPv6 if it is not used and just use IPv4 instead and not throw an error that IPv6 support is not installed.

Installation method

Other

Operating system

Other

PHP engine version

PHP 8.0

Web server

Apache (supported)

Database engine version

MySQL

Is this bug present after an update or on a fresh install?

Updated from a minor version (ex. 22.2.3 to 22.2.4)

Are you using the Nextcloud Server Encryption module?

Encryption is Disabled

What user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "23.0.8.1",
        "installed": true,
        "forcessl": true,
        "loglevel": 0,
        "maintenance": false,
        "trusted_domains": [
            "xx.xx.xx"
        ],
        "share_folder": "\/Shared",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logdateformat": "Y-m-d H:i:s O",
        "logtimezone": "Europe\/Vienna",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "sendmail",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpsecure": "ssl",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "filelocking.enabled": true,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "timeout": 0
        },
        "appstore.experimental.enabled": true,
        "trashbin_retention_obligation": "auto",
        "updater.release.channel": "stable",
        "htaccess.RewriteBase": "\/",
        "overwrite.cli.url": "https:\/\/xxx.xxx.xxx",
        "auth.bruteforce.protection.enabled": false,
        "simpleSignUpLink.shown": false,
        "upgrade.disable-web": true,
        "theme": "evermeet",
        "mail_smtpauthtype": "PLAIN",
        "mail_smtpauth": 1,
        "mail_sendmailmode": "smtp",
        "filesystem_check_changes": 0,
        "mysql.utf8mb4": true,
        "connectivity_check_domains": [
            "xx.xx"
        ],
        "default_phone_region": "CA",
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***"
    }
}


### List of activated Apps

```shell
Enabled:
  - accessibility: 1.9.0
  - activity: 2.15.0
  - admin_audit: 1.13.0
  - announcementcenter: 6.3.1
  - apporder: 0.15.0
  - bookmarks: 11.0.1
  - bruteforcesettings: 2.4.0
  - calendar: 3.4.2
  - circles: 23.1.2
  - cloud_federation_api: 1.6.0
  - comments: 1.13.0
  - contacts: 4.2.0
  - contactsinteraction: 1.4.0
  - dav: 1.21.0
  - federatedfilesharing: 1.13.0
  - federation: 1.13.0
  - files: 1.18.0
  - files_external: 1.15.0
  - files_pdfviewer: 2.4.0
  - files_rightclick: 1.2.0
  - files_sharing: 1.15.0
  - files_trashbin: 1.13.0
  - files_versions: 1.16.0
  - files_videoplayer: 1.12.0
  - firstrunwizard: 2.12.0
  - impersonate: 1.10.0
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - nextcloud_announcements: 1.12.0
  - notes: 4.4.0
  - notifications: 2.11.1
  - notify_push: 0.4.0
  - oauth2: 1.11.0
  - password_policy: 1.13.0
  - phonetrack: 0.7.0
  - photos: 1.5.0
  - polls: 3.7.0
  - privacy: 1.7.0
  - provisioning_api: 1.13.0
  - serverinfo: 1.13.0
  - settings: 1.5.0
  - sharebymail: 1.13.0
  - systemtags: 1.13.0
  - tasks: 0.14.4
  - text: 3.4.1
  - theming: 1.14.0
  - twofactor_backupcodes: 1.12.0
  - twofactor_totp: 6.4.0
  - updatenotification: 1.13.0
  - viewer: 1.7.0
  - weather_status: 1.3.0
  - workflowengine: 2.5.0
Disabled:
  - activitylog: 0.0.2
  - dashboard: 7.0.0
  - encryption
  - files_markdown: 2.3.6
  - recommendations: 0.5.0
  - support: 1.4.0
  - survey_client: 0.1.5
  - twofactor_u2f: 6.3.1
  - user_ldap
  - user_status: 1.0.1


### Nextcloud Signing status

```shell
No errors have been found.

Nextcloud Logs

{"reqId":"NCNhjvyso8guXr9TQyzs","level":2,"time":"2022-08-16T18:32:01+02:00","remoteAddr":"XX.XX.XX.XX","user":"xxxx","app":"appstoreFetcher","method":"GET","url":"/apps/serverinfo/update","message":"Unable to check Ipv6. Check that PHP was not compiled with option \"disable-ipv6\".","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:103.0) Gecko/20100101 Firefox/103.0","version":"23.0.8.1","exception":{"Exception":"RuntimeException","Message":"Unable to check Ipv6. Check that PHP was not compiled with option \"disable-ipv6\".","Code":0,"Trace":[{"file":"/data/projects/nextcloud/lib/private/Http/IpUtils.php","line":45,"function":"checkIp6","class":"OC\\Http\\IpUtils","type":"::","args":["2a01:4f8:130:32f1::53","100.64.0.0/10"]},{"file":"/data/projects/nextcloud/lib/private/Http/Client/LocalAddressChecker.php","line":49,"function":"checkIp","class":"OC\\Http\\IpUtils","type":"::","args":["2a01:4f8:130:32f1::53",["100.64.0.0/10","192.0.0.0/24"]]},{"file":"/data/projects/nextcloud/lib/private/Http/Client/DnsPinMiddleware.php","line":136,"function":"ThrowIfLocalIp","class":"OC\\Http\\Client\\LocalAddressChecker","type":"->","args":["2a01:4f8:130:32f1::53"]},{"file":"/data/projects/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":"/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":31,"function":"__invoke","class":"GuzzleHttp\\PrepareBodyMiddleware","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php","line":71,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Middleware.php","line":63,"function":"__invoke","class":"GuzzleHttp\\RedirectMiddleware","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php","line":75,"function":"GuzzleHttp\\{closure}","class":"GuzzleHttp\\Middleware","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":331,"function":"__invoke","class":"GuzzleHttp\\HandlerStack","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":168,"function":"transfer","class":"GuzzleHttp\\Client","type":"->","args":["*** sensitive parameters replaced ***","*** sensitive parameters replaced ***"]},{"file":"/data/projects/nextcloud/3rdparty/guzzlehttp/guzzle/src/Client.php","line":187,"function":"requestAsync","class":"GuzzleHttp\\Client","type":"->","args":["get",{"__class__":"GuzzleHttp\\Psr7\\Uri"},["/data/projects/nextcloud/resources/config/ca-bundle.crt",60,[{"__class__":"Closure"}],[false],true,{"__class__":"GuzzleHttp\\HandlerStack"},true,true,false,false,["GuzzleHttp/7"]]]},{"file":"/data/projects/nextcloud/lib/private/Http/Client/Client.php","line":223,"function":"request","class":"GuzzleHttp\\Client","type":"->","args":["get","https://apps.nextcloud.com/api/v1/apps.json",["/data/projects/nextcloud/resources/config/ca-bundle.crt",60,[{"__class__":"Closure"}],[false],["Nextcloud Server Crawler","gzip"],true]]},{"file":"/data/projects/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php","line":120,"function":"get","class":"OC\\Http\\Client\\Client","type":"->","args":["https://apps.nextcloud.com/api/v1/apps.json",[60]]},{"file":"/data/projects/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php","line":87,"function":"fetch","class":"OC\\App\\AppStore\\Fetcher\\Fetcher","type":"->","args":["",""]},{"file":"/data/projects/nextcloud/lib/private/App/AppStore/Fetcher/Fetcher.php","line":192,"function":"fetch","class":"OC\\App\\AppStore\\Fetcher\\AppFetcher","type":"->","args":["","",false]},{"file":"/data/projects/nextcloud/lib/private/App/AppStore/Fetcher/AppFetcher.php","line":186,"function":"get","class":"OC\\App\\AppStore\\Fetcher\\Fetcher","type":"->","args":[false]},{"file":"/data/projects/nextcloud/lib/private/Installer.php","line":433,"function":"get","class":"OC\\App\\AppStore\\Fetcher\\AppFetcher","type":"->","args":[false]},{"file":"/data/projects/nextcloud/apps/serverinfo/lib/SystemStatistics.php","line":181,"function":"isUpdateAvailable","class":"OC\\Installer","type":"->","args":["accessibility"]},{"file":"/data/projects/nextcloud/apps/serverinfo/lib/SystemStatistics.php","line":90,"function":"getAppsInfo","class":"OCA\\ServerInfo\\SystemStatistics","type":"->","args":[]},{"file":"/data/projects/nextcloud/apps/serverinfo/lib/Controller/PageController.php","line":60,"function":"getSystemStatistics","class":"OCA\\ServerInfo\\SystemStatistics","type":"->","args":[]},{"file":"/data/projects/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"update","class":"OCA\\ServerInfo\\Controller\\PageController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/data/projects/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\ServerInfo\\Controller\\PageController"},"update"]},{"file":"/data/projects/nextcloud/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\ServerInfo\\Controller\\PageController"},"update"]},{"file":"/data/projects/nextcloud/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\ServerInfo\\Controller\\PageController","update",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},["serverinfo.page.update"]]},{"file":"/data/projects/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/apps/serverinfo/update"]},{"file":"/data/projects/nextcloud/index.php","line":36,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/data/projects/nextcloud/lib/private/Http/IpUtils.php","Line":116,"CustomMessage":"Unable to check Ipv6. Check that PHP was not compiled with option \"disable-ipv6\"."},"id":"62fbc681e3834"}

Additional info

I always update via the updater.phar on the cli. No optio for that in this template...

@tessus tessus added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Aug 16, 2022
@kesselb
Copy link
Contributor

kesselb commented Aug 17, 2022

Thanks for reporting 👍

I guess we need to wrap the checkIp calls with try-catch: https://github.com/nextcloud/server/blob/c5ffd7ce32a74c06dddd55652edea5c896ee9b3d/lib/private/Http/Client/LocalAddressChecker.php

@kesselb kesselb 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 Aug 17, 2022
@tessus
Copy link
Author

tessus commented Aug 17, 2022

You are welcome. However, I am not sure whether the current tests are valid in the first place. You check only domain names for IPv6, not if IPv6 is actually able to reach an IPv6 host on the Internet.

e.g. I know several people and also companies that use IPv6 internally (and do not use any of the domain names you are testing for), but do have only a IPv4 gateway to reach the Internet for accessing IPv4 addresses.
I also know of situations where an IPv6 address is assigned to the same interface that is using IPv4, but has no connectivity at all (the IPv6 address).

@tessus
Copy link
Author

tessus commented Aug 28, 2022

Additionally, I am not sure what this code is supposed to do?

Are you trying to find local link addresses? In that case

$localRanges = [
'100.64.0.0/10', // See RFC 6598
'192.0.0.0/24', // See RFC 6890
];
is wrong. Someone did not understand the referenced RFC. You should read RFC3927 instead.

@kesselb
Copy link
Contributor

kesselb commented Aug 29, 2022

I am not sure what this code is supposed to do?

#33031

The patch improve the detection of local ip addresses.

@tessus
Copy link
Author

tessus commented Aug 29, 2022

The description in the PR has no useful information.

If you are looking for a private IP range, it is wrong. 192.168.0.0/16 is a correct private C-class net.
If you are looking for a link local address, the range is wrong. 169.254.0.0/16 is a link local IPv4 address range.

The code uses the term "local" IP address. What does that mean? Unfortunately it can mean a lot. It can be the IP address of your computer if it is behind a public facing IP.
A link local address is an address the OS assigns, if there's no DHCP server, nor a static address is set.

Either way, I believe this needs a bit more explanation what the dev of that code intended.

@heeplr
Copy link

heeplr commented Aug 31, 2022

I also encounter this issue and get "Update server couldn't be reached for X days" notifications.

When I insert

public static function checkIp6(string $requestIp, string $ip) {
                $cacheKey = $requestIp.'-'.$ip;
                if (isset(self::$checkedIps[$cacheKey])) {
                        return self::$checkedIps[$cacheKey];
                }

+                return self::$checkedIps[$cacheKey] = false;

                if (!((\extension_loaded('sockets') && \defined('AF_INET6')) || @inet_pton('::1'))) {
                        throw new \RuntimeException('Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6".');
                }

in lib/private/Http/IpUtils.php everything works as expected.

IMO nextcloud should conservatively fall back to IPv4 in case IPv6 detection fails instead of aborting with the Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6" exception.
Obviously this message implies missing IPv6 support, which should resemble the actual test result of checkIp6().

EDIT: Bug is still present in v24.0.5

@kesselb
Copy link
Contributor

kesselb commented Sep 19, 2022

Hey,

#33031 was related to a security report. The report is disclosed now https://hackerone.com/reports/1608039. That should give you some background information why the check is here.

I assume the actual error / missing piece is somewhere else.

2a01:4f8:130:32f1::53 belongs to apps.nextcloud.com. If IPv6 is not available on the system we should probably not query an IPv6 address at all.

$dnsTypes = [DNS_A, DNS_AAAA, DNS_CNAME];

A solution could be to copy the check from checkIp6 and pass it to DnsPinMiddleware via constructor and adjust the above lines to only fetch ipv6 if enabled. However not everyone without IPv6 compiles php without IPv6 support. An additional configuration option is probably the better choice.

@tessus
Copy link
Author

tessus commented Sep 19, 2022

Thanks a bunch for the explanation.

I just want to say that disabling ipv6 on the OS level and/or not compiling ipv6 support into PHP is not that uncommon. The reason is that sometimes even though IPv6 is not configured and used, SW still tries to initialize it, setup an address, and/or use it. It generates unnecessary overhead and often many warnings, even though everything is fine and correctly setup.

@kesselb kesselb mentioned this issue Sep 20, 2022
2 tasks
@heeplr
Copy link

heeplr commented Oct 29, 2022

In 25.0.0 the Exception moved but it's still there:

[internet_connection_check] Fehler: RuntimeException: Unable to check Ipv6. Check that PHP was not compiled with option "disable-ipv6". at <<closure>>

 0. /var/www/hosts/cloud/htdocs/3rdparty/symfony/http-foundation/IpUtils.php line 52
    Symfony\Component\HttpFoundation\IpUtils::checkIp6()
 1. /var/www/hosts/cloud/htdocs/lib/private/Http/Client/LocalAddressChecker.php line 66
    Symfony\Component\HttpFoundation\IpUtils::checkIp()
 2. /var/www/hosts/cloud/htdocs/lib/private/Http/Client/DnsPinMiddleware.php line 136
    OC\Http\Client\LocalAddressChecker->ThrowIfLocalIp()
 3. /var/www/hosts/cloud/htdocs/3rdparty/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php line 35
    OC\Http\Client\DnsPinMiddleware->OC\Http\Client\{closure}("*** sensitive parameters replaced ***")
 4. /var/www/hosts/cloud/htdocs/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 31
    GuzzleHttp\PrepareBodyMiddleware->__invoke()
 5. /var/www/hosts/cloud/htdocs/3rdparty/guzzlehttp/guzzle/src/RedirectMiddleware.php line 71
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 6. /var/www/hosts/cloud/htdocs/3rdparty/guzzlehttp/guzzle/src/Middleware.php line 63
    GuzzleHttp\RedirectMiddleware->__invoke()
 7. /var/www/hosts/cloud/htdocs/3rdparty/guzzlehttp/guzzle/src/HandlerStack.php line 75
    GuzzleHttp\Middleware::GuzzleHttp\{closure}("*** sensitive parameters replaced ***")
 8. /var/www/hosts/cloud/htdocs/3rdparty/guzzlehttp/guzzle/src/Client.php line 331
    GuzzleHttp\HandlerStack->__invoke()
 9. /var/www/hosts/cloud/htdocs/3rdparty/guzzlehttp/guzzle/src/Client.php line 168
    GuzzleHttp\Client->transfer()
10. /var/www/hosts/cloud/htdocs/3rdparty/guzzlehttp/guzzle/src/Client.php line 187
    GuzzleHttp\Client->requestAsync()
11. /var/www/hosts/cloud/htdocs/lib/private/Http/Client/Client.php line 218
    GuzzleHttp\Client->request()
12. /var/www/hosts/cloud/htdocs/apps/settings/lib/Controller/CheckSetupController.php line 211
    OC\Http\Client\Client->get()
13. /var/www/hosts/cloud/htdocs/apps/settings/lib/Controller/CheckSetupController.php line 193
    OCA\Settings\Controller\CheckSetupController->isSiteReachable()
14. /var/www/hosts/cloud/htdocs/apps/settings/lib/Controller/CheckSetupController.php line 868
    OCA\Settings\Controller\CheckSetupController->hasInternetConnectivityProblems()
15. /var/www/hosts/cloud/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 225
    OCA\Settings\Controller\CheckSetupController->check()
16. /var/www/hosts/cloud/htdocs/lib/private/AppFramework/Http/Dispatcher.php line 133
    OC\AppFramework\Http\Dispatcher->executeController()
17. /var/www/hosts/cloud/htdocs/lib/private/AppFramework/App.php line 172
    OC\AppFramework\Http\Dispatcher->dispatch()
18. /var/www/hosts/cloud/htdocs/lib/private/Route/Router.php line 298
    OC\AppFramework\App::main()
19. /var/www/hosts/cloud/htdocs/lib/base.php line 1047
    OC\Route\Router->match()
20. /var/www/hosts/cloud/htdocs/index.php line 36
    OC::handleRequest()

@heeplr
Copy link

heeplr commented Nov 26, 2022

Problem still persists in 25.0.1

Does anyone maybe have a better workaround than patching the source directly for not missing updates?

@theerijn
Copy link

Problem still exists in 25.0,2.

Like tessus, my host does not have IPv6 enabled (in de kernel / network stack). I have enabled IPv6 in PHP only to work around this issue and that works great. I can get updates and see the appstore again.

@Stift1
Copy link

Stift1 commented Feb 2, 2023

Also my host does not have IPv6 enabled and my last running version is 24.0.3. Upgrading to any newer version leads to the problem described above. Unfortunately my technical knowledge is very limited to help, but does anybody know will there be version with the IPv6 issue fixed In the near future?

@theerijn
Copy link

theerijn commented Feb 3, 2023

Use your package manager to upgrade Nextcloud to a version that's not affected. Once Nextcloud is at a version that has this bug fixed, you will be able to update the individual apps. Until then, you will not get notifications like "Update available for application X"

@heeplr
Copy link

heeplr commented Feb 3, 2023

@theerijn Downgrading nextcloud is not supported. Also this assumes, that it will be fixed before 26.x.x release since skipping major versions also isn't supported.

I'm patching the source manually for now but I hope this will be adressed soon since it's a major brickwall. Fingers crossed.

@ehirt
Copy link

ehirt commented Mar 3, 2023

Issue still present in 25.0.4

@heeplr
Copy link

heeplr commented Mar 25, 2023

Issue still present in 26.0.0.

As as side note, I'd like to suggest adding this check to the "Security & Setup Warnings" procedure.

It's not optimal to get a notification "The update server can't be reached" after three days. IMHO, it should come instantly as a warning like all other post-upgrade/setup warnings.

@Stift1
Copy link

Stift1 commented May 8, 2023

Does anybody know, is this issue still present or fixed in the latest versions? Thanks

@heeplr
Copy link

heeplr commented May 16, 2023

@Stift1 Just checked. Still persists in 26.0.1

(Had to wait since you don't know immediately after the update when it doesn't work. Nextcloud gives a notification "Update server couldn't be reached in 3 days")

@canoine
Copy link

canoine commented Aug 28, 2023

Still persists in 26.0.5, thank you @heeplr for the ugly, but efficient workaround.

@canoine
Copy link

canoine commented Oct 18, 2023

Still persists in 27.0.2, and I suppose 27.1.x versions are in the same state.

@kesselb
Copy link
Contributor

kesselb commented Oct 18, 2023

Still persists in 27.0.2, and I suppose 27.1.x versions are in the same state.

The issue is still open, and therefore it's not a big surprise, right?
Please refrain from further "still persists" comments as it creates unnecessary notifications.

@canoine
Copy link

canoine commented Oct 18, 2023

"unnecessary" ? Well... All the Nextcloud instances admins, who get regularly such "unnecessary" notifications because of this bug, might disagree, I guess.

I know that we all have only 24 hours a day, that most of the devs are volunteers, and this bug is not really so important, and so on. I understand, and I respect that.
That said, this bug is open for more than one year, and seems rather easy to fix, AFAIK.

@andrewhotlab
Copy link

I agree with @canoine: it’s pretty annoying… not the notification, but the delay in fixing such a little but persistent bug! :)

@nextcloud nextcloud locked as spam and limited conversation to collaborators Oct 18, 2023
@nextcloud nextcloud unlocked this conversation Oct 18, 2023
@nextcloud nextcloud locked as too heated and limited conversation to collaborators Oct 18, 2023
@kesselb
Copy link
Contributor

kesselb commented Mar 27, 2024

Fixed with Nextcloud 29

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1. to develop Accepted and waiting to be taken care of 25-feedback bug
Projects
None yet
10 participants