l0o0 / tara

A Zotero add-on for backup and restore preferences, add-ons, translators, styles, and locate between two machines
GNU Affero General Public License v3.0
294 stars 11 forks source link

无法解压备份文件以及无法安装插件 #28

Open ZhenyuXiao opened 5 months ago

ZhenyuXiao commented 5 months ago

请建议按照下面的格式汇报BUG

Describe the bug 请详细介绍BUG信息

电脑A备份了数据,电脑B恢复备份失败,无法解压备份文件以及无法安装插件

To Reproduce BUG 如何产生的

Bug appears in (BUG 什么时候产生)

System Information 系统信息

Screenshots 可提供截图 image

调试日志 (3)(+0030370): Starting full-text content processor

(4)(+0009064): SELECT COALESCE(IA.parentItemID, itemID) AS itemID FROM items LEFT JOIN itemAnnotations IA USING (itemID) WHERE (itemID NOT IN (SELECT itemID FROM deletedItems UNION SELECT itemID FROM itemNotes WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems) UNION SELECT itemID FROM itemAttachments WHERE parentItemID IS NOT NULL AND parentItemID IN (SELECT itemID FROM deletedItems)UNION SELECT itemID FROM itemAnnotations WHERE parentItemID IN (SELECT itemID FROM deletedItems)UNION SELECT itemID FROM itemAnnotations WHERE parentItemID IN (SELECT itemID FROM itemAttachments WHERE parentItemID IN (SELECT itemID FROM deletedItems)))) AND itemID IN (SELECT itemID FROM itemData WHERE (fieldID IN (?,?,?,?) AND valueID IN (SELECT valueID FROM itemDataValues WHERE value=?))) [1, 46, 66, 106, 'Tara_Backup']

(3)(+0000025): [ "0": "Z7_2024-04-10-00'48'58_Tara.zip" "1": "Z7_2024-04-09-01'16'55_Tara.zip" "2": "Z6_2024-04-10-00'47'15_Tara.zip" ]

(3)(+0000000): ** Tara open select window

(3)(+0003645): ** Tara Tara select promise

(3)(+0000001): Z6_2024-04-10-00'47'15_Tara.zip

(3)(+0000018): ** Tara open window

(3)(+0000026): ** Tara wait

(3)(+0000068): ** Tara wait

(3)(+0000001): C:\Users\Shadow\Zotero\tmp\Backup

(3)(+0000164): NS_ERROR_FILE_NOT_FOUND Exception: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIZipReader.extract] unzipToTemporaryDir/<@chrome://tara/content/scripts/index.js:624:11 fulfilled@chrome://tara/content/scripts/index.js:10:16

(3)(+0000001): NS_ERROR_FILE_NOT_FOUND Exception: Component returned failure code: 0x80520012 (NS_ERROR_FILE_NOT_FOUND) [nsIFileInputStream.init] Zotero.File</this.getContents@chrome://zotero/content/xpcom/file.js:167:7 restoreFromFile/<@chrome://tara/content/scripts/index.js:707:17 rejected@chrome://tara/content/scripts/index.js:17:16

(3)(+0000272): Getting contents of C:\Users\Shadow\Zotero\tmp\Backup\backup.json

(3)(+0000005): Error: Win error 2 during operation open on file C:\Users\Shadow\Zotero\tmp\Backup\backup.json (系统找不到指定的文件。 ) (No stack trace) From previous event: restoreFromFile/<@chrome://tara/content/scripts/index.js:788:23 fulfilled@chrome://tara/content/scripts/index.js:10:16

(3)(+0017354): Getting contents of C:\Users\Shadow\AppData\Roaming\Zotero\Zotero\Profiles\z0ytm68d.default\treePrefs.json

(3)(+0000004): Writing column prefs of length 4331 to file C:\Users\Shadow\AppData\Roaming\Zotero\Zotero\Profiles\z0ytm68d.default\treePrefs.json

ZhenyuXiao commented 5 months ago

找到原因了 我的C:\Users\username\Zotero\styles路径下有一个hidden文件夹,该文件夹非空(也不是我手动创建的): image tara备份时的zip文件里的csl文件是这样的: image 所以问题就是,tara在备份时没有把\Zotero\styles目录下的hidden文件夹结构备份进去,而是在文件名中加入字符串“hidden”

暂时的解决方案是: 从备份的zip文件中删除带“hidden”的csl文件

ZhenyuXiao commented 5 months ago

暂时的解决方案是: 从备份的zip文件中删除带“hidden”的csl文件

这个方法的缺点就是不能备份hidden中csl文件,而且需要手动删除 Zotero7的tara插件没有这个问题,因为Zotero7版本插件会将目录结构也备份: image

@l0o0 不知道作者大大后续是否会为Zotero6的tara修复这个问题

dawnlh commented 1 month ago

Zotero 6.0.36, tara 0.0.6, 备份时hidden 文件夹正常生成了,但是恢复时还是出现了上面的问题。尝试把hidden文件夹删除或者把整个style文件夹删除仍然出现该问题

yztz commented 1 week ago

webdav同步的附件?有没有勾选按需下载? 如果勾选,要先双击备份文件,下载完成后再进行恢复。

l0o0 commented 3 days ago

好的,我测试一下