Nextcloud将一个带密码的目录分享出来,当用户使用密码访问该共享时报错
报错截图如下所示:
那么,出现整个报错。我们首先需要找到整个报错的原因,无疑查看日志是最好的方式。在上面的截图最后一行,我们看到有一个Request ID
,我们可以在日志文件中通过查询这个ID来查看错误的原因:
该日志文件为数据目录中的的nextcloud.log
,通过在该文件中搜索该请求ID,可以看到下面的一段日志:
{"reqId":"d9LZZSIXzF9VXufNyOjz","level":3,"time":"2022-05-27T01:41:41+00:00","remoteAddr":"10.11.3.2","user":"--","app":"index","method":"GET","url":"/s/5sk2aX8ef2WTXBz","message":{"Exception":"Exception","Message":"Call to a member function getFileInfo() on null","Code":0,"Trace":[{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files_Sharing\\Controller\\ShareController"},"showShare"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files_Sharing\\Controller\\ShareController","showShare",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"token":"5sk2aX8ef2WTXBz","_route":"files_sharing.Share.showShare"}]},{"file":"/var/www/html/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/s/5sk2aX8ef2WTXBz"]},{"file":"/var/www/html/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","Line":159,"Previous":{"Exception":"Error","Message":"Call to a member function getFileInfo() on null","Code":0,"Trace":[{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Quota.php","line":77,"function":"getFileInfo","class":"OC\\Files\\Filesystem","type":"::","args":["","ext"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Quota.php","line":107,"function":"getSize","class":"OC\\Files\\Storage\\Wrapper\\Quota","type":"->","args":["files"]},{"file":"/var/www/html/lib/private/Files/Storage/Wrapper/Wrapper.php","line":335,"function":"free_space","class":"OC\\Files\\Storage\\Wrapper\\Quota","type":"->","args":["files/inbox/\u96e8\u71d5\u6570\u636e"]},{"file":"/var/www/html/apps/files_sharing/lib/Controller/ShareController.php","line":383,"function":"free_space","class":"OC\\Files\\Storage\\Wrapper\\Wrapper","type":"->","args":["files/inbox/\u96e8\u71d5\u6570\u636e"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":218,"function":"showShare","class":"OCA\\Files_Sharing\\Controller\\ShareController","type":"->","args":[""]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":127,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files_Sharing\\Controller\\ShareController"},"showShare"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Files_Sharing\\Controller\\ShareController"},"showShare"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Files_Sharing\\Controller\\ShareController","showShare",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"token":"5sk2aX8ef2WTXBz","_route":"files_sharing.Share.showShare"}]},{"file":"/var/www/html/lib/base.php","line":993,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/s/5sk2aX8ef2WTXBz"]},{"file":"/var/www/html/index.php","line":37,"function":"handleRequest","class":"OC","type":"::","args":[]}],"File":"/var/www/html/lib/private/Files/Filesystem.php","Line":864},"CustomMessage":"--"},"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Edg/101.0.1210.53","version":"21.0.2.1"}
{"reqId":"LDJoIy3ILiVmfuZtDuHm","level":3,"time":"2022
在这段日志信息中,有一个错误字段的信息Error","Message":"Call to a member function getFileInfo() on null
,通过google搜索查找到了解决方案,将共享该目录的用户的配额修改为无限
即可解决。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)