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

Data sync may cause data loss on Android 14 #10205

Closed
88250 opened this issue Jan 17, 2024 · 54 comments
Closed

Data sync may cause data loss on Android 14 #10205

88250 opened this issue Jan 17, 2024 · 54 comments
Assignees
Labels
Milestone

Comments

@88250
Copy link
Member

88250 commented Jan 17, 2024

@88250 88250 self-assigned this Jan 17, 2024
@88250 88250 added the Bug label Jan 17, 2024
@88250 88250 added this to the backlog milestone Jan 17, 2024
@88250 88250 pinned this issue Jan 17, 2024
@2234839
Copy link
Member

2234839 commented Jan 17, 2024


I 2024/01/17 13:58:38 working_mobile.go:66: 
  ____    _  __   __
 / ___|  (_) \ \ / /  _   _    __ _   _ __
 \___ \  | |  \ V /  | | | |  / _` | | '_ \
  ___) | | |   | |   | |_| | | (_| | | | | |
 |____/  |_|   |_|    \__,_|  \__,_| |_| |_|
I 2024/01/17 13:58:38 runtime.go:74: kernel is booting:
    * ver [2.12.3]
    * arch [arm64]
    * os [Android 14/SDK 34/WebView 120/Manufacturer Xiaomi/Brand Redmi/UA Mozilla/5.0 (Linux; Android 14; 23078RKD5C Build/UP1A.230905.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/120.0.6099.193 Mobile Safari/537.36]
    * pid [5354]
    * runtime mode [prod]
    * working directory [/data/user/0/org.b3log.siyuan/files/app/app]
    * read only [false]
    * container [android]
    * database [ver=20220501]
    * workspace directory [/storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan]
I 2024/01/17 13:58:38 conf.go:137: initialized the specified language [zh_CN]
I 2024/01/17 13:58:38 runtime.go:123: use network proxy [system]
I 2024/01/17 13:58:38 serve.go:115: kernel [pid=5354] http server [0.0.0.0:6806] is booting
I 2024/01/17 13:58:39 sync.go:723: sync websocket connected
I 2024/01/17 13:58:39 sync.go:768: sync websocket message: &{0  map[cmd:kernels kernels:[map[hostname:子虚笔记本 id:p6fe7hw os:windows repo:main ver:2.12.3] map[hostname:localhost id:38ej44b os:android repo:main ver:2.12.3]]]}
I 2024/01/17 13:58:39 sync.go:146: sync before boot
I 2024/01/17 13:58:39 ref.go:52: got local latest [device=cpaherhj4vz6/android, id=724269938d83a502264a63a2040a250101d1d190, files=1796, size=753 MB, created=2024-01-16 22:47:45]
I 2024/01/17 13:58:39 repo.go:585: walked data [files=1768]
I 2024/01/17 13:58:39 ref.go:52: got local latest [device=cpaherhj4vz6/android, id=724269938d83a502264a63a2040a250101d1d190, files=1796, size=753 MB, created=2024-01-16 22:47:45]
I 2024/01/17 13:58:39 ref.go:66: updated local latest to [device=cpaherhj4vz6/android, id=80534ab19de91b7ee8b959bd571d94f343d918de, files=1768, size=753 MB, created=2024-01-17 13:58:39]
I 2024/01/17 13:58:39 ref.go:52: got local latest [device=cpaherhj4vz6/android, id=80534ab19de91b7ee8b959bd571d94f343d918de, files=1768, size=753 MB, created=2024-01-17 13:58:39]
I 2024/01/17 13:58:40 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/refs/latest]
I 2024/01/17 13:58:40 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/indexes/181fefc7330099f589949e1177ab1adf329b8cbf]
I 2024/01/17 13:58:40 sync.go:1577: got cloud latest [device=602aa64d-3fbc-4675-81e6-c019434dc978/windows, id=181fefc7330099f589949e1177ab1adf329b8cbf, files=1796, size=753 MB, created=2024-01-16 23:31:37]
I 2024/01/17 13:58:40 repository.go:1197: boot get sync cloud files elapsed [0.80s]
I 2024/01/17 13:58:40 blocktree.go:495: read block tree [3.0 MB] to [/storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/temp/blocktree], elapsed [0.05s]
I 2024/01/17 13:58:40 conf.go:770: database size [123 MB], tree/block count [430/10526]
I 2024/01/17 13:58:40 working.go:192: kernel booted
I 2024/01/17 13:58:40 serve.go:207: serving [/] for user-agent [SiYuan/2.12.3 https://b3log.org/siyuan Android Mozilla/5.0 (Linux; Android 14; 23078RKD5C Build/UP1A.230905.011; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/120.0.6099.193 Mobile Safari/537.36]
I 2024/01/17 13:58:40 box.go:76: auto stat [trees=430, blocks=10526, dataSize=757 MB, assetsSize=719 MB]
E 2024/01/17 13:58:40 plugin.go:106: plugin [feed] js not found
W 2024/01/17 13:58:53 index_fix.go:81: exist more than one ref duplicated [20240115162002-i24yr9v], reindex it
I 2024/01/17 13:58:59 repository.go:1259: syncing data repo [device=cpaherhj4vz6, kernel=38ej44b, provider=0, mode=a/true]
I 2024/01/17 13:58:59 ref.go:52: got local latest [device=cpaherhj4vz6/android, id=80534ab19de91b7ee8b959bd571d94f343d918de, files=1768, size=753 MB, created=2024-01-17 13:58:39]
I 2024/01/17 13:59:00 repo.go:585: walked data [files=1768]
I 2024/01/17 13:59:00 ref.go:52: got local latest [device=cpaherhj4vz6/android, id=80534ab19de91b7ee8b959bd571d94f343d918de, files=1768, size=753 MB, created=2024-01-17 13:58:39]
I 2024/01/17 13:59:00 ref.go:66: updated local latest to [device=cpaherhj4vz6/android, id=da2a2985a6f61222c38a95528aacb42692a9a15d, files=1768, size=753 MB, created=2024-01-17 13:59:00]
I 2024/01/17 13:59:00 siyuan.go:112: uploaded object [siyuan/1587804457692/repo/main/lock-sync]
I 2024/01/17 13:59:00 ref.go:52: got local latest [device=cpaherhj4vz6/android, id=da2a2985a6f61222c38a95528aacb42692a9a15d, files=1768, size=753 MB, created=2024-01-17 13:59:00]
I 2024/01/17 13:59:00 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/refs/latest]
I 2024/01/17 13:59:00 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/indexes/181fefc7330099f589949e1177ab1adf329b8cbf]
I 2024/01/17 13:59:00 sync.go:1577: got cloud latest [device=602aa64d-3fbc-4675-81e6-c019434dc978/windows, id=181fefc7330099f589949e1177ab1adf329b8cbf, files=1796, size=753 MB, created=2024-01-16 23:31:37]
I 2024/01/17 13:59:00 sync.go:1321: upsert file [fb68728923fa06088ad844351fdd30249f2eb193, /storage/av/relations.msgpack, 2024-01-17 13:58:40] chunk [cafd5394273824dfe20f38b888b46fee6b1afb08]
I 2024/01/17 13:59:00 siyuan.go:112: uploaded object [siyuan/1587804457692/repo/main/objects/fb/68728923fa06088ad844351fdd30249f2eb193]
I 2024/01/17 13:59:00 sync.go:1203: uploaded file [objects/fb/68728923fa06088ad844351fdd30249f2eb193, 1/1]
I 2024/01/17 13:59:00 sync.go:222: got local latest [da2a2985a6f61222c38a95528aacb42692a9a15d] files [1768]
I 2024/01/17 13:59:00 sync.go:1450: got latest sync [device=cpaherhj4vz6/android, id=724269938d83a502264a63a2040a250101d1d190, files=1796, size=753 MB, created=2024-01-16 22:47:45]
I 2024/01/17 13:59:00 sync.go:229: got latest sync [724269938d83a502264a63a2040a250101d1d190] files [1796]
I 2024/01/17 13:59:00 diff.go:42: upsert [1d6796b284666ef68bfc422d0b1dc2abdd2fc43e, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/specialForms.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [fed6d3487bdb30b6514a9ebcb4df2ecf6e657beb, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/机器人.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [5585d6fe99969b15e70b41c7f9a63b81cfa16fc1, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-6bs7c2t.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [6350773e82dd220d490bbbfcbbb4da109db426b0, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/test.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [690b831b45190a614c2c039604f49193d6206583, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-9fw3wmp.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [063c8c99f93993ca1e669728865b772516993600, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20201104153359-brkto0f.sy, 2023-09-05 11:33:28]
I 2024/01/17 13:59:00 diff.go:42: upsert [5c687ad96a1ba1605125c4d7eb6cce2032d18fc5, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1.sy, 2023-09-05 11:33:28]
I 2024/01/17 13:59:00 diff.go:49: upsert [lID=55b7994d291e0217db8ea8213800f3f546d4375f, lPath=/storage/av/relations.msgpack, lUpdated=2024-01-16 22:42:44, rID=fb68728923fa06088ad844351fdd30249f2eb193, rPath=/storage/av/relations.msgpack, rUpdated=2024-01-17 13:58:40]
W 2024/01/17 13:59:00 diff.go:56: prevent old upsert left [55b7994d291e0217db8ea8213800f3f546d4375f, /storage/av/relations.msgpack, 2024-01-16 22:42:44] overwrite right [fb68728923fa06088ad844351fdd30249f2eb193, /storage/av/relations.msgpack, 2024-01-17 13:58:40]
I 2024/01/17 13:59:00 diff.go:42: upsert [fa8cba8e6a3090c4998861dddfbb52bb4b83c2b3, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-n2mjpeu.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [dd61c7adeac262a59621de19e719f33d4afbe350, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb.sy, 2023-09-05 11:33:29]
I 2024/01/17 13:59:00 diff.go:42: upsert [4e0796f37be18946ac9cfce2adf232d26c5f5f28, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/tsconfig.json, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [ec07631b5dfa4a6d19aca7dc612084ad16f267dc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/test.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [f37b06ef89bf8f29529aeaf1d1a0e690bb90d786, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/specialForms.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [6e814d4bc0f9ba9f95c10981e7ff71838464c152, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/20201104153359-rw2q4l2.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [0a867065d75cfe91c0cfefa36706d693c0520304, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-nyj5skv.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [e436a3e2fecdb5f75c159d8b33122ebea848affc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/egg.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [42b17af786bfad553e9de83346f1b0699fddad99, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/interface.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [6b8bfb0e617ff2c88e8a4e852baeed9ea916f00e, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/interface.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [29469af5574ffdedb841b4b5099b5494923fa90b, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-xkdstl8.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [1eee1e042837cd3d22b6f175cd0ce375290c71f7, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20201104153359-8o50xst.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [cb2d4d445d44bd3af6c3de434f0de9538c1c23b7, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-6dlzvfx.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [8f229f33cd134d22feffc81d77f941e67b2acb0d, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-zqr64qz.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [26045d41653afa9179ae42bc4754fd49a12969e6, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-zj5gqvy.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [2497814a4bdf6b20f8e5cff2a9fb0c52d9926625, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p.sy, 2023-09-05 11:33:28]
I 2024/01/17 13:59:00 diff.go:42: upsert [87ef5ff964685f6be394b75d68de35e0a4ad206d, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-ut8ga52.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [18bf28c25544c458c2c12ed2a2431a16492f17a4, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20201104153359-gqh773e.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [8a1978b7183dc95c056a077b18b2608fab891787, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/机器人.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 diff.go:42: upsert [863aeb44dd7ba0310d3f2b23f7a734a2999fcafc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-gj1v86t.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 diff.go:42: upsert [13cb0940adcc538b0ca5fa8d36637003a5e494dc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/egg.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [1d6796b284666ef68bfc422d0b1dc2abdd2fc43e, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/specialForms.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [fed6d3487bdb30b6514a9ebcb4df2ecf6e657beb, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/机器人.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [5585d6fe99969b15e70b41c7f9a63b81cfa16fc1, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-6bs7c2t.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [6350773e82dd220d490bbbfcbbb4da109db426b0, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/test.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [690b831b45190a614c2c039604f49193d6206583, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-9fw3wmp.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [063c8c99f93993ca1e669728865b772516993600, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20201104153359-brkto0f.sy, 2023-09-05 11:33:28]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [5c687ad96a1ba1605125c4d7eb6cce2032d18fc5, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1.sy, 2023-09-05 11:33:28]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [fa8cba8e6a3090c4998861dddfbb52bb4b83c2b3, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-n2mjpeu.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [dd61c7adeac262a59621de19e719f33d4afbe350, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb.sy, 2023-09-05 11:33:29]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [4e0796f37be18946ac9cfce2adf232d26c5f5f28, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/tsconfig.json, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [ec07631b5dfa4a6d19aca7dc612084ad16f267dc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/test.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [f37b06ef89bf8f29529aeaf1d1a0e690bb90d786, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/specialForms.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [6e814d4bc0f9ba9f95c10981e7ff71838464c152, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/20201104153359-rw2q4l2.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [0a867065d75cfe91c0cfefa36706d693c0520304, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-nyj5skv.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [e436a3e2fecdb5f75c159d8b33122ebea848affc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/egg.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [42b17af786bfad553e9de83346f1b0699fddad99, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/interface.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [6b8bfb0e617ff2c88e8a4e852baeed9ea916f00e, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/interface.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [29469af5574ffdedb841b4b5099b5494923fa90b, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-xkdstl8.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [1eee1e042837cd3d22b6f175cd0ce375290c71f7, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20201104153359-8o50xst.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [cb2d4d445d44bd3af6c3de434f0de9538c1c23b7, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-6dlzvfx.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [8f229f33cd134d22feffc81d77f941e67b2acb0d, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-zqr64qz.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [26045d41653afa9179ae42bc4754fd49a12969e6, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-zj5gqvy.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [2497814a4bdf6b20f8e5cff2a9fb0c52d9926625, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p.sy, 2023-09-05 11:33:28]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [87ef5ff964685f6be394b75d68de35e0a4ad206d, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-ut8ga52.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [18bf28c25544c458c2c12ed2a2431a16492f17a4, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20201104153359-gqh773e.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [8a1978b7183dc95c056a077b18b2608fab891787, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/机器人.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [863aeb44dd7ba0310d3f2b23f7a734a2999fcafc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-gj1v86t.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:240: cloud upsert [13cb0940adcc538b0ca5fa8d36637003a5e494dc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/egg.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:246: local upsert [fb68728923fa06088ad844351fdd30249f2eb193, /storage/av/relations.msgpack, 2024-01-17 13:58:40]
I 2024/01/17 13:59:00 sync.go:249: local remove [863aeb44dd7ba0310d3f2b23f7a734a2999fcafc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-gj1v86t.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [87ef5ff964685f6be394b75d68de35e0a4ad206d, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-ut8ga52.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [8f229f33cd134d22feffc81d77f941e67b2acb0d, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-zqr64qz.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [2497814a4bdf6b20f8e5cff2a9fb0c52d9926625, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p.sy, 2023-09-05 11:33:28]
I 2024/01/17 13:59:00 sync.go:249: local remove [690b831b45190a614c2c039604f49193d6206583, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-9fw3wmp.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [063c8c99f93993ca1e669728865b772516993600, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20201104153359-brkto0f.sy, 2023-09-05 11:33:28]
I 2024/01/17 13:59:00 sync.go:249: local remove [e436a3e2fecdb5f75c159d8b33122ebea848affc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/egg.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [6350773e82dd220d490bbbfcbbb4da109db426b0, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/test.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [6b8bfb0e617ff2c88e8a4e852baeed9ea916f00e, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/interface.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [ec07631b5dfa4a6d19aca7dc612084ad16f267dc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/test.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [1d6796b284666ef68bfc422d0b1dc2abdd2fc43e, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/specialForms.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [fa8cba8e6a3090c4998861dddfbb52bb4b83c2b3, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-n2mjpeu.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [dd61c7adeac262a59621de19e719f33d4afbe350, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb.sy, 2023-09-05 11:33:29]
I 2024/01/17 13:59:00 sync.go:249: local remove [18bf28c25544c458c2c12ed2a2431a16492f17a4, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20201104153359-gqh773e.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [26045d41653afa9179ae42bc4754fd49a12969e6, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-zj5gqvy.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [cb2d4d445d44bd3af6c3de434f0de9538c1c23b7, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-6dlzvfx.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [1eee1e042837cd3d22b6f175cd0ce375290c71f7, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20201104153359-8o50xst.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [fed6d3487bdb30b6514a9ebcb4df2ecf6e657beb, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/机器人.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [29469af5574ffdedb841b4b5099b5494923fa90b, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-xkdstl8.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [13cb0940adcc538b0ca5fa8d36637003a5e494dc, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/egg.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [5c687ad96a1ba1605125c4d7eb6cce2032d18fc5, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1.sy, 2023-09-05 11:33:28]
I 2024/01/17 13:59:00 sync.go:249: local remove [8a1978b7183dc95c056a077b18b2608fab891787, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/机器人.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [f37b06ef89bf8f29529aeaf1d1a0e690bb90d786, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/specialForms.ts, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [5585d6fe99969b15e70b41c7f9a63b81cfa16fc1, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-6bs7c2t.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [4e0796f37be18946ac9cfce2adf232d26c5f5f28, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/tsconfig.json, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 sync.go:249: local remove [6e814d4bc0f9ba9f95c10981e7ff71838464c152, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/20201104153359-rw2q4l2.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [0a867065d75cfe91c0cfefa36706d693c0520304, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-lffq5xb/20201104153359-nyj5skv.sy, 2023-09-05 11:51:39]
I 2024/01/17 13:59:00 sync.go:249: local remove [42b17af786bfad553e9de83346f1b0699fddad99, /20210816161940-zo21go1/20210816161946-q6rdjhv/20210816161946-1dvrc2d/20210816161947-chzxpl1/20210816161947-ulf5i9p/interface.js, 2020-11-04 15:33:58]
I 2024/01/17 13:59:00 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/refs/latest]
I 2024/01/17 13:59:00 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/indexes-v2.json]
I 2024/01/17 13:59:00 siyuan.go:112: uploaded object [siyuan/1587804457692/repo/main/check/indexes/42ce6279a67bf7bb0c195876c62d0afec7dbdd12]
I 2024/01/17 13:59:00 siyuan.go:112: uploaded object [siyuan/1587804457692/repo/main/indexes/da2a2985a6f61222c38a95528aacb42692a9a15d]
I 2024/01/17 13:59:00 sync.go:1168: uploaded index [device=cpaherhj4vz6/android, id=da2a2985a6f61222c38a95528aacb42692a9a15d, files=1768, size=753 MB, created=2024-01-17 13:59:00]
I 2024/01/17 13:59:01 siyuan.go:112: uploaded object [siyuan/1587804457692/repo/main/indexes-v2.json]
I 2024/01/17 13:59:01 siyuan.go:112: uploaded object [siyuan/1587804457692/repo/main/refs/latest]
I 2024/01/17 13:59:01 siyuan.go:138: downloaded object [siyuan/1587804457692/repo/main/refs/latest]
I 2024/01/17 13:59:01 sync.go:1378: updated latest sync [device=cpaherhj4vz6/android, id=da2a2985a6f61222c38a95528aacb42692a9a15d, files=1768, size=753 MB, created=2024-01-17 13:59:00]
I 2024/01/17 13:59:01 siyuan.go:173: removed object [siyuan/1587804457692/repo/main/lock-sync]
I 2024/01/17 13:59:01 repository.go:1316: synced data repo [device=cpaherhj4vz6, kernel=38ej44b, provider=0, mode=a/true, ufc=4, dfc=3, ucc=0, dcc=0, ub=119 kB, db=120 kB] in [1.67s], merge result [conflicts=0, upserts=0, removes=0]

这是非常典型的一次丢失日志
应用一启动就得到了 walked data [files=1768] ;got local latest [device=cpaherhj4vz6/android, id=80534ab19de91b7ee8b959bd571d94f343d918de, files=1768,
然后 got latest sync [device=cpaherhj4vz6/android, id=724269938d83a502264a63a2040a250101d1d190, files=1796,
对比之后就开始 diff.go:42: upsert 更新本地记录和 sync.go:240: cloud upsert 更新云端
紧接着就开始 sync.go:249: local remove 删除本地文件。
我还是之前的看法,本地文件系统难以 debug 但 local remove 了快照 80534ab19de91b7ee8b959bd571d94f343d918de 中已经不存在的文件,这是可以进行纠错的。

@2234839
Copy link
Member

2234839 commented Jan 17, 2024

图片

这两个快照都是安卓生成的,他根据自己生成的快照删除自己的文件,在不是回滚的情况下这是有问题的。

@2234839
Copy link
Member

2234839 commented Jan 17, 2024

要么就是遍历的实现有问题,要么就是文件系统有问题

@2234839
Copy link
Member

2234839 commented Jan 17, 2024

你使用的是 git 手动 push 吗?

没有,那是软件自身的日志 @88250

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

你使用的是 git 手动 push 吗?

没有,那是软件自身的日志 @88250

我回复的是另一个人……

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

我还是之前的看法,本地文件系统难以 debug 但 local remove 了快照 80534ab19de91b7ee8b959bd571d94f343d918de 中已经不存在的文件,这是可以进行纠错的。

判断不了的,文件可能存在外部改动,这也是遍历文件系统这个方案存在的意义。

@2234839
Copy link
Member

2234839 commented Jan 17, 2024

但安卓12之后外部改动真的很难,我认为可以忽略该事件

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

我觉个例子,比如有的用户要修改一个 Word 资源文件,那么肯定只能是外部改动,改动完以后遍历文件系统打出最新快照,然后和上个同步点的快照以及云端快照对比得到差异,最后仅同步差异部分。

这是变动的情况,同时也存在外部删除的情况,比如直接在文件系统上删除不需要的资源文件,所以仅从同一个设备的两个快照上是无法判断到底是不是用户意图的删除。

就算是 Android 12 以后无法操作私有数据,也还存在 删除未引用资源文件 的这种手动操作,所以仅用两个快照来比较是无法确保的。

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

要么就是遍历的实现有问题,要么就是文件系统有问题

遍历的实现我认为没有问题,如果有问题的话应该容易稳定重现,具体代码见 https://github.com/siyuan-note/dejavu/blob/36bb80f2521a2e90ab52a82d1726fa376e049b89/repo.go#L585

综合目前收集到的反馈看,基本可以确定是小米澎湃的文件系统有比较特殊的情况导致遍历不全。

@2234839
Copy link
Member

2234839 commented Jan 17, 2024

用户本地删除了文件,那么快照同步还会尝试在本地删除该文件吗?
即便进行了该行为,但本地该文件是不存的,这里可以知道事用户手动操作的。

现在是用户没有删除文件,但快照认为用户删除了,然后同步的时候再开始真正的删除了本地文件。

这种情况是可以检测的,和用户自行操作不影响

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

用户本地删除了文件,那么快照同步还会尝试在本地删除该文件吗?

不会的,遍历 data 文件夹后文件不存在,那么快照里面就没有这个文件了,日志里面打印的 local remove ... 指的就是快照和上个同步点快照对比得出的删除部分,而不是这个时候去删除文件,具体代码见 https://github.com/siyuan-note/dejavu/blob/36bb80f2521a2e90ab52a82d1726fa376e049b89/sync.go#L249

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

所以我认为在应用层的算法中来解决(或者说某种补偿、兜底机制)这个问题不大可能,而且非常容易引入新的问题。

@2234839
Copy link
Member

2234839 commented Jan 17, 2024

所以我认为在应用层的算法中来解决(或者说某种补偿、兜底机制)这个问题不大可能,而且非常容易引入新的问题。

先禁止小米澎湃开启同步功能吧,免得丢失用户数据。

@2234839
Copy link
Member

2234839 commented Jan 17, 2024

用户本地删除了文件,那么快照同步还会尝试在本地删除该文件吗?

不会的,遍历 data 文件夹后文件不存在,那么快照里面就没有这个文件了,日志里面打印的 local remove ... 指的就是快照和上个同步点快照对比得出的删除部分,而不是这个时候去删除文件,具体代码见 https://github.com/siyuan-note/dejavu/blob/36bb80f2521a2e90ab52a82d1726fa376e049b89/sync.go#L249

那是在什么时候删除的,我一直以为 local remove 表示思源正在删除文件。

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

所以我认为在应用层的算法中来解决(或者说某种补偿、兜底机制)这个问题不大可能,而且非常容易引入新的问题。

先禁止小米澎湃开启同步功能吧,免得丢失用户数据。

这个也不太好,还不能完全确认是不是在所有版本上必现。

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

用户本地删除了文件,那么快照同步还会尝试在本地删除该文件吗?

不会的,遍历 data 文件夹后文件不存在,那么快照里面就没有这个文件了,日志里面打印的 local remove ... 指的就是快照和上个同步点快照对比得出的删除部分,而不是这个时候去删除文件,具体代码见 https://github.com/siyuan-note/dejavu/blob/36bb80f2521a2e90ab52a82d1726fa376e049b89/sync.go#L249

那是在什么时候删除的,我一直以为 local remove 表示思源正在删除文件。

遍历的时候文件少了快照里面就少了,实际上 data 下面文件还在,所以后面遍历可能又正确了。

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

这样,我先升级一下 gomobile 以便排除 sdk 的影响(虽然可能性有点低,文件系统相关的实现比较底层,不大可能这么多年还有 bug),晚点我编译个 apk 给你安装看看。

@2234839
Copy link
Member

2234839 commented Jan 17, 2024

所以文件是被哪个步骤删掉的,看有没有办法从逻辑上绕过这个问题

@2234839
Copy link
Member

2234839 commented Jan 17, 2024

这样,我先升级一下 gomobile 以便排除 sdk 的影响(虽然可能性有点低,文件系统相关的实现比较底层,不大可能这么多年还有 bug),晚点我编译个 apk 给你安装看看。

好的

88250 added a commit to siyuan-note/dejavu that referenced this issue Jan 17, 2024
@Wetoria
Copy link

Wetoria commented Jan 17, 2024

所以文件是被哪个步骤删掉的,看有没有办法从逻辑上绕过这个问题

我看D大说的,应该是代码里遍历文件的时候,因为澎湃os的问题,导致有文件没读到,所以这个时候的快照里,这些没读到的文件,就已经是删除了的。

实际上文件并没有真的没有删除,只是这一次获取的过程中,“缺失”了这些文件。下一次也许又能获取到了。

@88250 另外想问一下,D大,在整个对比过程中,内核会有“删除文件”这样的清理操作吗?

@88250
Copy link
Member Author

88250 commented Jan 17, 2024

在整个对比过程中,内核会有“删除文件”这样的清理操作吗?

没有。

@Wetoria
Copy link

Wetoria commented Jan 17, 2024

在整个对比过程中,内核会有“删除文件”这样的清理操作吗?

没有。

没有删除的操作的话,我不是很理解为什么会出现访问不了资源。(纯疑惑)

88250 added a commit to siyuan-note/dejavu that referenced this issue Jan 17, 2024
@2234839
Copy link
Member

2234839 commented Jan 19, 2024

@88250

再次出现了,从日志上看短时间内的两次遍历结果是不一致的,其中有一个比较完整,但相比较另一个缺失更多的遍历也是缺少了一条,日志我待会发你邮箱
图片

@88250
Copy link
Member Author

88250 commented Jan 19, 2024

确实,日志上这两次相邻的同步遍历文件确实少了一些,而且似乎没有任何规律可言,我认为可以确定是文件系统相关的问题了。

这几天我试下用 Java 写个文件遍历看看结果是否稳定,做好包以后我通过邮件发送给你,谢谢。

88250 added a commit to siyuan-note/dejavu that referenced this issue Jan 21, 2024
88250 added a commit to siyuan-note/siyuan-android that referenced this issue Jan 21, 2024
88250 added a commit to siyuan-note/filelock that referenced this issue Jan 21, 2024
88250 added a commit to siyuan-note/dejavu that referenced this issue Jan 21, 2024
EightDoor added a commit to EightDoor/siyuan that referenced this issue Jan 24, 2024
* commit '0f91f51bb0f8fc7f71e3c038ae45a3d69d3e95e1': (109 commits)
  🐛 fix siyuan-note#10238
  🎨 Update linux/macOS packing font
  🎨 Update npm mirror
  🔖 Release v2.12.4
  🚨
  🎨 菜单右键复制无效
  🎨 fix siyuan-note#10230
  🎨 fix siyuan-note#10230
  📝 Update changelogs
  🐛 remove invalid requests during boot (siyuan-note#10227)
  📝 Update changelogs
  🎨 Improve search and replace spaces siyuan-note#10231
  📝 Update changelogs
  🎨 Improve data sync to prevent an old snapshot to overwrite the new one siyuan-note#10229
  🎨 fix siyuan-note#10225
  🎨 Update README
  📝
  ♻️
  🐛 Data sync may cause data loss on Android 14 siyuan-note#10205
  🐛 Data sync may cause data loss on Android 14 siyuan-note#10205
  ...

# Conflicts:
#	README.md
#	app/src/config/account.ts
88250 added a commit to siyuan-note/filelock that referenced this issue Jan 28, 2024
88250 added a commit to siyuan-note/filelock that referenced this issue Jan 28, 2024
88250 added a commit to siyuan-note/filelock that referenced this issue Jan 28, 2024
88250 added a commit to siyuan-note/filelock that referenced this issue Jan 28, 2024
88250 added a commit to siyuan-note/filelock that referenced this issue Jan 28, 2024
88250 added a commit to siyuan-note/filelock that referenced this issue Jan 28, 2024
88250 added a commit to siyuan-note/siyuan-android that referenced this issue Jan 28, 2024
@hihaojie
Copy link

我昨天(1月29日)的同步也碰到这个问题了,小米手机,系统版本为HyperOS 1.0.13.0,Android版本为14,思源已经升级至2.12.5版
image

这是我的日志文件:
system-log.zip

@88250
Copy link
Member Author

88250 commented Jan 30, 2024

@hihaojie 从日志上看是因为 Android 端启动的 [::1] HTTP 服务(Java 实现的遍历)被拒绝连接了,导致回退到 golang 实现的遍历。

但是我看到这个接口不是每次都被拒绝,有的时候又可以请求到,请检查是不是使用了代理类软件没有排除 IPv6 环回地址 [::1],或者其他影响网络的可能。

@hihaojie
Copy link

@hihaojie 从日志上看是因为 Android 端启动的 [::1] HTTP 服务(Java 实现的遍历)被拒绝连接了,导致回退到 golang 实现的遍历。

但是我看到这个接口不是每次都被拒绝,有的时候又可以请求到,请检查是不是使用了代理类软件没有排除 IPv6 环回地址 [::1],或者其他影响网络的可能。

我有在使用代理软件Clash,但是我确定手机在昨天22点之前未使用过Clash。
关于IPv6的回环地址我知之甚少,不知道该如何排查,抱歉

@88250
Copy link
Member Author

88250 commented Jan 30, 2024

暂时没有其他方案了,目前只能走 HTTP 服务,建议在代理软件上排除 [::1] 这个地址后再试试。

@hihaojie
Copy link

hihaojie commented Feb 4, 2024

您好,我刚刚又碰到了此问题,这次我十分确定代理是没有开启的。因为上次的同步问题,手机端我现在只进行手动同步,每次同步后对比数据快照,如下是本次同步丢失文件的截图:
image

如下是本次的日志:
system-log-1.zip

思源笔记版本v2.12.6,Android14,安全更新:2024-02-01,HyperOS 1.0.14.0

@88250
Copy link
Member Author

88250 commented Feb 4, 2024

从日志上看,刚好有 6 个文档因为文件系统上不存在而无法加载:

E 2024/02/04 13:50:01 tree.go:43: load tree [/20240122111405-10aj662/20240125103532-ry98hsb.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240125103532-ry98hsb.sy: no such file or directory
E 2024/02/04 13:50:01 index_fix.go:200: load tree [/20240122111405-10aj662/20240125103532-ry98hsb.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240125103532-ry98hsb.sy: no such file or directory
E 2024/02/04 13:50:01 tree.go:43: load tree [/20240122111405-10aj662/20240124162215-wqzd3dd.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240124162215-wqzd3dd.sy: no such file or directory
E 2024/02/04 13:50:01 index_fix.go:200: load tree [/20240122111405-10aj662/20240124162215-wqzd3dd.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240124162215-wqzd3dd.sy: no such file or directory
E 2024/02/04 13:50:01 tree.go:43: load tree [/20240122111405-10aj662/20240124170701-tfqinhz.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240124170701-tfqinhz.sy: no such file or directory
E 2024/02/04 13:50:01 index_fix.go:200: load tree [/20240122111405-10aj662/20240124170701-tfqinhz.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240124170701-tfqinhz.sy: no such file or directory
E 2024/02/04 13:50:01 tree.go:43: load tree [/20240122111405-10aj662/20240124124135-fzrn37b.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240124124135-fzrn37b.sy: no such file or directory
E 2024/02/04 13:50:01 index_fix.go:200: load tree [/20240122111405-10aj662/20240124124135-fzrn37b.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240124124135-fzrn37b.sy: no such file or directory
E 2024/02/04 13:50:01 tree.go:43: load tree [/20240122111405-10aj662/20240124124256-ovahxw1.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240124124256-ovahxw1.sy: no such file or directory
E 2024/02/04 13:50:01 index_fix.go:200: load tree [/20240122111405-10aj662/20240124124256-ovahxw1.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240124124256-ovahxw1.sy: no such file or directory
E 2024/02/04 13:50:01 tree.go:43: load tree [/20240122111405-10aj662/20240128201107-qo3zvl9.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240128201107-qo3zvl9.sy: no such file or directory
E 2024/02/04 13:50:01 index_fix.go:200: load tree [/20240122111405-10aj662/20240128201107-qo3zvl9.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20240116220950-3vr2sq2/20240122111405-10aj662/20240128201107-qo3zvl9.sy: no such file or directory

是不是使用过手机清理功能或者什么清理 app 导致文件被删除了?

@hihaojie
Copy link

hihaojie commented Feb 4, 2024

确定没有,我没有使用手机清理功能的习惯,也没有设置后台自动清理。
根据我的使用记录,我在12:30开始午休,直到13:40左右手机一直处于锁定状态,14:40左右,亮屏解锁手机。13:40~13:50这个时间段我在刷B站,没有进行过清理(后台也没清过)

@88250
Copy link
Member Author

88250 commented Feb 4, 2024

@hihaojie 我们先确认下是不是这几个文档丢失:用快照回滚,然后在搜索框中搜索 20240125103532-ry98hsb,看看是不是上面快照对比中删除的文档之一。如果是的话,那就不是遍历的问题了。

@hihaojie
Copy link

hihaojie commented Feb 4, 2024

如下是我回滚、搜索后的结果:
image

image

可以看到是删除的文档之一(曲奇切割模式)

@88250
Copy link
Member Author

88250 commented Feb 4, 2024

那可以确定不是遍历不到的问题了,而是某种情况下文件系统会“吞”文件(如果是用户操作,日志中会打印 removed doc [xxx])。

这个问题目前是第一次发现,无法定位原因,需要时间继续观察,感谢反馈。

@HibernalGlow
Copy link

您好,我刚刚又碰到了此问题,这次我十分确定代理是没有开启的。因为上次的同步问题,手机端我现在只进行手动同步,每次同步后对比数据快照,如下是本次同步丢失文件的截图: image

如下是本次的日志: system-log-1.zip

思源笔记版本v2.12.6,Android14,安全更新:2024-02-01,HyperOS 1.0.14.0

我澎湃 os遇到了同样的丢文件问题
system-log(1).zip

@88250
Copy link
Member Author

88250 commented Feb 6, 2024

@AvoidantPerDis 麻烦发一下快照 ID 或者文件路径。

@HibernalGlow
Copy link

HibernalGlow commented Feb 6, 2024

image
我在晚上关闭电脑后,使用手机操作,不存在交叉操作丢失的情况,第二天白天用电脑同步发现丢失文件

@88250
Copy link
Member Author

88250 commented Feb 6, 2024

和上面 @hihaojie 遇到的可能是同一个问题:

E 2024/02/05 22:38:55 tree.go:43: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240115232035-j50xnfv.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240115232035-j50xnfv.sy: no such file or directory
E 2024/02/05 22:38:55 index_fix.go:200: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240115232035-j50xnfv.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240115232035-j50xnfv.sy: no such file or directory
E 2024/02/05 22:38:55 tree.go:43: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240203170129-47cb9ad.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240203170129-47cb9ad.sy: no such file or directory
E 2024/02/05 22:38:55 index_fix.go:200: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240203170129-47cb9ad.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240203170129-47cb9ad.sy: no such file or directory
E 2024/02/05 22:38:55 tree.go:43: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240203170029-0s62caz.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240203170029-0s62caz.sy: no such file or directory
E 2024/02/05 22:38:55 index_fix.go:200: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240203170029-0s62caz.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj/20240203170029-0s62caz.sy: no such file or directory
E 2024/02/05 22:38:55 tree.go:43: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj.sy: no such file or directory
E 2024/02/05 22:38:55 index_fix.go:200: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240115232213-m6syptj.sy: no such file or directory
E 2024/02/05 22:38:55 tree.go:43: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240116153717-zwobx8i.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240116153717-zwobx8i.sy: no such file or directory
E 2024/02/05 22:38:55 index_fix.go:200: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240116153717-zwobx8i.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20240116153717-zwobx8i.sy: no such file or directory
E 2024/02/05 22:38:55 tree.go:43: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20231204200805-smn68tm.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20231204200805-smn68tm.sy: no such file or directory
E 2024/02/05 22:38:55 index_fix.go:200: load tree [/20231031180945-v5mmsn5/20240115232207-2edxzcp/20231204200805-smn68tm.sy] failed: open /storage/emulated/0/Android/data/org.b3log.siyuan/files/siyuan/data/20231029224000-8p9ggy6/20231031180945-v5mmsn5/20240115232207-2edxzcp/20231204200805-smn68tm.sy: no such file or directory

我们单独开一个 issue 跟进 #10323

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

7 participants