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]: Undefined array key with FreeBSD + jails #360

Closed
5 of 8 tasks
cyrilst opened this issue Mar 11, 2022 · 10 comments
Closed
5 of 8 tasks

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

cyrilst opened this issue Mar 11, 2022 · 10 comments

Comments

@cyrilst
Copy link
Contributor

cyrilst commented Mar 11, 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.
  • 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.

@szaimen szaimen transferred this issue from nextcloud/server Mar 11, 2022
@tflidd
Copy link
Contributor

tflidd commented Mar 14, 2022

For the first error, I added a pull request some time ago and it is waiting a review:
#271

@KDederichs
Copy link
Contributor

Actually I think that's related to #270 and #358 . I just openend a pull request for those as well :) (Waiting for review)

@tflidd
Copy link
Contributor

tflidd commented May 14, 2022

You mean this PR #372?

@KDederichs
Copy link
Contributor

Yeah that one/the backport PR's that come out of it

@tflidd
Copy link
Contributor

tflidd commented May 14, 2022

so once the backport #373 is merged, we can close this.

@KDederichs
Copy link
Contributor

Yeah, I mean technically it's still missing the packport PR's for 23 and 22 but I have no clue how that backport bot works :D

@tflidd
Copy link
Contributor

tflidd commented May 16, 2022

under a pull request you can just add /backport to stable24 and the bot will try to backport.

@KDederichs
Copy link
Contributor

Yeah, there's backport comments but it only created the one for 24, the one for 23 and 22 seem to be missing. Maybe they get queued up will 24 is merged?

@joshtrichards
Copy link
Member

Looks like the backports got sorted out on the PRs. So this seems like it should be closed now, correct?

I can't test as I'm not using FreeBSD, but this looks to be in all currently supported releases (and then some at this point).

@kesselb kesselb closed this as completed May 29, 2023
@cyrilst
Copy link
Contributor Author

cyrilst commented May 29, 2023

Correct. I successfully tested 26.0.2 with FreeBSD + jails.
Thanks for closing the issue.

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

No branches or pull requests

5 participants