Skip to content

被其他软件占用文件时需要弹框锁定 #2309

Closed
@DonSudo

Description

@DonSudo

更新beta12后打开win10客户端,打开一个文件,鼠标点击了最上方的文件名,之后点击正文,上方栏出现报错(未截图),之后无法打开该文件,如下所示:
loss

图为data文件夹下的情况:
image

附上log:


/ | () \ \ / / _ _ __ _ _ __
_
\ | | \ V / | | | | / ` | | '
) | | | | | | || | | (| | | | | |
|
/ || || _,| _,| || |_|
I 2021/07/03 23:50:20 working.go:97: kernel is booting:
* ver [1.2.0-beta12]
* runtime mode [prod]
* workspace directory [F:\OneDrive\iNote]
* working directory [C:\Users\Yezi\AppData\Local\Programs\SiYuan\resources]
* temp directory [C:\Users\Yezi\AppData\Local\Temp\siyuan]
* system temp directory [C:\Windows\Temp\siyuan]
* rsync directory [C:\Users\Yezi\AppData\Local\Programs\SiYuan\resources\rsync]
* read only [false]
* container [std]
* resident [true]
* arch [amd64]
I 2021/07/03 23:50:20 conf.go:234: local serve path [http://192.168.20.80:6806]
I 2021/07/03 23:50:20 database.go:97: reinitialized database [C:\Users\Yezi\AppData\Local\Temp\siyuan\siyuan.db]
I 2021/07/03 23:50:20 serve.go:51: kernel HTTP server is booting [http://0.0.0.0:6806]
I 2021/07/03 23:50:23 box.go:749: fix legacy tree [专业课/自动控制/时域分析法.sy]
I 2021/07/03 23:50:23 box.go:749: fix legacy tree [专业课/自动控制/线性系统的稳定性.sy]
I 2021/07/03 23:50:23 box.go:501: rebuilding database of box [专业课]
I 2021/07/03 23:50:23 box.go:505: rebuilt database of box [专业课]
I 2021/07/03 23:50:24 box.go:749: fix legacy tree [考研/概率论/一维随机变量及其分布/概率密度.sy]
I 2021/07/03 23:50:24 box.go:749: fix legacy tree [考研/概率论/二维随机变量/二维离散型随机变量.sy]
I 2021/07/03 23:50:24 box.go:749: fix legacy tree [考研/概率论/二维随机变量/二维连续型随机变量.sy]
I 2021/07/03 23:50:25 box.go:749: fix legacy tree [考研/概率论/二维随机变量/求二维随机变量函数的分布.sy]
I 2021/07/03 23:50:25 box.go:749: fix legacy tree [考研/概率论/二维随机变量/随机变量的独立性.sy]
I 2021/07/03 23:50:25 box.go:749: fix legacy tree [考研/线性代数/二次型/正定二次型.sy]
I 2021/07/03 23:50:25 box.go:749: fix legacy tree [考研/高等数学/微分方程.sy]
I 2021/07/03 23:50:25 box.go:501: rebuilding database of box [考研]
I 2021/07/03 23:50:25 box.go:505: rebuilt database of box [考研]
I 2021/07/03 23:50:29 working.go:122: kernel booted
E 2021/07/03 23:51:34 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:34 box.go:206: rename [oldPath=/自动控制/​控制系统的数学模型old.syuu8dsgb, newPath=/自动控制/​控制系统的数学模型old.sy] in box [url=http://127.0.0.1:6806/siyuan/1621433023939/专业课/] failed: rename F:\OneDrive\iNote\data\专业课\自动控制\​控制系统的数学模型old.syuu8dsgb F:\OneDrive\iNote\data\专业课\自动控制\​控制系统的数学模型old.sy: Access is denied.
E 2021/07/03 23:51:34 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:49 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:49 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:51 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:52 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:54 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:54 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:56 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:56 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:59 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:51:59 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:00 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:01 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:03 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:04 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:04 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:05 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:05 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:05 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:06 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:06 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:07 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:07 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:09 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...
E 2021/07/03 23:52:09 box.go:738: parse json [专业课/自动控制/​控制系统的数学模型old.sy] to tree failed: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...

Activity

88250

88250 commented on Jul 4, 2021

@88250
Member

你好,这个报错看上去是因为没有读到数据导致,可能是因为使用了同步盘?

88250

88250 commented on Jul 4, 2021

@88250
Member

如果用了同步盘的话,请检查一下同步状态还有同步历史,谢谢。

DonSudo

DonSudo commented on Jul 4, 2021

@DonSudo
Author

如果用了同步盘的话,请检查一下同步状态还有同步历史,谢谢。

image

image

image

88250

88250 commented on Jul 4, 2021

@88250
Member

主要问题还是文件被占用写不进去:

E 2021/07/03 23:51:34 box.go:206: rename [oldPath=/自动控制/​控制系统的数学模型old.syuu8dsgb, newPath=/自动控制/​控制系统的数学模型old.sy] in box [url=http://127.0.0.1:6806/siyuan/1621433023939/专业课/] failed: rename F:\OneDrive\iNote\data\专业课\自动控制\​控制系统的数学模型old.syuu8dsgb F:\OneDrive\iNote\data\专业课\自动控制\​控制系统的数学模型old.sy: Access is denied.

这种情况下为了避免数据丢失,会保留重命名失败的临时文件。

changed the title [-]Data loss(数据丢失)[/-] [+]OnDrive 同步时容易导致数据丢失[/+] on Jul 4, 2021
self-assigned this
on Jul 4, 2021
changed the title [-]OnDrive 同步时容易导致数据丢失[/-] [+]被其他软件占用文件时需要弹框锁定[/+] on Jul 4, 2021
added this to the 1.2.0 milestone on Jul 4, 2021
88250

88250 commented on Jul 4, 2021

@88250
Member

下个版本改为如果发现被占用,则锁定编辑并提示使用者,如果一直获取不到锁就只能先一直处于弹框锁定应用的状态。

另外,修改锁定时间为 60s,降低一些获取锁失败的概率。

modified the milestones: 1.2.0, 1.2.0-beta13 on Jul 4, 2021
added a commit that references this issue on Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@Vanessa219@DonSudo

      Issue actions

        被其他软件占用文件时需要弹框锁定 · Issue #2309 · siyuan-note/siyuan