Giter Site home page Giter Site logo

Comments (8)

imaegoo avatar imaegoo commented on July 19, 2024

请说明用了何种部署方式(腾讯云 / Vercel / Railway / Zeabur / Netlify / Hugging Face / 私有部署)

from twikoo.

dongjunke avatar dongjunke commented on July 19, 2024

通过docker部署

from twikoo.

imaegoo avatar imaegoo commented on July 19, 2024

gif

通过docker部署,无法重现该问题,请提供录屏、容器日志

from twikoo.

imaegoo avatar imaegoo commented on July 19, 2024

因日志包含敏感内容,已删除。

从日志中提取关键信息如下

4/17/2024, 7:09:36 AM Twikoo: 错误信息: Error: Trying to update a document not in collection.
    at Collection.update (/app/node_modules/lokijs/src/lokijs.js:6055:17)
    at Resultset.update (/app/node_modules/lokijs/src/lokijs.js:3881:27)
    at Collection.findAndUpdate (/app/node_modules/lokijs/src/lokijs.js:5821:41)
    at commentSetForAdmin (/app/node_modules/tkserver/index.js:421:8)
    at module.exports (/app/node_modules/tkserver/index.js:93:21)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Server.\u003canonymous\u003e (/app/node_modules/tkserver/server.js:31:10)

from twikoo.

imaegoo avatar imaegoo commented on July 19, 2024

错误是数据库执行更新操作时,找不到要更新的这行数据。是否曾手动编辑过db.json.x文件?

from twikoo.

dongjunke avatar dongjunke commented on July 19, 2024

db.json.0 可能手动编辑过,具体记不太清了。升级版本后data文件夹里的内容整个替换过,原因是升级后发现没有评论内容,到宝塔的「容器【twikoo】 详情」的「数据的储存卷」查看了下路径,是/root/data,之前数据文件在/root/twikoo/data,就整个复制到/root/data,评论在前端显示了,但就出现了置顶自动生成两条评论。目前/root/data和/root/twikoo/data都有数据,是不是跟这个有关?

追加:好像不是这个原因,我把/root/twikoo/data内容清空,重启容器,还是出现置顶重复评论。

from twikoo.

dongjunke avatar dongjunke commented on July 19, 2024

我已经把data整个文件夹打包发您邮箱了,请查收。

from twikoo.

imaegoo avatar imaegoo commented on July 19, 2024

已检查data文件,您可能手动编辑过data文件,手动编辑可能会导致数据不完整,请按以下步骤修复数据库

  1. 打开Twikoo管理面板,点击导出-导出评论
  2. 停止twikoo的docker容器
  3. 备份data目录以防意外
  4. 删除data目录下的所有文件(db.json、db.json.0、db.json.1、db.json.2)
  5. 启动twikoo的docker容器
  6. 打开Twikoo管理面板,重新设置密码,然后导入,源系统选择twikoo,导入第1步时导出的twikoo-comment.json文件

至此数据库修复完成,您可以再次测试置顶评论功能

from twikoo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.