-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
TypeError for SimpleFolder in /var/www/nextcloud/lib/private/Files/AppData/AppData.php when there are extra files in appdata folder #35936
Comments
Error logs showing this is happening about every hour in my 25.0.4 instance (docker on RHEL9) |
I am seeing the same error message here on my 26.0.2 instance. Are there any additional information that we can provide? It seems that the message appeared in the nextcloud.log for quite a while already but since the update from 25.0.7 (or 25.0.6) to 26.0.2, I'm getting it via mail as well as it's now directly output by the cron task. |
I'm seeing a very similar error twice a day during cron runs, with the following stack trace:
Nextcloud 26.0.2 with PHP 8.2. |
After upgrading to NC 27.0, I'm no longer receiving these error messages. |
I am seeing the same error very frequently during a cron run:
Nextcloud v26.0.3 using the LDAP user backend. |
After updating from 26 to 27.0.1, the regular emails stopped for me as well. But the error still occurs and the message is printed hourly to nextcloud.log. Here's a recent one from 27.0.1:
Formatted message{
"reqId": "********************",
"level": 3,
"time": "2023-07-28T04:44:03+00:00",
"remoteAddr": "",
"user": "--",
"app": "core",
"method": "",
"url": "--",
"message": "Error while running background job (class: OC\\Preview\\BackgroundCleanupJob, arguments: )",
"userAgent": "--",
"version": "27.0.1.2",
"exception": {
"Exception": "TypeError",
"Message": "OC\\Files\\SimpleFS\\SimpleFolder::__construct(): Argument #1 ($folder) must be of type OCP\\Files\\Folder, OC\\Files\\Node\\File given, called in /var/www/nextcloud/lib/private/Files/AppData/AppData.php on line 140",
"Code": 0,
"Trace": [
{
"file": "/var/www/nextcloud/lib/private/Files/AppData/AppData.php",
"line": 140,
"function": "__construct",
"class": "OC\\Files\\SimpleFS\\SimpleFolder",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Preview/Storage/Root.php",
"line": 57,
"function": "getFolder",
"class": "OC\\Files\\AppData\\AppData",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/private/Preview/BackgroundCleanupJob.php",
"line": 68,
"function": "getFolder",
"class": "OC\\Preview\\Storage\\Root",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/public/BackgroundJob/Job.php",
"line": 86,
"function": "run",
"class": "OC\\Preview\\BackgroundCleanupJob",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
"line": 103,
"function": "start",
"class": "OCP\\BackgroundJob\\Job",
"type": "->"
},
{
"file": "/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php",
"line": 93,
"function": "start",
"class": "OCP\\BackgroundJob\\TimedJob",
"type": "->"
},
{
"file": "/var/www/nextcloud/cron.php",
"line": 152,
"function": "execute",
"class": "OCP\\BackgroundJob\\TimedJob",
"type": "->"
}
],
"File": "/var/www/nextcloud/lib/private/Files/SimpleFS/SimpleFolder.php",
"Line": 43,
"message": "Error while running background job (class: OC\\Preview\\BackgroundCleanupJob, arguments: )",
"exception": {},
"CustomMessage": "Error while running background job (class: OC\\Preview\\BackgroundCleanupJob, arguments: )"
}
} |
I'm seeing this on NC 28.0.1 :( |
28.0.2 as well :( |
Same 28.0.3 |
I'm on 28.0.4, using nextcloud fpm docker image running on k8s, same. |
I finally figured out what caused the error on my instance. The folder Could this be the reason for the others here as well? |
ahhh, my data folder is on a macOS drive (because it's from a docker instal) and of course there is the hidden .DS_store file always creeping into folders. |
Yes, I think that's the cause. I have a .nobackup file there. I think nextcloud should just ignore these hidden files. |
That's exactly what I had in there as well. If this is the underlying cause, I think it can safely be ignored. But it also makes me wonder if this error should at least be degraded to a warning or even a lower severity. |
Fixes nextcloud#35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue. Signed-off-by: Dario Mehlich <d.mehlich@gmail.com>
Fixes nextcloud#35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue. Signed-off-by: Dario Mehlich <d.mehlich@gmail.com>
Fixes nextcloud#35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue.
Fixes nextcloud#35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue. Signed-off-by: Dario Mehlich <d.mehlich@gmail.com>
Fixes nextcloud#35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue. Signed-off-by: Dario Mehlich <d.mehlich@gmail.com>
Fixes #35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue. Signed-off-by: Dario Mehlich <d.mehlich@gmail.com> [skip ci]
Fixes #35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue. Signed-off-by: Dario Mehlich <d.mehlich@gmail.com>
Fixes #35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue. Signed-off-by: Dario Mehlich <d.mehlich@gmail.com>
Fixes #35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue. Signed-off-by: Dario Mehlich <d.mehlich@gmail.com> [skip ci]
Fixes #35936. When running `OC\Preview\BackgroundCleanupJob`, the main iteration loop in `run()` expects a folder, however, `getOldPreviewLocations()` currently does not filter by mimetype and therefore can yield a non-folder entry which causes an Exception when constructing the Folder impl. Filtering for `httpd/unix-directory`, as `getNewPreviewLocations()` already does, fixes this issue. Signed-off-by: Dario Mehlich <d.mehlich@gmail.com> [skip ci]
Bug description
I get this Exception thrown a few times an hour, looking at the code I am sorry but could not figure out what was wrong.
TypeError: OC\Files\SimpleFS\SimpleFolder::__construct(): Argument #1 ($folder) must be of type OCP\Files\Folder, OC\Files\Node\File given, called in /var/www/nextcloud/lib/private/Files/AppData/AppData.php on line 140
Steps to reproduce
Firstly thank you, think this is a great platform.
I been seeing this for awhile so though I should now report it, but strange I don't seem to see others reporting this, was also happening in NC24, and now NC25.0.2 on full patched Debian.
This is triggered by the cron jobs that NC runs.
Expected behavior
No exceptions in the log
Installation method
Community Manual installation with Archive
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.1
Web server
Apache (supported)
Database engine version
SQlite
Is this bug present after an update or on a fresh install?
Updated to a major version (ex. 22.2.3 to 23.0.1)
Are you using the Nextcloud Server Encryption module?
Encryption is Disabled
What user-backends are you using?
Configuration report
List of activated Apps
Nextcloud Signing status
Nextcloud Logs
Additional info
64Bit Debian ruining in a docker image on a 64 bit installation of RPI4 raspberry OS all full patched.
uname -a
Linux rpi4-cubox 5.15.84-v8+ #1610 SMP PREEMPT Mon Dec 19 18:54:50 GMT 2022 aarch64 GNU/Linux
docker -v
Docker version 20.10.22, build 3a2c30b
then inside the container:
uname -a
Linux d86ed09c4605 5.15.84-v8+ #1610 SMP PREEMPT Mon Dec 19 18:54:50 GMT 2022 aarch64 GNU/Linux
php --version
Cannot load Zend OPcache - it was already loaded
PHP 8.1.13 (cli) (built: Nov 26 2022 14:27:02) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.13, Copyright (c) Zend Technologies
with Zend OPcache v8.1.13, Copyright (c), by Zend Technologies
apache2 -v
Server version: Apache/2.4.54 (Debian)
Server built: 2022-06-09T04:26:43
============
I have run the recommended scripts to secure the install, and the data section is held in a separate area. Everything seems to have been running fine... but my log file does fill up over time :-) so thought I should mention I am seeing this.
The text was updated successfully, but these errors were encountered: