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

Database load failed on Node 18.6.0 #5022

Closed
5 tasks done
slanterns opened this issue Jul 26, 2022 · 12 comments
Closed
5 tasks done

Database load failed on Node 18.6.0 #5022

slanterns opened this issue Jul 26, 2022 · 12 comments

Comments

@slanterns
Copy link

slanterns commented Jul 26, 2022

Check List

Please check followings before submitting a new issue.

Expected behavior

Hexo reuses the database to check which files are modified.

Actual behavior

Each time regenerating, hexo will say Database load failed. Deleting database and the next time will do a full regenerate.

How to reproduce?

  • Use node 18.6.0
  • hexo g

Is the problem still there under "Safe mode"?

Yes.

Environment & Settings

Node.js & npm version(node -v && npm -v)

v18.6.0
8.15.0

Hexo and Plugin version(npm ls --depth 0)

Your package.json package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "6.2.0"
  },
  "dependencies": {
    "hexo": "^6.2.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-feed": "^3.0.0",
    "hexo-generator-index": "^2.0.0",
    "hexo-generator-seo-friendly-sitemap": "^0.2.1",
    "hexo-generator-tag": "^1.0.0",
    "hexo-renderer-ejs": "^2.0.0",
    "hexo-renderer-marked": "^5.0.0",
    "hexo-renderer-stylus": "^2.1.0",
    "hexo-server": "^3.0.0",
    "hexo-theme-landscape": "^0.0.3"
  }
}

Others

Debug mode log:

13:54:29.049 DEBUG Writing database to /var/www/hexo/db.json
13:54:29.059 DEBUG Hexo version: 6.2.0
13:54:29.060 DEBUG Working directory: /var/www/hexo/
13:54:29.179 DEBUG Config loaded: /var/www/hexo/_config.yml
13:54:29.181 INFO  Validating config
13:54:29.399 DEBUG Plugin loaded: hexo-generator-archive
13:54:29.399 DEBUG Plugin loaded: hexo-generator-category
13:54:29.399 DEBUG Plugin loaded: hexo-generator-feed
13:54:29.399 DEBUG Plugin loaded: hexo-generator-index
13:54:29.400 DEBUG Plugin loaded: hexo-generator-seo-friendly-sitemap
13:54:29.400 DEBUG Plugin loaded: hexo-generator-tag
13:54:29.400 DEBUG Plugin loaded: hexo-renderer-ejs
13:54:29.400 DEBUG Plugin loaded: hexo-renderer-marked
13:54:29.400 DEBUG Plugin loaded: hexo-renderer-stylus
13:54:29.400 DEBUG Plugin loaded: hexo-server
13:54:29.408 DEBUG Script loaded: themes/[redacted]
13:54:29.410 DEBUG Loading database.
13:54:29.883 ERROR Database load failed. Deleting database.
13:54:29.886 INFO  Start processing
13:54:30.070 DEBUG Processed: [redacted]
13:54:30.209 DEBUG Generator: [redacted]
13:54:30.375 INFO  Files loaded in 966 ms
13:54:30.416 DEBUG Rendering HTML post: [redacted]
13:54:33.598 INFO  0 files generated in 3.22 s

Also tested on Node 16.16.0 and cannot reproduce (so probably a node-related bug).

(Another problem: hexo will not save debug.log automatically in debug mode)

@stevenjoezhang
Copy link
Member

The JSONStream library required by Hexo warehouse has been archived: https:/dominictarr/JSONStream
The library is incompatible with Node 18.6.0 and we may need to find a replacement for this library
CC @hexojs/core

@renbaoshuo
Copy link
Member

I've opened a PR to use a fork of JSONStream which is supports newer Node.js version: hexojs/warehouse#132.

@renbaoshuo
Copy link
Member

cc @stevenjoezhang

@stevenjoezhang
Copy link
Member

Fixed in hexojs/warehouse#133

@yoshinorin
Copy link
Member

Pending hexojs/warehouse#135

@yoshinorin yoshinorin reopened this Jul 28, 2022
@stevenjoezhang stevenjoezhang changed the title Detabase load failed on Node 18.6.0 Database load failed on Node 18.6.0 Aug 3, 2022
@yoshinorin
Copy link
Member

@slanterns
Sorry so the late reply.
We released the warehouse 4.0.2.

Would you please do npm update hexo.
The warehouse that included hexo will be updated to 4.0.2.

Thank you :)

@slanterns
Copy link
Author

Tested on Node v18.7.0 and fix confirmed. Thanks.

@gufeng0
Copy link

gufeng0 commented Aug 16, 2022

@slanterns Sorry so the late reply. We released the warehouse 4.0.2.

Would you please do npm update hexo. The warehouse that included hexo will be updated to 4.0.2.

Thank you :)

Hi,I appeared the same problem.
$ hexo -v
INFO Validating config
INFO ==================================
███╗ ██╗███████╗██╗ ██╗████████╗
████╗ ██║██╔════╝╚██╗██╔╝╚══██╔══╝
██╔██╗ ██║█████╗ ╚███╔╝ ██║
██║╚██╗██║██╔══╝ ██╔██╗ ██║
██║ ╚████║███████╗██╔╝ ██╗ ██║
╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ ╚═╝

NexT version 8.12.3
Documentation: https://theme-next.js.org

hexo: 6.2.0
hexo-cli: 4.3.0
os: darwin 20.6.0 11.6.1

node: 18.7.0
v8: 10.2.154.13-node.9
uv: 1.44.2
zlib: 1.2.11
brotli: 1.0.9
ares: 1.18.1
modules: 108
nghttp2: 1.48.0
napi: 8
llhttp: 6.0.7
openssl: 1.1.1q
cldr: 40.0
icu: 70.1
tz: 2021a3
unicode: 14.0

@slanterns
Copy link
Author

slanterns commented Aug 16, 2022

NexT version 8.12.3

Documentation: https://theme-next.js.org
hexo: 6.2.0 hexo-cli: 4.3.0 os: darwin 20.6.0 11.6.1

node: 18.7.0 v8: 10.2.154.13-node.9 uv: 1.44.2 zlib: 1.2.11 brotli: 1.0.9 ares: 1.18.1 modules: 108 nghttp2: 1.48.0 napi: 8 llhttp: 6.0.7 openssl: 1.1.1q cldr: 40.0 icu: 70.1 tz: 2021a3 unicode: 14.0

Maybe you can check the version of your warehouse installation in package-lock.json (or node_modules/warehouse/package.json)?

@gufeng0
Copy link

gufeng0 commented Aug 17, 2022

NexT version 8.12.3

Documentation: https://theme-next.js.org
hexo: 6.2.0 hexo-cli: 4.3.0 os: darwin 20.6.0 11.6.1
node: 18.7.0 v8: 10.2.154.13-node.9 uv: 1.44.2 zlib: 1.2.11 brotli: 1.0.9 ares: 1.18.1 modules: 108 nghttp2: 1.48.0 napi: 8 llhttp: 6.0.7 openssl: 1.1.1q cldr: 40.0 icu: 70.1 tz: 2021a3 unicode: 14.0

Maybe you can check the version of your warehouse installation in package-lock.json (or node_modules/warehouse/package.json)?

it is 4.0.1 that version of warehouse installation in package-lock.json,it can't upgrade to 4.0.2 after i do npm update hexo

@stevenjoezhang
Copy link
Member

@shuaixiaomi delete node_modules and package-lock.json, then run npm install to reinstall all the dependencies

@gufeng0
Copy link

gufeng0 commented Aug 17, 2022

@shuaixiaomi delete node_modules and package-lock.json, then run npm install to reinstall all the dependencies

Fix,thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants