Skip to content

The doc title image index failed when using notebook-level assets #9936

Closed
@2234839

Description

@2234839
Member

直接上传的题图应该与该文档关联

Is there an existing issue for this?

  • I have searched the existing issues

Can the issue be reproduced with the default theme (daylight/midnight)?

  • I was able to reproduce the issue with the default theme

Could the issue be due to extensions?

  • I've ruled out the possibility that the extension is causing the problem.

Describe the problem

直接上传题图,

SELECT * from assets where root_id = 该文档

无法通过sql查询到,似乎完全没有记录到 assets 表中

Expected result

assets 存在题图相关资源的记录,可以sql查询得到

Screenshot or screen recording presentation

No response

Version environment

- Version: 2.11.3
- Operating System: windows
- Browser (if used):

Log file

More information

No response

Activity

self-assigned this
on Dec 20, 2023
changed the title [-]直接上传的题图应该与该文档关联[/-] [+]The doc title image uploaded directly should be associated with the doc[/+] on Dec 20, 2023
added this to the 2.11.4 milestone on Dec 20, 2023
88250

88250 commented on Dec 20, 2023

@88250
Member

我这里测试正常,请再测试看看,操作录屏:

issue.webm
removed this from the 2.11.4 milestone on Dec 20, 2023
88250

88250 commented on Dec 20, 2023

@88250
Member

我先关闭了,如果还有问题请继续跟帖,谢谢 🙏

2234839

2234839 commented on Dec 20, 2023

@2234839
MemberAuthor
default.mp4

我刚试了一下,创建一个新笔记本是可以的,但在我之前的笔记本上却不行

88250

88250 commented on Dec 20, 2023

@88250
Member

看下 upload 请求,有没有 id 参数。

2234839

2234839 commented on Dec 20, 2023

@2234839
MemberAuthor

图片
图片

刚刚操作的日志


I 2023/12/20 19:44:36 sync.go:766: sync websocket message: &{0  map[cmd:synced kernel:az6ew9j synced:1.703072677494e+12]}
I 2023/12/20 19:44:37 repository.go:1204: syncing data repo [device=602aa64d-3fbc-4675-81e6-c019434dc978, kernel=h1vftdw, provider=0, mode=a/false]
I 2023/12/20 19:44:37 ref.go:52: got local latest [device=602aa64d-3fbc-4675-81e6-c019434dc978/windows, id=00f7a26cdede78090cf233ff9caac5e5d639b320, files=1592, size=521 MB, created=2023-12-20 19:44:25]
I 2023/12/20 19:44:37 ref.go:52: got local latest [device=602aa64d-3fbc-4675-81e6-c019434dc978/windows, id=00f7a26cdede78090cf233ff9caac5e5d639b320, files=1592, size=521 MB, created=2023-12-20 19:44:25]
I 2023/12/20 19:44:38 siyuan.go:112: uploaded object [siyuan/1587804457692/repo/main/lock-sync]
I 2023/12/20 19:44:38 ref.go:52: got local latest [device=602aa64d-3fbc-4675-81e6-c019434dc978/windows, id=00f7a26cdede78090cf233ff9caac5e5d639b320, files=1592, size=521 MB, created=2023-12-20 19:44:25]
I 2023/12/20 19:44:38 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/refs/latest]
I 2023/12/20 19:44:38 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/indexes/50b931ab4f8b1602f3e2f624a622a4b648f9dd41]
I 2023/12/20 19:44:38 sync.go:1536: got cloud latest [device=cpaherhj4vz6/android, id=50b931ab4f8b1602f3e2f624a622a4b648f9dd41, files=1592, size=521 MB, created=2023-12-20 19:44:36]
I 2023/12/20 19:44:38 sync.go:1424: got latest sync [device=602aa64d-3fbc-4675-81e6-c019434dc978/windows, id=00f7a26cdede78090cf233ff9caac5e5d639b320, files=1592, size=521 MB, created=2023-12-20 19:44:25]
I 2023/12/20 19:44:38 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/indexes-v2.json]
I 2023/12/20 19:44:38 siyuan.go:112: uploaded object [siyuan/1587804457692/repo/main/refs/latest]
I 2023/12/20 19:44:38 sync.go:1142: uploaded index [device=602aa64d-3fbc-4675-81e6-c019434dc978/windows, id=00f7a26cdede78090cf233ff9caac5e5d639b320, files=1592, size=521 MB, created=2023-12-20 19:44:25]
I 2023/12/20 19:44:38 siyuan.go:112: uploaded object [siyuan/1587804457692/repo/main/check/indexes/c064365b4c72445ad5e9ddf6c945077824ebc33a]
I 2023/12/20 19:44:38 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/refs/latest]
I 2023/12/20 19:44:38 sync.go:1352: updated latest sync [device=602aa64d-3fbc-4675-81e6-c019434dc978/windows, id=00f7a26cdede78090cf233ff9caac5e5d639b320, files=1592, size=521 MB, created=2023-12-20 19:44:25]
I 2023/12/20 19:44:39 siyuan.go:173: removed object [siyuan/1587804457692/repo/main/lock-sync]
I 2023/12/20 19:44:39 repository.go:1261: synced data repo [device=602aa64d-3fbc-4675-81e6-c019434dc978, kernel=h1vftdw, provider=0, mode=a/false, ufc=3, dfc=2, ucc=0, dcc=0, ub=36 kB, db=87 kB] in [1.67s], merge result [conflicts=0, upserts=0, removes=0]

2234839

2234839 commented on Dec 20, 2023

@2234839
MemberAuthor

我知道了,因为之前尝试的图片插入笔记中过,所以再次上传图片计算的hash是一样的,思源的逻辑应该是资源的root_id仍然会指向之前的插入时的文档

那么应该是重复上传相同资源的处理存在问题,我认为该资源被上传两次或许应该存在两份,或者assets表中可以存在两条记录指向同一资源文件但root_id 不同(这个应该更好)

2234839

2234839 commented on Dec 20, 2023

@2234839
MemberAuthor

我知道了,因为之前尝试的图片插入笔记中过,所以再次上传图片计算的hash是一样的,思源的逻辑应该是资源的root_id仍然会指向之前的插入时的文档

那么应该是重复上传相同资源的处理存在问题,我认为该资源被上传两次或许应该存在两份,或者assets表中可以存在两条记录指向同一资源文件但root_id 不同(这个应该更好)

好像也不是,新笔记本就没毛病

2234839

2234839 commented on Dec 20, 2023

@2234839
MemberAuthor

图片
图片

根本没有插入数据库

88250

88250 commented on Dec 20, 2023

@88250
Member

你找下日志里面是不是有条类似的报错:

E 2023/12/20 20:26:11 asset.go:75: read asset [F:\SiYuan\data\assets\test-20231220202352-d3r03ct.png] data failed: open F:\SiYuan\data\assets\test-20231220202352-d3r03ct.png: The system cannot find the file specified.
88250

88250 commented on Dec 20, 2023

@88250
Member

用关键字 read asset 搜索看看。如果有的话,说明可能是因为这个笔记本用了 笔记本级 资源文件夹,导致读取物理文件失败,所以后面没有索引到数据库里。

changed the title [-]The doc title image uploaded directly should be associated with the doc[/-] [+]The doc title image index failed when using notebook-level assets[/+] on Dec 20, 2023
added this to the 2.11.4 milestone on Dec 20, 2023
reopened this on Dec 20, 2023
2234839

2234839 commented on Dec 20, 2023

@2234839
MemberAuthor

是的
图片

88250

88250 commented on Dec 20, 2023

@88250
Member

好的,这个问题已经确认了,稍后修复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @88250@2234839

      Issue actions

        The doc title image index failed when using notebook-level assets · Issue #9936 · siyuan-note/siyuan