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

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

Closed
LukasReschke opened this issue Aug 18, 2016 · 16 comments
Closed

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

LukasReschke opened this issue Aug 18, 2016 · 16 comments
Assignees

Comments

@LukasReschke
Copy link
Member

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 LukasReschke added this to the Nextcloud 10.0 milestone Aug 18, 2016
@LukasReschke
Copy link
Member Author

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.

@blizzz
Copy link
Member

blizzz commented Aug 18, 2016

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.

@LukasReschke
Copy link
Member Author

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?

@derkostka
Copy link
Contributor

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.

@LukasReschke
Copy link
Member Author

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

@LukasReschke
Copy link
Member Author

LukasReschke commented Aug 22, 2016

owncloud/core#25740 seems related and has reproduction steps.

@rullzer
Copy link
Member

rullzer commented Aug 22, 2016

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

@rullzer rullzer self-assigned this Aug 22, 2016
rullzer added a commit that referenced this issue Aug 22, 2016
If a shared file is moved to the trash the share entry is still alive.
However the sharee can't initialise the share since it is not in the
owners dir <user>/files.

So check if it is there and if not log a debug and carry on.

Fixes #938
@rullzer
Copy link
Member

rullzer commented Aug 22, 2016

PR in #1013

rullzer added a commit that referenced this issue Aug 23, 2016
Since this exception can be thrown when a shared file is in the
trashbin there is no need to spam the log like crazy.

Fixes #938
@derkostka
Copy link
Contributor

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 ..

@rullzer
Copy link
Member

rullzer commented Aug 23, 2016

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?

@derkostka
Copy link
Contributor

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
Copy link
Contributor

derkostka commented Aug 23, 2016

Okay, fixed the problem. Thank you!

rullzer added a commit that referenced this issue Aug 24, 2016
Since this exception can be thrown when a shared file is in the
trashbin there is no need to spam the log like crazy.

Fixes #938
@enoch85
Copy link
Member

enoch85 commented Aug 8, 2017

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}
--

@MorrisJobke
Copy link
Member

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

No - new ticket. ;)

@kpleines
Copy link

kpleines commented Feb 4, 2019

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")

@import-shiburin
Copy link

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.

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

No branches or pull requests

9 participants