Nextcloud踩坑记

Windows下无法同步文件夹

  1. 文件夹大小写区分问题 在windows下默认文件夹不区分大小写,也就是"test"和"TEST"是同一个文件夹,如果想要同步文件夹,需要设置文件夹大小写区分
1
2
3
4
5
6
# 查询文件夹大小写区分
fsutils.exe file queryCaseSensitiveInfo PATH
# 设置区分大小写
fsutils.exe file setCaseSensitiveInfo PATH enable
# 设置不区分文件大小写
fsutils.exe file setCaseSensitiveInfo PATH disable

注意:此处设置的路径并不会传递到下一级目录,也就是'D:\Nextcloud'目录被设置为区分大小写,但是'D\Nextcloud\Downloads'目录下又不会区分大小写,所以需要设置'D:\Nextcloud\Downloads'时路径必须是他,而不是上一级目录

更新后提示权限错误或者无法启动

  1. 查看nginx运行日志,此处网页错误id IBdcJOfunqHjhcnOBr9S
1
2
3
systemctl status nginx.service | grep IBdcJOfunqHjhcnOBr9S
Jun 24 08:58:25 cloud.lengyefenghan.top nginx[2911]: 2022/06/24 08:58:25 [error] 2911#2911: *3 FastCGI sent in stderr: "PHP message: {"reqId":"IBdcJOfunqHjhcnOBr9S","level":3,"time":"2022-06-24T00:58:25+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/","message":"touch(): Unable to create file /usr/share/webapps/nextcloud/config/config.php because Permission denied at /usr/share/webapps/nextcloud/lib/private/Config.php#263","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36","version":"","exception":{"Exception":"Error","Message":"touch(): Unable to create file /usr/share/webapps/nextcloud/config/config.php because Permission denied at /usr/share/webapps/nextcloud/lib/private/Config.php#263","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/private/Config.php","line":263,"function":"touch"},{"file":"/usr/share/webapps/nextcloud/lib/private/Config.php","line":143,"function":"writeData","class":"OC\\Config","type":"->"},{"file":"/usr/shar...PHP message: {"reqId":"IBdcJOfunqHjhcnOBr9S","level":3,"time":"2022-06-24T00:58:25+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/","message":"fopen(/usr/share/webapps/nextcloud/config/config.php): Failed to open stream: Permission denied at /usr/share/webapps/nextcloud/lib/private/Config.php#264","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36","version":"","exception":{"Exception":"Error","Message":"fopen(/usr/share/webapps/nextcloud/config/config.php): Failed to open stream: Permission denied at /usr/share/webapps/nextcloud/lib/private/Config.php#264","Code":0,"Trace":[{"function":"onError","class":"OC\\Log\\ErrorHandler","type":"::"},{"file":"/usr/share/webapps/nextcloud/lib/private/Config.php","line":264,"function":"fopen"},{"file":"/usr/share/webapps/nextcloud/lib/private/Config.php","line":143,"function":"writeData","class":"OC\\Config",
Jun 24 08:58:25 cloud.lengyefenghan.top nginx[2911]: 2022/06/24 08:58:25 [error] 2911#2911: *3 FastCGI sent in stderr: "PHP message: {"reqId":"IBdcJOfunqHjhcnOBr9S","level":3,"time":"2022-06-24T00:58:25+00:00","remoteAddr":"127.0.0.1","user":"--","app":"PHP","method":"GET","url":"/","message":"fopen(/usr/share/webapps/nextcloud/data/nextcloud.log): Failed to open stream: No such file or directory at /usr/share/webapps/nextcloud/lib/private/Log/File.php#84","userAgent":"Mozilla/5.0 (W" while reading upstream, client: 127.0.0.1, server: cloud.lengyefenghan.top, request: "GET / HTTP/2.0", upstream: "fastcgi://unix:/run/nextcloud/nextcloud.sock:", host: "cloud.lengyefenghan.top"

根据错误可知是权限问题,通过chmod 775 -R config可以修正,但是此处修正后仍然提示错误,经过检查是php-fpm配置文件丢失,在上一篇文章 在Archlinux下安装nextcloud 中修改的php-fpm进行的操作丢失,重新操作后恢复正常

updatedupdated2022-06-242022-06-24