-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Call to a member function getId()
on array at lib/private/Files/Cache/Updater.php
on line 160
#26544
Comments
A formatted trace dump is in #26473 (comment) |
I have the same problem.
|
same issue here |
I have the same issue with WebDAV on Windows 10 with files greater than 100MB: Log:
|
getId()
on array at lib/private/Files/Cache/Updater.php
on line 160
Also the same here when deleting a single file on server (which isn't in a folder?). Console error:
Also I get this error notification in webgui: Error in nextcloud.log:
Installed and enabled 3rd-party apps:
best regards |
I get the same error when deleting the file using the browser UI. Error is displayed "Error deleting file" and the file shows, but it disappears after page reload. Log contains the error as above:
|
Any news on this ? I happens together with the message mentioned in #26473 at any delete. |
getId()
on array at lib/private/Files/Cache/Updater.php
on line 160getId()
on array at lib/private/Files/Cache/Updater.php
on line 160
We have the same problem on our Nextcloud instance (21.0.1). Each DELETE via WebDAV API (even if triggered through the Nextcloud webinterface) results in the reported error The file is removed from filesystem, but apparently something goes wrong when trying to remove it from filecache. When browsing the folder with the deleted file shortly afterwards in the web app (without hard-reloading the webinterface), the file is listed again. After a hard reload, it's gone. Here again a full backtrace: {
"Exception": "Error",
"Message": "Call to a member function getId() on array",
"Code": 0,
"Trace": [
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/lib/private/Files/Cache/Updater.php",
"line": 160,
"function": "remove",
"class": "OC\\Files\\Cache\\Cache",
"type": "->",
"args": [
"files/Talk/report.pdf"
]
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/lib/private/Files/View.php",
"line": 330,
"function": "remove",
"class": "OC\\Files\\Cache\\Updater",
"type": "->",
"args": [
"files/Talk/report.pdf"
]
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/lib/private/Files/View.php",
"line": 1180,
"function": "removeUpdate",
"class": "OC\\Files\\View",
"type": "->",
"args": [
{
"cache": null,
"scanner": {
"__class__": "OC\\Files\\Cache\\Scanner"
},
"watcher": null,
"propagator": null,
"updater": {
"__class__": "OC\\Files\\Cache\\Updater"
},
"__class__": "OCA\\Files_Trashbin\\Storage"
},
"files/Talk/report.pdf"
]
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/lib/private/Files/View.php",
"line": 725,
"function": "basicOperation",
"class": "OC\\Files\\View",
"type": "->",
"args": [
"unlink",
"/Talk/report.pdf",
[
"delete"
]
]
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/apps/dav/lib/Connector/Sabre/File.php",
"line": 466,
"function": "unlink",
"class": "OC\\Files\\View",
"type": "->",
"args": [
"/Talk/report.pdf"
]
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/3rdparty/sabre/dav/lib/DAV/Tree.php",
"line": 179,
"function": "delete",
"class": "OCA\\DAV\\Connector\\Sabre\\File",
"type": "->",
"args": []
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/3rdparty/sabre/dav/lib/DAV/CorePlugin.php",
"line": 281,
"function": "delete",
"class": "Sabre\\DAV\\Tree",
"type": "->",
"args": [
"files/user/Talk/report.pdf"
]
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/3rdparty/sabre/event/lib/WildcardEmitterTrait.php",
"line": 89,
"function": "httpDelete",
"class": "Sabre\\DAV\\CorePlugin",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 472,
"function": "emit",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
"method:DELETE",
[
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
]
},
{
"file": "/var/www/cloud.example3.org/nextcloud-21.0.1/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 253,
"function": "invokeMethod",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": [
{
"__class__": "Sabre\\HTTP\\Request"
},
{
"__class__": "Sabre\\HTTP\\Response"
}
]
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/3rdparty/sabre/dav/lib/DAV/Server.php",
"line": 321,
"function": "start",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/apps/dav/lib/Server.php",
"line": 332,
"function": "exec",
"class": "Sabre\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/apps/dav/appinfo/v2/remote.php",
"line": 35,
"function": "exec",
"class": "OCA\\DAV\\Server",
"type": "->",
"args": []
},
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/remote.php",
"line": 167,
"args": [
"/var/www/cloud.example.org/nextcloud-21.0.1/apps/dav/appinfo/v2/remote.php"
],
"function": "require_once"
}
],
"File": "/var/www/cloud.example.org/nextcloud-21.0.1/lib/private/Files/Cache/Cache.php",
"Line": 541,
"CustomMessage": "--"
} |
My problem was with Cloudflare max upload file limit. When I disabled the proxy, I can upload files greater than 100MB with WebDav. |
Same exact problem here also on 21.0.1 |
Problem still there on 21.0.2 |
Is there any solution for this issue (even some dirty one)? Due to this issue, sync is not working for some SW using WebDav access (eg. KeePass database sync). |
Here is some (very brief) analysis:
This is content of the $entry variable on this line: I have modified the line 538 to this: There is a new error reported in the log: I know that it is ugly "fix" but I have seen the code for the first time today and I really wanted to get it working asap ;) |
I have a quite similar problem:
Some debugging:
Is there any parallel processing involved that manipulates |
I experience the same issue on a Nextcloud 22.1.0 instance (and already with 21) - but only when deleting files from non-default storages. The collectives app brings its own storages for collectives and mounts them into the home folder. Deleting a file from this mountpoints throws the |
Trying to figure out what's going on here based on the backlock posted by @mejo- above: {
"Exception": "Error",
"Message": "Call to a member function getId() on array",
"Code": 0,
"Trace": [
{
"file": "/var/www/cloud.example.org/nextcloud-21.0.1/lib/private/Files/Cache/Updater.php",
"line": 160,
"function": "remove",
"class": "OC\\Files\\Cache\\Cache",
"type": "->",
"args": [
"files/Talk/report.pdf"
]
},
]
} Looking at public function remove($file) {
$entry = $this->get($file);
if ($entry) {
$query = $this->getQueryBuilder();
$query->delete('filecache')
->whereFileId($entry->getId());
$query->execute(); So it looks like /**
* get the stored metadata of a file or folder
*
* @param string | int $file either the path of a file or folder or the file id for a file or folder
* @return ICacheEntry|false the cache entry as array of false if the file is not found in the cache
*/
public function get($file) {
$query = $this->getQueryBuilder();
$query->selectFileCache();
if (is_string($file) or $file == '') {
// normalize file
$file = $this->normalize($file);
$query->whereStorageId()
->wherePath($file);
} else { //file id
$query->whereFileId($file);
}
$result = $query->execute();
$data = $result->fetch();
$result->closeCursor();
//merge partial data
if (!$data and is_string($file) and isset($this->partial[$file])) {
return $this->partial[$file];
} elseif (!$data) {
return $data;
} else {
return self::cacheEntryFromData($data, $this->mimetypeLoader);
}
} |
On external storages, removing files sometimes tries to remove partial data, represented in an array. `lib/private/Files/Cache/Cache.php:remove()` doesn't support to process arrays. According to @icewind1991, we can ignore this partial data in `remove()`. Fixes: #26544
On external storages, removing files sometimes tries to remove partial data, represented in an array. `lib/private/Files/Cache/Cache.php:remove()` doesn't support to process arrays. According to @icewind1991, we can ignore this partial data in `remove()`. Fixes: #26544 Signed-off-by: Jonas Meurer <jonas@freesources.org>
|
|
I don't want to downgrade security I want to fix this. |
I now have a reproducer on a fresh Nextcloud installation:
instead of 5. (creating + deleting a page in the collective), you can also navigate to And the issue is only reproducible if the files_trashbin app is enabled. It seems to be related to the fact that the source storage (a collective mountpoint) is unencrypted when moving the file from the collective mountpoint to the trashbin storage. |
When moving a file to trash with encryption enabled, the cache gets moved before the actual file. According to @icewind1991 this is in order to not break object storage. When moving a file from an unencrypted storage (e.g. a collectives storage) to the encrypted trashbin storage, this causes errors, see This commit fixes it by doing `updateEncryptedVersion()` on the target cache entry *if* the source cache entry doesn't exist anymore, but the corresponding target cache entry does exist already. Fixes: #26544 Signed-off-by: Jonas Meurer <jonas@freesources.org>
When moving a file to trash with encryption enabled, the cache gets moved before the actual file. According to @icewind1991 this is in order to not break object storage. When moving a file from an unencrypted storage (e.g. a collectives storage) to the encrypted trashbin storage, this causes errors, see This commit fixes it by doing `updateEncryptedVersion()` on the target cache entry *if* the source cache entry doesn't exist anymore, but the corresponding target cache entry does exist already. Fixes: #26544 Signed-off-by: Jonas Meurer <jonas@freesources.org>
When moving a file to trash with encryption enabled, the cache gets moved before the actual file. According to @icewind1991 this is in order to not break object storage. When moving a file from an unencrypted storage (e.g. a collectives storage) to the encrypted trashbin storage, this causes errors, see This commit fixes it by doing `updateEncryptedVersion()` on the target cache entry *if* the source cache entry doesn't exist anymore, but the corresponding target cache entry does exist already. Fixes: #26544 Signed-off-by: Jonas Meurer <jonas@freesources.org>
When moving a file to trash with encryption enabled, the cache gets moved before the actual file. According to @icewind1991 this is in order to not break object storage. When moving a file from an unencrypted storage (e.g. a collectives storage) to the encrypted trashbin storage, this causes errors, see This commit fixes it by doing `updateEncryptedVersion()` on the target cache entry *if* the source cache entry doesn't exist anymore, but the corresponding target cache entry does exist already. Fixes: #26544 Signed-off-by: Jonas Meurer <jonas@freesources.org>
Happened upon deleting a file over DAV (using the official client) using NC 21.0.1. The same error has been reported by @doc75 for NC 20.0.9: #26473 (comment) and by @axheli
It's my best guess that the issue is caused by recent changes in the file cache code.
I would have include a conveniently formatted stack dump if someone finally got around fixing nextcloud/logreader#301
The text was updated successfully, but these errors were encountered: