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

备份恢复后重启出现 DuplicateNameException 异常 #6672

Closed
KweilinFang opened this issue Sep 18, 2024 · 7 comments · Fixed by #6701
Closed

备份恢复后重启出现 DuplicateNameException 异常 #6672

KweilinFang opened this issue Sep 18, 2024 · 7 comments · Fixed by #6701
Labels
kind/improvement Categorizes issue or PR as related to a improvement.

Comments

@KweilinFang
Copy link

系统信息

在构建/registry/storage.halo.run/localthumbnails的索引时,出现了DuplicateNameException异常,提示值[69fec8f0441190ce14242bb7eb63936cc745631b5ffb227731333bc4c3d0dd81]在唯一索引[spec.thumbSignature]中已存在。
由于该异常,导致应用上下文初始化失败,应用启动失败。

使用的哪种方式运行?

Docker

发生了什么?

在构建/registry/storage.halo.run/localthumbnails的索引时,出现了DuplicateNameException异常,提示值[69fec8f0441190ce14242bb7eb63936cc745631b5ffb227731333bc4c3d0dd81]在唯一索引[spec.thumbSignature]中已存在。
由于该异常,导致应用上下文初始化失败,应用启动失败。

复现步骤

No response

相关日志输出

No response

附加信息

No response

@JohnNiang
Copy link
Member

/retitle 备份恢复后重启出现 DuplicateNameException 异常
/ping @halo-dev/sig-halo

@f2c-ci-robot f2c-ci-robot bot changed the title 使用halo专业版的备份后重装halo,恢复项目启动报错在构建/registry/storage.halo.run/localthumbnails的索引时,出现了DuplicateNameException异常 备份恢复后重启出现 DuplicateNameException 异常 Sep 18, 2024
@guqing
Copy link
Member

guqing commented Sep 20, 2024

我附件添加了有300多张图片的场景按照备份和恢复步骤尝试了几次但是没有复现,有复现步骤吗,理论上来说备份恢复的时候如果有重复是无法创建的

/triage needs-information

@f2c-ci-robot f2c-ci-robot bot added the triage/needs-information Indicates an issue needs more information in order to work on it. label Sep 20, 2024
@guqing
Copy link
Member

guqing commented Sep 25, 2024

/remove-triage needs-information
/kind improvement

经过排查发现备份恢复的时候执行

.thenMany(repository.saveAll(extensionStores))
时为了确保能够恢复成功跳过了索引验证,但是是启动时构建索引却发现数据冲突,这是数据处理步骤不一致造成的,恢复备份时建议先丢弃所有数据然后只以备份数据为准避免因为某些唯一字段重复造成恢复后无法启动

@KweilinFang 临时解决办法是先初始化一个新环境 -> 初始化之后直接登录 -> 直接点击到恢复界面进行恢复
(不要去浏览首页,浏览器首页可能会创建 logo 图片的缩略图造成数据冲突)

@f2c-ci-robot f2c-ci-robot bot added kind/improvement Categorizes issue or PR as related to a improvement. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Sep 25, 2024
@KweilinFang
Copy link
Author

[
1Panel-halo-MPtO-20240918092506.log
](url)

@KweilinFang
Copy link
Author

这个是恢复相关的日志内容

@guqing
Copy link
Member

guqing commented Sep 25, 2024

这个是恢复相关的日志内容

感谢回复,目前已经在修复了,你可以按照 #6672 (comment) 中所说的先将服务恢复 晚些时候我们会发布一个修复版本

@KweilinFang
Copy link
Author

不好意思,最近较忙,回复有点晚了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/improvement Categorizes issue or PR as related to a improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants