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

浏览器端开启访问鉴权后文档更新未保存 #5096

Closed
1 task done
kant-li opened this issue Jun 4, 2022 · 6 comments
Closed
1 task done

浏览器端开启访问鉴权后文档更新未保存 #5096

kant-li opened this issue Jun 4, 2022 · 6 comments
Assignees
Labels
Milestone

Comments

@kant-li
Copy link

kant-li commented Jun 4, 2022

该问题是否已经被报告过了? Is there an existing issue for this?

  • 我已经搜索了 Issues,没有发现类似问题
    I have searched the existing issues

描述问题 Describe the problem

  1. 更新一个文档之后,打开另一个文档,发现只加载了前面一部分,于是刷新页面,提示输入授权码,输入后可以正常加载;
  2. 回到刚才编辑的页面,发现内容停留在两天前的某个时间点,这两天写的东西全部丢失了;

期待的结果 Expected result

可以看到这两天更新的内容。

截屏或者录屏演示 Screenshot or screen recording presentation

No response

版本环境 Version environment

- Version: 1.9.6(Docker镜像)
- Operating System: MacOS 12.3.1
- Browser (if used): Google Chrome 100.0.4896.127

日志文件 Log file

// 前面都是同样的信息,mod time failed: chtimes /siyuanworkspace/data/.siyuan/conf.json: operation not permitted,一直到5月30日早上7点多

E 2022/06/02 07:34:32 workspace.go:81: change file [/siyuanworkspace/data/.siyuan/conf.json] mod time failed: chtimes /siyuanworkspace/data/.siyuan/conf.json: operation not permitted
E 2022/06/02 07:34:33 workspace.go:81: change file [/siyuanworkspace/data/.siyuan/conf.json] mod time failed: chtimes /siyuanworkspace/data/.siyuan/conf.json: operation not permitted
E 2022/06/02 12:03:26 serve.go:224: get cookie failed: securecookie: expired timestamp
E 2022/06/02 12:03:26 serve.go:224: get cookie failed: securecookie: expired timestamp
E 2022/06/02 12:03:26 serve.go:224: get cookie failed: securecookie: expired timestamp
E 2022/06/02 12:03:26 serve.go:224: get cookie failed: securecookie: expired timestamp
E 2022/06/02 12:03:26 serve.go:224: get cookie failed: securecookie: expired timestamp
E 2022/06/02 12:03:26 serve.go:224: get cookie failed: securecookie: expired timestamp
E 2022/06/04 10:13:56 workspace.go:81: change file [/siyuanworkspace/data/.siyuan/conf.json] mod time failed: chtimes /siyuanworkspace/data/.siyuan/conf.json: operation not permitted
E 2022/06/04 10:13:56 workspace.go:81: change file [/siyuanworkspace/data/.siyuan/conf.json] mod time failed: chtimes /siyuanworkspace/data/.siyuan/conf.json: operation not permitted
E 2022/06/04 10:13:57 workspace.go:81: change file [/siyuanworkspace/data/.siyuan/conf.json] mod time failed: chtimes /siyuanworkspace/data/.siyuan/conf.json: operation not permitted
I 2022/06/04 10:17:58 index.go:179: rebuilt database for notebook [20210808180117-czj9bvb] in [0.19s], tree stat [count=47, size=997 kB]
I 2022/06/04 10:17:58 index.go:189: resolving refs...
I 2022/06/04 10:17:58 index.go:316: resolved refs [77]
E 2022/06/04 10:18:11 assets.go:673: copy tree assets from [[/siyuanworkspace/data/20210808180117-czj9bvb/assets]] to [/siyuanworkspace/data/assets] failed: chmod /siyuanworkspace/data/assets/blockquote-20210512170136-ls06uyh.svg: operation not permitted
E 2022/06/04 10:18:11 workspace.go:81: change file [/siyuanworkspace/data/.siyuan/conf.json] mod time failed: chtimes /siyuanworkspace/data/.siyuan/conf.json: operation not permitted

更多信息 More information

  1. 输入授权码后,虽然日志中还有 not permitted 记录,但新的文档更新是正常的;
  2. 查看日志文档的路径,整个下来都是有写权限的(owner root);
  3. 每天凌晨自动提交笔记数据,最近提交的 conf.json 信息就是 6 月 2 日早上 7 点多,说明之后没有更新成功;

有什么办法可以恢复这两天写的内容吗?要崩溃了 :(

@kant-li kant-li changed the title 登录过期后没有提示,导致后面的更新未保存 文档更新未保存 Jun 4, 2022
@88250
Copy link
Member

88250 commented Jun 4, 2022

是不是进入块聚焦了,看下面包屑。

PS 请更新到最新版。

@kant-li
Copy link
Author

kant-li commented Jun 4, 2022

  1. 没有聚焦;
  2. 在 data 路径下 grep 查找新写入的内容关键字,没有找到记录,所以基本断定确实没有记录;
  3. 具体原因还不知道,有什么推断吗?是否和日志中的 operation not permitted 有关?看着并无关系,因为报错还在发生,但目前可以正常保存;

@88250
Copy link
Member

88250 commented Jun 4, 2022

data/.siyuan/conf.json 写入不了的话可能会有影响,如果是使用了官方同步的话一定会有影响。另外

E 2022/06/04 10:18:11 assets.go:673: copy tree assets from [[/siyuanworkspace/data/20210808180117-czj9bvb/assets]] to [/siyuanworkspace/data/assets] failed: chmod /siyuanworkspace/data/assets/blockquote-20210512170136-ls06uyh.svg: operation not permitted

这个也是权限问题,建议先把这个权限问题搞好,Docker 部署的话看下文档,需要使用对应用户。

@kant-li
Copy link
Author

kant-li commented Jun 4, 2022

嗯,已处理权限问题,并更新到最新版本。后面看下问题是否复现吧。

@kant-li kant-li closed this as completed Jun 4, 2022
@kant-li kant-li reopened this Jul 6, 2022
@kant-li
Copy link
Author

kant-li commented Jul 6, 2022

问题复现了,看来默认 cookie 有效期是一个月。
这次的日志记录如下:

I 2022/06/05 05:49:29 runtime.go:45: kernel is booting:
* ver [2.0.16]
* arch [amd64]
* runtime mode [prod]
* working directory [/opt/siyuan]
* read only [false]
* container [docker]
* database [ver=20220501]
* workspace directory [/siyuanworkspace, data 104 MB]
I 2022/06/05 05:49:29 serve.go:78: kernel is booting [http://0.0.0.0:6806]
I 2022/06/05 05:49:29 database.go:83: reinitialized database [/siyuanworkspace/temp/siyuan.db]
I 2022/06/05 05:49:29 conf.go:509: database size [4.1 kB], block count [19540]
I 2022/06/05 05:49:29 working.go:137: kernel booted
E 2022/07/04 19:22:21 serve.go:212: get cookie failed: securecookie: expired timestamp
E 2022/07/04 19:22:21 serve.go:212: get cookie failed: securecookie: expired timestamp
E 2022/07/04 19:22:21 serve.go:212: get cookie failed: securecookie: expired timestamp
E 2022/07/04 19:22:21 serve.go:212: get cookie failed: securecookie: expired timestamp

  1. 6月5日重启 docker,接近一个月后 cookie 失效;
  2. 一直到 7月6日早上,前端页面都处于可编辑状态,偶然点击其它文档,发现无法打开,判断出现了问题;
  3. 刷新页面,发现正在编辑的文档,这两天更新的内容都消失了……

推测和前端提交逻辑有关系,提交没成功的情况下,没有及时报错或跳转到登录页面。

环境信息:

  • Version: 2.0.16(Docker镜像)
  • Operating System: MacOS 12.3.1
  • Browser (if used): Google Chrome 100.0.4896.127

@88250 88250 changed the title 文档更新未保存 浏览器端开启访问鉴权后文档更新未保存 Jul 6, 2022
@88250 88250 self-assigned this Jul 6, 2022
@88250 88250 added the Bug label Jul 6, 2022
@88250 88250 added this to the 2.0.26 milestone Jul 6, 2022
@88250
Copy link
Member

88250 commented Jul 6, 2022

谢谢,已经能够重现问题,下个版本改进。

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

No branches or pull requests

2 participants