ghost-cloudflare-r2 icon indicating copy to clipboard operation
ghost-cloudflare-r2 copied to clipboard

Ghost fails with error when r2 adapter is integrated

Open bonysimon007 opened this issue 1 year ago • 2 comments

I tried using the adapter but it failed with the below error. I never worked on TS hence was not able to debug and fix it. My deployment environment is as follows. OS: ubuntu 22.04 Ghost : Latest Ghost with docker Cloudflare already configured

[2023-04-19 00:36:33] INFO Ghost is running in production... [2023-04-19 00:36:33] INFO Your site is now available on https://sitename.tld/ [2023-04-19 00:36:33] INFO Ctrl+C to shut down [2023-04-19 00:36:33] INFO Ghost server started in 1.285s [2023-04-19 00:36:33] INFO Database is in a ready state. [2023-04-19 00:36:34] INFO Ghost database ready in 1.677s [2023-04-19 00:36:37] ERROR We detected a misuse. Please read the stack trace.

We detected a misuse. Please read the stack trace.

Error ID: 3e7c67c0-de4a-11ed-9324-3587dc794858


Error: at AdapterManager.getAdapter (/var/lib/ghost/versions/5.43.0/node_modules/@tryghost/adapter-manager/lib/AdapterManager.js:114:27) Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp-linux-x64.node' Require stack:

  • /var/lib/ghost/content/adapters/storage/ghost-cloudflare-r2/node_modules/sharp/lib/sharp.js
  • /var/lib/ghost/content/adapters/storage/ghost-cloudflare-r2/node_modules/sharp/lib/constructor.js
  • /var/lib/ghost/content/adapters/storage/ghost-cloudflare-r2/node_modules/sharp/lib/index.js
  • /var/lib/ghost/content/adapters/storage/ghost-cloudflare-r2/index.js
  • /var/lib/ghost/versions/5.43.0/core/server/services/adapter-manager/index.js
  • /var/lib/ghost/versions/5.43.0/core/server/adapters/storage/index.js
  • /var/lib/ghost/versions/5.43.0/core/server/lib/image/index.js
  • /var/lib/ghost/versions/5.43.0/core/server/models/member.js
  • /var/lib/ghost/versions/5.43.0/core/server/models/index.js
  • /var/lib/ghost/versions/5.43.0/core/server/services/url/Resources.js
  • /var/lib/ghost/versions/5.43.0/core/server/services/url/UrlService.js
  • /var/lib/ghost/versions/5.43.0/core/server/services/url/index.js
  • /var/lib/ghost/versions/5.43.0/core/app.js
  • /var/lib/ghost/versions/5.43.0/core/boot.js
  • /var/lib/ghost/versions/5.43.0/ghost.js
  • /var/lib/ghost/versions/5.43.0/index.js

Possible solutions:

  • Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
  • Install for the current linux-x64 runtime: "npm install --platform=linux --arch=x64 sharp"
  • Consult the installation documentation: https://sharp.pixelplumbing.com/install at Object. (/var/lib/ghost/content/adapters/storage/ghost-cloudflare-r2/node_modules/sharp/lib/sharp.js:34:9) at Module._compile (node:internal/modules/cjs/loader:1196:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10) at Module.load (node:internal/modules/cjs/loader:1074:32) at Function.Module._load (node:internal/modules/cjs/loader:909:12) at Module.require (node:internal/modules/cjs/loader:1098:19) at require (node:internal/modules/cjs/helpers:108:18) at Object. (/var/lib/ghost/content/adapters/storage/ghost-cloudflare-r2/node_modules/sharp/lib/constructor.js:8:1) at Module._compile (node:internal/modules/cjs/loader:1196:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10) at Module.load (node:internal/modules/cjs/loader:1074:32) at Function.Module._load (node:internal/modules/cjs/loader:909:12) at Module.require (node:internal/modules/cjs/loader:1098:19) at require (node:internal/modules/cjs/helpers:108:18) at Object. (/var/lib/ghost/content/adapters/storage/ghost-cloudflare-r2/node_modules/sharp/lib/index.js:3:15) at Module._compile (node:internal/modules/cjs/loader:1196:14)

Thanks in advance

bonysimon007 avatar Apr 19 '23 00:04 bonysimon007