Artalk icon indicating copy to clipboard operation
Artalk copied to clipboard

[Bug] 产生了 key 相同的 page

Open krau opened this issue 1 year ago • 6 comments

相关 #971

从 2.9.0 升级后出现, 启用了 redis 缓存.

image

升级后启动时日志:

 ________  ________  _________  ________  ___       ___  __
|\   __  \|\   __  \|\___   ___\\   __  \|\  \     |\  \|\  \
\ \  \|\  \ \  \|\  \|___ \  \_\ \  \|\  \ \  \    \ \  \/  /|_
 \ \   __  \ \   _  _\   \ \  \ \ \   __  \ \  \    \ \   ___  \
  \ \  \ \  \ \  \\  \|   \ \  \ \ \  \ \  \ \  \____\ \  \\ \  \
   \ \__\ \__\ \__\\ _\    \ \__\ \ \__\ \__\ \_______\ \__\\ \__\
    \|__|\|__|\|__|\|__|    \|__|  \|__|\|__|\|_______|\|__| \|__|

Artalk (v2.9.1)

 -> A Self-hosted Comment System.
 -> https://artalk.js.org

-------------------------------


 ┌───────────────────────────────────────────────────┐ 
 │                   Fiber v2.52.5                   │ 
 │              http://127.0.0.1:23366               │ 
 │                                                   │ 
 │ Handlers ........... 108  Processes ........... 1 │ 
 │ Prefork ....... Disabled  PID ............ 850974 │ 
 └───────────────────────────────────────────────────┘ 

2024/09/21 08:56:55.501 ERROR [common/check.go:15] 需要管理员权限 {"id": "b4exxxxxxxxxxxxxd0214", "path": "/api/v2/sites", "method": "GET", "ip": "xxxxxxx", "remote_addr": "127.0.0.1:59806", "host": "host", "referer": "", "user_agent": "UA", "status": 403}
2024/09/21 08:56:55.503 ERROR [HTTP] 08:56:55 | 403 |    3.161486ms | xxxxx | GET | /api/v2/sites | - | b4exxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2024/09/21 08:58:06.440 ERROR [dao/service.go:110] status code error: 404 '404 Not Found' 'https://krau.top/posts/(一个已删除的文章)'
2024/09/21 08:58:06.767 ERROR [dao/service.go:110] status code error: 404 '404 Not Found' 'https://krau.top/posts/(一个已删除的文章)'

似乎没有相关日志.


有什么临时修复办法吗? 能否直接手动删除多余的数据?

krau avatar Sep 22 '24 12:09 krau

临修复的办法是添加环境变量 ATK_DB_MIGRATOR_FUNC_MERGE_PAGES=1,然后重启 Docker 容器会自动合并页面,然后删除环境变量。

注:在操作之前,记得备份原始数据,防止数据丢失。

qwqcode avatar Sep 22 '24 12:09 qwqcode

可能是缓存的问题,关闭和清理缓存试试还会不会发生此现象

qwqcode avatar Sep 22 '24 12:09 qwqcode

临修复的办法是添加环境变量 ATK_DB_MIGRATOR_FUNC_MERGE_PAGES=1,然后重启 Docker 容器会自动合并页面,然后删除环境变量。

注:在操作之前,记得备份原始数据,防止数据丢失。

不能正常合并

2024/09/22 23:08:29.455 FATAL [dao/migrate.go:145] Failed to insert merged pages. UNIQUE constraint failed: pages.id

krau avatar Sep 22 '24 15:09 krau

试试降级到 v2.8.7 版本,然后重复 ATK_DB_MIGRATOR_FUNC_MERGE_PAGES=1 操作。记得备份。

qwqcode avatar Sep 22 '24 15:09 qwqcode

试试降级到 v2.8.7 版本,然后重复 ATK_DB_MIGRATOR_FUNC_MERGE_PAGES=1 操作。记得备份。

成功了, thx

krau avatar Sep 22 '24 15:09 krau

已找到问题:https://github.com/ArtalkJS/Artalk/issues/971#issuecomment-2398807688

Doradx avatar Oct 08 '24 04:10 Doradx