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

Better error message when configured hostnames/URLs are invalid (versus Trying to access array offset on value of type bool) #49370

Closed
5 of 8 tasks
tigermick opened this issue Nov 19, 2024 · 4 comments · Fixed by #49373

Comments

@tigermick
Copy link

tigermick commented Nov 19, 2024

⚠️ This issue respects the following points: ⚠️

Bug description

Hi,
I have no operating problem about my nextcloud instance, but in my nextcloud log, I have this error :
Trying to access array offset on value of type bool at /paht/of/my/nextcloud/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php#97
Can someone tell me why and what's the problem please ?

Steps to reproduce

1.just visit web interface of my nextcloud
2.go in log
3.I can see the error

Expected behavior

No errors ...

Nextcloud Server version

30

Operating system

Debian/Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database engine version

MariaDB

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

Upgraded to a MAJOR version (ex. 28 to 29)

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": "30.0.2.2",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "default_language": "fr",
        "installed": true,
        "maxZipInputSize": 1073741824,
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "enable_avatars": false,
        "allowZipDownload": true,
        "loglevel": 1,
        "maintenance": false,
        "theme": "",
        "default_phone_region": "FR",
        "enable_previews": true,
        "preview_max_x": 640,
        "preview_max_y": 640,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "enabledPreviewProviders": [
            "OC\\Preview\\Movie",
            "OC\\Preview\\Image"
        ],
        "mail_smtpmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "0": [
            "192.168.0.5"
        ],
        "overwrite.cli.url": xwww.com",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "forcessl": true,
        "trusted_domains": [
            "xwww.com",
            "192.168.0.43",
            "192.168.0.21",
        ],
        "secret": "***REMOVED SENSITIVE VALUE***",
        "appstore.experimental.enabled": true,
        "filelocking.enabled": "true",
        "memcache.locking": "\\OC\\Memcache\\APCu",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 0,
            "password": "***REMOVED SENSITIVE VALUE***"
        },
        "debug": false,
        "htaccess.RewriteBase": "\/",
        "check_for_working_htaccess": false,
        "mail_smtpauthtype": "LOGIN",
        "maintenance_window_start": 1,
        "mysql.utf8mb4": true,
        "app_install_overwrite": [
            "calendar",
            "end_to_end_encryption",
            "keeweb",
            "previewgenerator",
            "talk_simple_poll",
            "libresign"
        ]
    }
}

List of activated Apps

Enabled:
  - activity: 3.0.0
  - admin_audit: 1.20.0
  - app_api: 4.0.0
  - bruteforcesettings: 3.0.0
  - calendar: 5.0.1
  - cloud_federation_api: 1.13.0
  - contacts: 6.1.1
  - contactsinteraction: 1.11.0
  - cookbook: 0.11.2
  - dashboard: 7.10.0
  - dav: 1.31.1
  - federatedfilesharing: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_external: 1.22.0
  - files_reminders: 1.3.0
  - files_sharing: 1.22.0
  - files_trashbin: 1.20.1
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - music: 2.0.1
  - nextcloud_announcements: 2.0.0
  - notes: 4.11.0
  - notifications: 3.0.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - passwords: 2024.11.20
  - photos: 3.0.2
  - previewgenerator: 5.7.0
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - spreed: 20.0.2
  - support: 2.0.0
  - survey_client: 2.0.0
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - updatenotification: 1.20.0
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - circles: 30.0.0 (installed 0.18.4)
  - comments: 1.20.1 (installed 0.3.0)
  - encryption: 2.18.0
  - federation: 1.20.0 (installed 0.1.0)
  - files_pdfviewer: 3.0.0 (installed 1.2.1)
  - files_versions: 1.23.0 (installed 1.12.0)
  - firstrunwizard: 3.0.0 (installed 1.0)
  - forms: 4.3.3 (installed 4.3.3)
  - groupfolders: 18.0.5 (installed 18.0.5)
  - libresign: 10.2.0 (installed 10.2.0)
  - phonetrack: 0.8.1 (installed 0.8.1)
  - recommendations: 3.0.0 (installed 1.3.0)
  - suspicious_login: 8.0.0
  - systemtags: 1.20.0 (installed 0.3.0)
  - twofactor_nextcloud_notification: 4.0.0
  - twofactor_totp: 12.0.0-dev
  - user_ldap: 1.21.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

{"reqId":"cJNCntClIpqPDqyVL76I","level":3,"time":"2024-11-19T10:43:30+00:00","remoteAddr":"192.168.0.254","user":"tigermick","app":"PHP","method":"GET","url":"/settings/ajax/checksetup","message":"Trying to access array offset on value of type bool at /var/www/owncloud/apps/settings/lib/SetupChecks/CheckServerResponseTrait.php#97","userAgent":"Mozilla/5.0 (Android 15; Mobile; rv:132.0) Gecko/132.0 Firefox/132.0","version":"30.0.2.2","data":{"app":"PHP"},"id":"673c6d655a422"}

Additional info

No response

@tigermick tigermick added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Nov 19, 2024
@solracsf solracsf linked a pull request Nov 19, 2024 that will close this issue
4 tasks
@solracsf solracsf added 3. to review Waiting for reviews and removed 0. Needs triage Pending check for reproducibility or if it fits our roadmap labels Nov 19, 2024
@joshtrichards
Copy link
Member

joshtrichards commented Nov 19, 2024

Not a bug.

The cause is likely invalid syntax for your IPv6 addresses (which likely don't even have to be listed - unless you're really entering them manually in your browser URL bar - but that's up to you):

        "trusted_domains": [
            "tigermick.hd.free.fr",
            "192.168.0.43",
            "88.172.43.168",
            "192.168.0.21",
            "fe80::be24:11ff:fe64:a32a",
            "2a01:e0a:b0a:ea00:be24:11ff:fe64:a32a"
        ],

See https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/config_sample_php_parameters.html#trusted-domains

I'll see if I can improve the checking for this so the logging is at least clearer. Nevermind, @solracsf is already on it. :)

@citizenserious
Copy link

citizenserious commented Nov 19, 2024

Related to #48820

I reduced the trusted_domains to a minimum (I also removed ipv6 in /var/www/nextcloud/config/config.php then the error log entry is no longer shown.
Test this when you open up the overview page in settings.

@joshtrichards joshtrichards changed the title [Bug]: Trying to access array offset on value of type bool Better error message when configured hostnames/URLs are invalid (versus Trying to access array offset on value of type bool) Nov 19, 2024
@tigermick
Copy link
Author

Oh sorry @joshtrichards ... 😅
I had another error message soon with major upgrade to 30.0.1 cause of a bug (related to #47880) and i tried to add other trusted domains in config file to try to fix it before i looked the issue here.
And after upgrade to 30.0.2 and fix this problem i had my problem "Trying to access array offset on value of type bool"
I just removed ipv6 in config file like you told me and all works well !
Big thanks and sorry to disturbed you ...

@solracsf
Copy link
Member

Fixed by #49373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants