Error PHP Invalid argument supplied

Support intro

Sorry to hear you’re facing problems :slightly_frowning_face:

help.nextcloud.com is for home/non-enterprise users. If you’re running a business, paid support can be accessed via portal.nextcloud.com where we can ensure your business keeps running smoothly.

In order to help you as quickly as possible, before clicking Create Topic please provide as much of the below as you can. Feel free to use a pastebin service for logs, otherwise either indent short log examples with four spaces:

{“reqId”:“DcbmocekshcaL0tvu8MO”,“level”:3,“time”:“2020-05-07T16:10:07+00:00”,“remoteAddr”:“123.166.128.21”,“user”:“chuan”,“app”:“PHP”,“method”:“GET”,“url”:"/ocs/v2.php/apps/serverinfo/api/v1//diskdata?format=json",“message”:“Invalid argument supplied for foreach() at /snap/nextcloud/20498/htdocs/apps/serverinfo/lib/Os.php#155”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36”,“version”:“18.0.4.2”,“id”:“5eb4386429dea”}

{“reqId”:“DcbmocekshcaL0tvu8MO”,“level”:3,“time”:“2020-05-07T16:10:07+00:00”,“remoteAddr”:“123.166.128.21”,“user”:“chuan”,“app”:“PHP”,“method”:“GET”,“url”:"/ocs/v2.php/apps/serverinfo/api/v1//diskdata?format=json",“message”:“Undefined variable: result at /snap/nextcloud/20498/htdocs/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#173”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36”,“version”:“18.0.4.2”,“id”:“5eb4386429e0c”}

{“reqId”:“DS0tpiHSBAcawMflhvKC”,“level”:3,“time”:“2020-05-07T16:10:06+00:00”,“remoteAddr”:“123.166.128.21”,“user”:“chuan”,“app”:“PHP”,“method”:“GET”,“url”:"/index.php/settings/admin/serverinfo",“message”:“Invalid argument supplied for foreach() at /snap/nextcloud/20498/htdocs/apps/serverinfo/templates/settings-admin.php#101”,“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36”,“version”:“18.0.4.2”,“id”:“5eb4386429e2a”}

Some or all of the below information will be requested if it isn’t supplied; for fastest response please provide as much as you can :heart:

Nextcloud version (eg, 18.0.2): 18.0.4
Operating system and version (eg, Ubuntu 20.04): ubuntu-18.04-x86_64
Apache or nginx version (eg, Apache 2.4.25):
PHP version (eg, 7.1): 7.3.17

The issue you are facing:Can’t upload through nextcloud app

Is this the first time you’ve seen this error? (Y/N):Y

Steps to replicate it:

  1. Open app
  2. Upload
  3. Upload without speed
    4.Open V2rayNG
    5.Upload succeeded

Please provide the Nextcloud log which should contain related error messages.

What should “V2rayNG” be, I’ve never heard of it?

{“reqId”:“ECFS7K9jQSh1EMBqOY23”,“level”:3,“time”:“2020-05-07T16:45:45+00:00”,“remoteAddr”:“185.186.146.186”,“user”:“chuan”,“app”:“PHP”,“method”:“GET”,“url”:“/ocs/v2.php/apps/serverinfo/api/v1//diskdata?format=json”,“message”:“Invalid argument supplied for foreach() at /snap/nextcloud/20498/htdocs/apps/serverinfo/lib/Os.php#155”,“userAgent”:“Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36”,“version”:“18.0.4.2”,“id”:“5eb5966146de1”}

{“reqId”:“ECFS7K9jQSh1EMBqOY23”,“level”:3,“time”:“2020-05-07T16:45:45+00:00”,“remoteAddr”:“185.186.146.186”,“user”:“chuan”,“app”:“PHP”,“method”:“GET”,“url”:“/ocs/v2.php/apps/serverinfo/api/v1//diskdata?format=json”,“message”:“Undefined variable: result at /snap/nextcloud/20498/htdocs/apps/serverinfo/lib/OperatingSystems/DefaultOs.php#173”,“userAgent”:“Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36”,“version”:“18.0.4.2”,“id”:“5eb5966146e02”}

{“reqId”:“Zwffa6KWyBPHHVQn8k2n”,“level”:3,“time”:“2020-05-07T16:45:44+00:00”,“remoteAddr”:“185.186.146.186”,“user”:“chuan”,“app”:“PHP”,“method”:“GET”,“url”:“/index.php/settings/admin/serverinfo”,“message”:“Invalid argument supplied for foreach() at /snap/nextcloud/20498/htdocs/apps/serverinfo/templates/settings-admin.php#101”,“userAgent”:“Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.129 Safari/537.36”,“version”:“18.0.4.2”,“id”:“5eb5966146e20”}

V2RayNG is an Android application based on the V2Ray kernel, which can create a VPN connection based on VMess.

As far as I can see the given log lines are all related to the serverinfo app which is used to display system related data. It is usually not involved when uploading data to the server.
What is the intention of your report? Do you only want to inform the developer about the given PHP messages, because you wrote that a file upload succeeds?!

I want to know why the error in the log occurred. Does this error affect usage? How can I make adjustments to fix this error? Why can’t I upload files through the app without using VPN(V2rayNG)?Thank you.

As I already wrote this messages aren’t related to the file upload.

Wait until this problems have been fixed in the code by the developers.

As I already wrote that V2rayNG app isn’t part of Nextcloud and therefore you’re in the wrong support forum here to get your question answered. Contact the developers of the V2rayNG app and asked them for support. Nextcloud uses WebDAV which is based on the http/https protocol. As long as this is forwarded everything should work.

To find the root cause of the problem you need to analyze the content of the Nextcloud log file first. Then you need to provide detailed information how you try to access Nextcloud and which messages are displayed, etc.

Thank you very much for your response. I will try again how to solve my problem.