westberliner / checksum

Plugin for Nextcloud and ownCloud to create hashes of files.
GNU General Public License v3.0
29 stars 15 forks source link

Checksum always shows "File not found." in subdirectories #52

Closed cangeeq closed 3 years ago

cangeeq commented 3 years ago

With Nextcloud 20.0.8 and PHP 7.2.24-0ubuntu0.18.04.7 and Checksum 1.1.0 for any algorithm I choose for files in subdirectories all I get in the Details / Checksum tab is something like:

SHA256:File not found.

Sample error log below shows an attempt on a file "ports.md" in subdir "work", but note there is no file separator in the exception error path that ends "/workports.md" so the fopen fails:

{"reqId":"ZnHCWQV1WY8kOGmbVjxq","level":3,"time":"2021-02-28T18:36:33+00:00","remoteAddr":"192.168.2.101","user":"john","app":"PHP","method":"GET","url":"/cloud/index.php/apps/checksum/check?source=%2Fworkports.md&type=sha256","message":{"Exception":"Error","Message":"fopen(/var/www/nextcloud/data/john/files/workports.md): failed to open stream: No such file or directory at /var/www/nextcloud/lib/private/Files/Storage/Local.php#355","Code":0,"Trace":[{"function":"onError","class":"OC\Log\ErrorHandler","type":"::","args":[2,"fopen(/var/www/nextcloud/data/john/files/workports.md): failed to open stream: No such file or directory","/var/www/nextcloud/lib/private/Files/Storage/Local.php",355,{"path":"files/workports.md","mode":"rb"}]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Local.php","line":355,"function":"fopen","args":["/var/www/nextcloud/data/john/files/workports.md","rb"]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Encryption.php","line":480,"function":"fopen","class":"OC\Files\Storage\Local","type":"->","args":["files/workports.md","rb"]},{"file":"/var/www/nextcloud/lib/private/Files/Storage/Wrapper/Wrapper.php","line":300,"function":"fopen","class":"OC\Files\Storage\Wrapper\Encryption","type":"->","args":["files/workports.md","rb"]},{"file":"/var/www/nextcloud/apps/checksum/lib/Controller/ChecksumController.php","line":107,"function":"fopen","class":"OC\Files\Storage\Wrapper\Wrapper","type":"->","args":["files/workports.md","rb"]},{"file":"/var/www/nextcloud/apps/checksum/lib/Controller/ChecksumController.php","line":76,"function":"getHash","class":"OCA\Checksum\Controller\ChecksumController","type":"->","args":["/workports.md","sha256"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":169,"function":"check","class":"OCA\Checksum\Controller\ChecksumController","type":"->","args":["/workports.md","sha256"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php","line":100,"function":"executeController","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Checksum\Controller\ChecksumController"},"check"]},{"file":"/var/www/nextcloud/lib/private/AppFramework/App.php","line":152,"function":"dispatch","class":"OC\AppFramework\Http\Dispatcher","type":"->","args":[{"class":"OCA\Checksum\Controller\ChecksumController"},"check"]},{"file":"/var/www/nextcloud/lib/private/Route/Router.php","line":309,"function":"main","class":"OC\AppFramework\App","type":"::","args":["OCA\Checksum\Controller\ChecksumController","check",{"class":"OC\AppFramework\DependencyInjection\DIContainer"},{"_route":"checksum.checksum.check"}]},{"file":"/var/www/nextcloud/lib/base.php","line":1008,"function":"match","class":"OC\Route\Router","type":"->","args":["/apps/checksum/check"]},{"file":"/var/www/nextcloud/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/nextcloud/lib/private/Log/ErrorHandler.php","Line":91,"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (X11; CrOS x86_64 13597.94.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.186 Safari/537.36","version":"20.0.8.1","id":"603be2b2394a5"}

westberliner commented 3 years ago

Thx for the bug report. Will check.

westberliner commented 3 years ago

The fileinfo object did change. Fix will be deployed in a moment v1.1.1.

westberliner commented 3 years ago

The fix is deployed. Hope this fixed your problem, tested with your nc version and with version 21. You may reset your browser cache. Reopen this ticket if you still have this issue.