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

Trilium docker 是不是不支持 映射到宿主机通过NFS挂载的目录 #47

Closed
GerGitHub opened this issue Feb 25, 2023 · 6 comments

Comments

@GerGitHub
Copy link

如果宿主机的目录是通过NFS挂载的共享目录,trilium过几分钟就会报错,需要刷新浏览器重新登录;

弹窗:
Error when calling PUT notes/UtLliiX8PHN2: error - Unauthorized

log:
[session-file-store] will retry, error on last attempt: Error: ENOENT: no such file or directory, open '/root/trilium-data/sessions/cN8YbZR35_-nZDktfLwVuCje8odMMXnz.json'
PUT /api/notes/UtLliiX8PHN2 rejected with 401 Logged in session not found
JS Error: Error when calling PUT notes/UtLliiX8PHN2: error - Unauthorized

Stack: Error
at Object.N [as logError] (http://192.168.1.111:8080/app-dist/desktop.js:2:97436)
at Object.throwError (http://192.168.1.111:8080/app-dist/desktop.js:2:82914)
at c (http://192.168.1.111:8080/app-dist/desktop.js:2:79764)
at async Object.error (http://192.168.1.111:8080/app-dist/desktop.js:2:80072)

如果直接挂宿主机系统自带目录就不会出现这些问题

@Nriver
Copy link
Owner

Nriver commented Feb 25, 2023

可能nfs挂载设置的权限不对吧

@GerGitHub
Copy link
Author

开机挂载 fstab
192.1168.1.100:/notebook /opt/notebook nfs hard,rw,nolock,bg,tcp 0 0

mount 命令直接挂载试过,通docker创建nfs挂载卷也试过,权限也就上面几行,都会出问题

@Nriver
Copy link
Owner

Nriver commented Feb 25, 2023

ls -al 看看文件所有者是不是变了

@GerGitHub
Copy link
Author

docker 建了2个容器,一个直接映射主机系统下自建目录, 一个通NFS挂载的目录
刚看了一下,ls -al
主机系统自建目录 drwxr-xr-x 5 1000 1000 4096 Feb 25 12:39 notebook1
NFS挂载的目录 drwxr-xr-x 6 root root 4096 Feb 25 12:10 notebook2

@GerGitHub
Copy link
Author

GerGitHub commented Feb 25, 2023

这个怎么解决 主机用户 root ID 是0, trilium映射后的用户ID 是1000

@hxchtiewei
Copy link

docker 创建时加参数 puid=0,pgid=0

@Nriver Nriver closed this as completed Apr 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants