Array to string conversion errors at Cache/Scanner.php#222

After enabling External storage: Amazon S3 for all users (admin) I am getting a lot of errors in the nextcloud.log

Nextcloud version: Nextcloud Hub 7 (28.0.2)
Operating system and version: Debian 11
Apache or nginx version: Server version: Apache/2.4.56 (Debian)
PHP version: 8.2
Nextcloud is behind a NGINX Reverse Proxy, I do have this in my config.php

'trusted_domains' =>
array (
    0 => '127.0.0.1:8080',
    1 => 'cloud.example.com',
),
'overwritehost' => 'cloud.example.com',
'overwriteprotocol' => 'https',
'overwritewebroot' => '/',
'overwrite.cli.url' => 'https://cloud.example.com/',
'htaccess.RewriteBase' => '/',
'trusted_proxies' => ['127.0.0.1'],

Here is one of the errors in the nextcloud.log

{“reqId”:“T8ZiItIJBxAhHwN9VFgl”,“level”:3,“time”:“2024-02-15T07:49:16+00:00”,“remoteAddr”:“11.22.333.44”,“user”:“user_name”,“app”:“PHP”,“method”:“PUT”,“url”:“/remote.php/dav/files/user_name/Photos/2023/test.jpg”,“message”:“Array to string conversion at /var/www/nextcloud/lib/private/Files/Cache/Scanner.php#222”,“userAgent”:“Mozilla/5.0 (Windows) mirall/3.11.1stable-Win64 (build 20240125) (Nextcloud, windows-10.0.19045 ClientArchitecture: x86_64 OsArchitecture: x86_64)”,“version”:“28.0.2.5”,“data”:{“app”:“PHP”}}

Any ideas what can be wrong?
From a functional perspective everything is working.

4 Likes

If I set the “Check for changes” to Never, the errors do not show in the log anymore. Can I safely set this to Never if I am only managing the files in the S3 bucket using the Nextcloud interface, even if the External storage is shared with all users?

I assume that “Check for changes” to Never would be the recommended setting anyway for Amazon S3 because otherwise Nextcloud would trigger a lot of paid read requests to the S3 bucket?

I have the same issue and my log is exploding!

This is affecting me as well, 300 errors in just a few minutes. Need a fix.

I am also having the same issue. Does anyone know how to solve this?

Just ran into this error while setting up a daily files:scan. It’s indeed the error posted by @jtr. In my case, can be avoided by adding the --home-only flag to skip the externals

Having the same issue as well and in my case S3 is where most files are located and the location is also updated outside of NextCloud so turning off the scan is not ideal. Any fix or workaround?

There’s a proposed fix in the linked PR to the above Issue. It’ll likely get re-worked before final release based on feedback, but it does work as-is based on the feedback from others that have used it as-is.

UPDATE: Merged and will be in maintenance releases 28.0.6, 29.0.1 + 30.0.0 at release time.

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.