server icon indicating copy to clipboard operation
server copied to clipboard

Lots of errors "File with id "XXX" has not been found."

Open LukasReschke opened this issue 10 years ago • 16 comments

Just updated cloud.nextcloud.com to the stable10 branch, there are a lot of these two errors repeating:

File with id "6607" has not been found.
File with id "6607" has not been found.

In the DB:

mysql> select * from oc_filecache where fileid="6607";
+--------+---------+------------------------------------------------------------------------+----------------------------------+--------+---------------------------------------------------+----------+----------+---------+------------+---------------+-----------+------------------+----------------------------------+-------------+----------+
| fileid | storage | path                                                                   | path_hash                        | parent | name                                              | mimetype | mimepart | size    | mtime      | storage_mtime | encrypted | unencrypted_size | etag                             | permissions | checksum |
+--------+---------+------------------------------------------------------------------------+----------------------------------+--------+---------------------------------------------------+----------+----------+---------+------------+---------------+-----------+------------------+----------------------------------+-------------+----------+
|   6607 |      18 | files_trashbin/files/collabora_online_slide_deck_large.ppt.d1468937873 | 11c525a3813ef569ecfda3dd83af955d |    360 | collabora_online_slide_deck_large.ppt.d1468937873 |        7 |        3 | 2996736 | 1468918311 |    1468918311 |         0 |                0 | c1d157d0c7e87a463187652dd7b7442b |          27 |          |
+--------+---------+------------------------------------------------------------------------+----------------------------------+--------+---------------------------------------------------+----------+----------+---------+------------+---------------+-----------+------------------+----------------------------------+-------------+----------+
1 row in set (0.00 sec)

mysql> mysql> select * from oc_filecache where fileid="989";
+--------+---------+-----------------------------------------+----------------------------------+--------+--------------------+----------+----------+-------+------------+---------------+-----------+------------------+---------------+-------------+----------+
| fileid | storage | path                                    | path_hash                        | parent | name               | mimetype | mimepart | size  | mtime      | storage_mtime | encrypted | unencrypted_size | etag          | permissions | checksum |
+--------+---------+-----------------------------------------+----------------------------------+--------+--------------------+----------+----------+-------+------------+---------------+-----------+------------------+---------------+-------------+----------+
|    989 |      14 | files_trashbin/files/Design.d1464736340 | ed66c06cf47427dcab2ad3b4c5a4b37b |   1213 | Design.d1464736340 |        2 |        1 | 75695 | 1464736306 |    1464736306 |         0 |                0 | 574e1a321c906 |          31 |          |
+--------+---------+-----------------------------------------+----------------------------------+--------+--------------------+----------+----------+-------+------------+---------------+-----------+------------------+---------------+-------------+----------+
1 row in set (0.00 sec)

A find does find those however on the FS:

root@cloud:/var/www/data# find . -iname collabora_online_slide_deck_large.ppt.d1468937873
./jos/files_trashbin/files/collabora_online_slide_deck_large.ppt.d1468937873

Also the storage exists:

mysql> select * from oc_storages where numeric_id="18";
+-----------+------------+-----------+--------------+
| id        | numeric_id | available | last_checked |
+-----------+------------+-----------+--------------+
| home::jos |         18 |         1 |         NULL |
+-----------+------------+-----------+--------------+
1 row in set (0.00 sec)

cc @icewind1991 @schiessle Thoughts?

LukasReschke avatar Aug 18 '16 14:08 LukasReschke

I switched for now to "Fatal issues only logging" on the system. But we really should sort this out rather sooner than later as it totally spams ten-thousands of log entries.

LukasReschke avatar Aug 18 '16 14:08 LukasReschke

lib/private/Files/View.php
1700:           throw new NotFoundException(sprintf('File with id "%s" has not been found.', $id));

Part of getPath method. However, there are no recent changes there. Backtrace would be helpful.

blizzz avatar Aug 18 '16 14:08 blizzz

Yeah. That has been a hardening against some security issues we had. But the strange thing is: The files in the database do exist. I assume the mounts are not done correctly?

LukasReschke avatar Aug 18 '16 14:08 LukasReschke

I also see this at my local instance:

{"reqId":"hfhocnwshfhr2MPYysb9","remoteAddr":"127.0.0.1","app":"core","message":"File with id "1413627" has not been found.","level":3,"time":"August 20, 2016 15:43:23","method":"PROPFIND","url":"/remote.php/webdav/","user":"sanny"}

If i can do something to help, please ping me.

derkostka avatar Aug 20 '16 17:08 derkostka

Marking as high, we should fix that before the release.

LukasReschke avatar Aug 22 '16 10:08 LukasReschke

https://github.com/owncloud/core/issues/25740 seems related and has reproduction steps.

LukasReschke avatar Aug 22 '16 10:08 LukasReschke

I can reproduce and I think I know a 'fix'

rullzer avatar Aug 22 '16 12:08 rullzer

PR in https://github.com/nextcloud/server/pull/1013

rullzer avatar Aug 22 '16 13:08 rullzer

I did test the change, from review perspective everything fine, but does not solve my problem:

{"reqId":"7slulmwkbYEtx9KwjcsW","remoteAddr":"127.0.0.1","app":"core","message":"File with id "1413627" has not been found.","level":3,"time":"August 23, 2016 20:47:53","method":"PROPFIND","url":"/remote.php/webdav/","user":"sanny"}

maybe unrelated ? this always occurs if the user logs in ..

derkostka avatar Aug 23 '16 18:08 derkostka

mmm then there might be another code path that triggers this then.

If you look into your oc_filecache table. Is the file with that id shared with the user sanny?

rullzer avatar Aug 23 '16 18:08 rullzer

Yes it is a shared file that was trashed by the other user (still inside thrash), nevermind - My fault, i was on the master branch and merged manually, maybe something did not work out. I will give feedback soon ...

derkostka avatar Aug 23 '16 19:08 derkostka

Okay, fixed the problem. Thank you!

derkostka avatar Aug 23 '16 19:08 derkostka

I got this again on 12.0.1, same behaviour. Have not investigated furhter. Reopen?

Stacktrace:


OCP\Files\NotFoundException: File with id "1259456" has not been found./var/www/nextcloud/apps/dav/appinfo/v1/publicwebdav.php - 
line 88: OC\Files\View->getPath(1259456)/var/www/nextcloud/apps/dav/lib/Connector/Sabre/ServerFactory.php - 
line 139: {closure}(Object(OCA\DAV\Connector\Sabre\Server))[internal function] OCA\DAV\Connector\Sabre\ServerFactory->OCA\DAV\Connector\Sabre\{closure}(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))/var/www/nextcloud/3rdparty/sabre/event/lib/EventEmitterTrait.php - 
line 105: call_user_func_array(Object(Closure), Array)/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - 
line 466: Sabre\Event\EventEmitter->emit('beforeMethod', Array)/var/www/nextcloud/3rdparty/sabre/dav/lib/DAV/Server.php - 
line 254: Sabre\DAV\Server->invokeMethod(Object(Sabre\HTTP\Request), Object(Sabre\HTTP\Response))/var/www/nextcloud/apps/dav/appinfo/v1/publicwebdav.php - 
line 107: Sabre\DAV\Server->exec()/var/www/nextcloud/public.php - 
line 76: require_once('/var/www/nextcl...'){main}
--

enoch85 avatar Aug 08 '17 13:08 enoch85

I got this again on 12.0.1, same behaviour. Have not investigated furhter. Reopen?

No - new ticket. ;)

MorrisJobke avatar Aug 08 '17 13:08 MorrisJobke

I got this error in Version 15.0.2 OCP\Files\StorageNotAvailableException: File with id "10349" has not been found.

Is ther a workaround ti delete the DB-Entry and get rid of this errounouse files perhaps?

OCP\Files\StorageNotAvailableException: File with id "10349" has not been found. /data/nextcloud/apps/files_sharing/lib/SharedStorage.php - line 423:

OC\Files\Storage\FailedStorage->acquireLock("", 1, OC\Lock\Memc ... {})

/data/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php - line 593:

OCA\Files_Sharing\SharedStorage->acquireLock("", 1, OC\Lock\Memc ... {})

/data/nextcloud/lib/private/Files/View.php - line 1923:

OC\Files\Storage\Wrapper\Wrapper->acquireLock("", 1, OC\Lock\Memc ... {})

/data/nextcloud/lib/private/Files/View.php - line 2033:

OC\Files\View->lockPath("/mgm/files/ ... g", 1, false)

/data/nextcloud/lib/private/Files/Node/Node.php - line 366:

OC\Files\View->lockFile("/mgm/files/ ... g", 1)

/data/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php - line 1119:

OC\Files\Node\Node->lock(1)

/data/nextcloud/apps/files_sharing/lib/Controller/ShareAPIController.php - line 685:

OCA\Files_Sharing\Controller\ShareAPIController->lock(OC\Files\Node\File {})

/data/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 166:

OCA\Files_Sharing\Controller\ShareAPIController->getShares("true", "false", "false", OC\Files\Node\File {}, "false")

/data/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 99:

OC\AppFramework\Http\Dispatcher->executeController(OCA\Files_Sh ... {}, "getShares")

/data/nextcloud/lib/private/AppFramework/App.php - line 118:

OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Sh ... {}, "getShares")

/data/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47:

OC\AppFramework\App::main("OCA\Files_ ... r", "getShares", OC\AppFramew ... {}, { _route: "o ... "})

<>

OC\AppFramework\Routing\RouteActionHandler->__invoke({ _route: "o ... "})

/data/nextcloud/lib/private/Route/Router.php - line 297:

call_user_func(OC\AppFramew ... {}, { _route: "o ... "})

/data/nextcloud/ocs/v1.php - line 82:

OC\Route\Router->match("/ocsapp/app ... s")

/data/nextcloud/ocs/v2.php - line 24:

require_once("/data/nextcloud/ocs/v1.php")

kpleines avatar Feb 04 '19 18:02 kpleines

Got this error on ver 17.0.2. Using nextcloud with external storage support, linked storage is local. Nextcloud was quite normal and stable just before migrating data to new disks, but problem occurs after moving whole data to new disks, even though mounted path is exactly same. Guessed that it might be cacheing problem since disks are changed, so tried to truncate oc_filecache table and redis cache, but problem persists. Even tried to drop whole database and reinstall nextcloud, but problem still occurs. This error keeps removing shared directories, which should not happen at all.

import-shiburin avatar Jan 14 '20 18:01 import-shiburin