Skip to content

[Bug]: Undefined array key with FreeBSD + jails #360

@cyrilst

Description

@cyrilst

⚠️ 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.
  • I agree to follow Nextcloud's Code of Conduct.

Bug description

These errors appear in logs when I visit the page settings/admin/serverinfo:

Undefined array key 0 at /var/www/cloud/apps/serverinfo/lib/OperatingSystems/FreeBSD.php#140
Undefined array key 0 at /var/www/cloud/apps/serverinfo/lib/OperatingSystems/FreeBSD.php#183

The variables $gw and $speed are expected to be undefined in some cases (inside a FreeBSD jail), and should be checked (maybe with the empty() fuction?) before being used.

They are expected to be undefined, because there is no default gateway inside the jail, and there is no speed set for the bridge interface used in the jail.

Steps to reproduce

  1. in a FreeBSD system, create a jail
  2. in the jail, install php80
  3. in the jail, start php-fpm
  4. configure the web server tu use the php-fpm inside the jail
  5. log into the NextCloud instance
  6. click on settings
  7. in the admin section, click on serverinfo
  8. display is accurate (no gateway, and speed displays "unknown"), but error can now be found in the logs

Expected behavior

There should be no error in the logs.

Installation method

Manual installation

Operating system

Other

PHP engine version

PHP 8.0

Web server

Apache (supported)

Database engine version

MariaDB

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

Fresh Nextcloud Server install

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

No response

List of activated Apps

Enabled:
  - accessibility: 1.9.0
  - activity: 2.15.0
  - bruteforcesettings: 2.3.0
  - calendar: 3.2.0
  - circles: 23.0.1
  - cloud_federation_api: 1.6.0
  - comments: 1.13.0
  - contacts: 4.0.4
  - contactsinteraction: 1.4.0
  - dashboard: 7.3.0
  - dav: 1.21.0
  - federatedfilesharing: 1.13.0
  - federation: 1.13.0
  - files: 1.18.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
  - logreader: 2.8.0
  - lookup_server_connector: 1.11.0
  - nextcloud_announcements: 1.12.0
  - notes: 4.3.1
  - notifications: 2.11.1
  - oauth2: 1.11.0
  - ocsms: 2.2.0
  - password_policy: 1.13.0
  - photos: 1.5.0
  - privacy: 1.7.0
  - provisioning_api: 1.13.0
  - recommendations: 1.2.0
  - serverinfo: 1.13.0
  - settings: 1.5.0
  - sharebymail: 1.13.0
  - systemtags: 1.13.0
  - text: 3.4.0
  - theming: 1.14.0
  - twofactor_backupcodes: 1.12.0
  - updatenotification: 1.13.0
  - user_status: 1.3.1
  - viewer: 1.7.0
  - workflowengine: 2.5.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - support: 1.6.0
  - survey_client: 1.11.0
  - user_ldap
  - weather_status: 1.0.0

Nextcloud Signing status

No errors have been found.

Nextcloud Logs

No response

Additional info

This is not a critical bug, but as php 8.0 doesn't like accessing empty arrays, the arrays should just be checked before being accessed.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions