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

Invalid argument supplied for foreach() JSCombiner.php#107 #6898

Closed
mxschmitt opened this issue Oct 22, 2017 · 6 comments · Fixed by #7109
Closed

Invalid argument supplied for foreach() JSCombiner.php#107 #6898

mxschmitt opened this issue Oct 22, 2017 · 6 comments · Fixed by #7109
Assignees
Labels
Milestone

Comments

@mxschmitt
Copy link

mxschmitt commented Oct 22, 2017

Steps to reproduce

  1. Reinstalled fresh nextcloud

Expected behaviour

No error

Actual behaviour

Invalid argument supplied for foreach() at /var/www/cloud/lib/private/Template/JSCombiner.php#107

Server configuration

Operating system: Debian 9.1 PXE:

Web server: nginx/1.10.3

Database: MariaDB

PHP version: 7.1.9

Nextcloud version: 12.0.3

Updated from an older Nextcloud/ownCloud or fresh install: Fresh Install

Where did you install Nextcloud from: https://download.nextcloud.com/server/releases/nextcloud-12.0.3.zip

Signing status:

Signing status

No errors have been found.

List of activated apps:

App list
Enabled:
  - activity: 2.5.2
  - bruteforcesettings: 1.0.2
  - comments: 1.2.0
  - dav: 1.3.0
  - federatedfilesharing: 1.2.0
  - federation: 1.2.0
  - files: 1.7.2
  - files_pdfviewer: 1.1.1
  - files_sharing: 1.4.0
  - files_texteditor: 2.4.1
  - files_trashbin: 1.2.0
  - files_versions: 1.5.0
  - files_videoplayer: 1.1.0
  - firstrunwizard: 2.1
  - gallery: 17.0.0
  - logreader: 2.0.0
  - lookup_server_connector: 1.0.0
  - nextcloud_announcements: 1.1
  - notifications: 2.0.0
  - oauth2: 1.0.5
  - password_policy: 1.2.2
  - provisioning_api: 1.2.0
  - serverinfo: 1.2.0
  - sharebymail: 1.2.0
  - survey_client: 1.0.0
  - systemtags: 1.2.0
  - theming: 1.3.0
  - twofactor_backupcodes: 1.1.1
  - updatenotification: 1.2.0
  - workflowengine: 1.2.0
Disabled:
  - admin_audit
  - encryption
  - files_external
  - user_external
  - user_ldap

Nextcloud configuration:

Config report
{
    "system": {
        "instanceid": "ocqw4m1v6kk0",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "cloud"
        ],
        "datadirectory": "\/var\/www\/cloud\/data",
        "overwrite.cli.url": "https:\/\/cloud",
        "dbtype": "mysql",
        "version": "12.0.3.3",
        "dbname": "nextcloud",
        "dbhost": "10.10.10.6",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "mail_from_address": "cloud",
        "mail_smtpmode": "php",
        "mail_smtpauthtype": "LOGIN",
        "mail_domain": "schmitt.mx"
    }
}

Are you using external storage, if yes which one: local/smb/sftp/.. No.

Are you using encryption: No

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/... Only webdav

Client configuration

Browser: Chrome 62

Operating system: Windows 7 Enterprise

Logs

Web server error log

Web server error log
No relevant logs

Nextcloud log (data/nextcloud.log)

Nextcloud log
{
    "reqId": "cDtwiSOoiGoO7uZB1l0v",
    "level": 3,
    "time": "2017-10-22T08:38:20+00:00",
    "remoteAddr": "",
    "user": "maxibanki",
    "app": "PHP",
    "method": "GET",
    "url": "\/apps\/files\/",
    "message": "Invalid argument supplied for foreach() at \/var\/www\/cloud\/lib\/private\/Template\/JSCombiner.php#107",
    "userAgent": "Mozilla\/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit\/537.36 (KHTML, like Gecko) Chrome\/61.0.3163.100 Safari\/537.36",
    "version": "12.0.3.3"
}

Browser log

Not relevant

@blizzz
Copy link
Member

blizzz commented Oct 24, 2017

@rullzer i guess it is either a faulty app (but they look OK) or some issue with the caching. Perhaps check what $deps = json_decode($deps, true); actually returns (might be null) and add some debug output in non-array case. But that's just for debugging.

@blizzz blizzz added the bug label Oct 24, 2017
@blizzz blizzz added this to the Nextcloud 13 milestone Oct 24, 2017
@mxschmitt
Copy link
Author

I don't have the problem anymore, it just showed up in the log, so I wanted to report it here. So the output of:

$deps = json_decode($deps, true);
foreach ($deps as $file=>$mtime) {
if (!file_exists($file) || filemtime($file) > $mtime) {
return false;
}
}

is not necessary right?
Caching could be issue. I have Cloudflare between the cloud and the user.

@blizzz
Copy link
Member

blizzz commented Oct 24, 2017

If it can happen, we should check the return value, anyhow. Cloudflare sounds unlikely, it's either in-memory runtime cache or any external memcache if you configured it.

@mxschmitt
Copy link
Author

I don't have any cache configured. APCu was also not configured. I added logging to the error log for testing purposes.

@MorrisJobke
Copy link
Member

I noticed something similar when opening a file, that is not there anymore:

{
    "app": "PHP",
    "level": 3,
    "message": "fopen(http://s3.local/bucket/urn%3Aoid%3A123455): failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found\r\n at /var/www/html/nextcloud/lib/private/Files/ObjectStore/S3.php#77",
    "method": "GET",
    "reqId": "WgBvTDJaaozFBpEhi26m0QAAAAI",
    "url": "/index.php/apps/files/",
    "version": "12.0.3.3"
}
{
    "app": "PHP",
    "level": 3,
    "message": "Invalid argument supplied for foreach() at /var/www/html/nextcloud/lib/private/Template/SCSSCacher.php#145",
    "method": "GET",
    "reqId": "WgBvTDJaaozFBpEhi26m0QAAAAI",
    "url": "/index.php/apps/files/",
    "version": "12.0.3.3"
}

@rullzer
Copy link
Member

rullzer commented Nov 6, 2017

I'll look into this tomorrow.

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

Successfully merging a pull request may close this issue.

4 participants