Install fails due to corepack sqlite readonly

My install (blog.leonhassan.co.uk) was recently the victim to the injection exploit for <v6, after attempting to recover I decided to reinstall fresh and skip all of major version migrations (with backups taken), however after attempting a clean install I am facing an issue where when I run ghost install it fails during the dependencies install stage with the following error:

✖ Downloading and installing Ghost v6.49.0
A ProcessError occurred.

Message: Command failed: corepack pnpm install --prod --reporter=append-only
file:///home/leon/.cache/node/corepack/v1/pnpm/11.8.0/dist/pnpm.mjs:54334
throw err2;
^

Error: attempt to write a readonly database
at file:///home/leon/.cache/node/corepack/v1/pnpm/11.8.0/dist/pnpm.mjs:54521:26
at sqliteRetry (file:///home/leon/.cache/node/corepack/v1/pnpm/11.8.0/dist/pnpm.mjs:54328:14)
at StoreIndex.setRawMany (file:///home/leon/.cache/node/corepack/v1/pnpm/11.8.0/dist/pnpm.mjs:54520:11)
at StoreIndex.flush (file:///home/leon/.cache/node/corepack/v1/pnpm/11.8.0/dist/pnpm.mjs:54509:14)
at file:///home/leon/.cache/node/corepack/v1/pnpm/11.8.0/dist/pnpm.mjs:54499:39
at process.processTicksAndRejections (node:internal/process/task_queues:84:11) {
code: 'ERR_SQLITE_ERROR',
errcode: 8,
errstr: 'attempt to write a readonly database'
}

Node.js v22.22.2

My old install used sqlite3, but I have removed it and installed mysql instead as recommended for self-hosting. I haven’t found anything that should point corepack to sqlite that I have done so I’m quite confused on what the next steps should be to move past the issue.

I am hosting on Ubuntu v22.04 and I have tried installing sqlite3, which made no difference when rerunning the ghost install.

Appreciate the help in getting my blog back on it’s feet, thanks in advance.

Hmm, this appears to be an issue we hadn’t really considered with having Ghost-CLI default to corepack for pnpm use :thinking:

What happens if you try the following to install pnpm globally?

curl -fsSL https://get.pnpm.io/install.sh | sh -

(taken from the pnpm.io docs).

That should hopefully get pnpm installed globally, and ghost-cli will use that rather than try to use pnpm from corepack.

Hi Austin, thanks for the info. I’ve installed pnpm (and libatomic1 dependency), reran ghost install and get a very similar error, but now from pnpm:

✖ Downloading and installing Ghost v6.49.0
A ProcessError occurred.

Message: Command failed: pnpm install --prod --reporter=append-only
file:///home/leon/.local/share/pnpm/store/v11/links/@pnpm/exe/11.9.0/ba7d0e4593f839f8a3f4faa2799a55b36b1d97f7709b79c6ede2aec641e668fe/node_modules/@pnpm/exe/dist/pnpm.mjs:54545
      throw err2;
      ^

Error: attempt to write a readonly database
    at file:///home/leon/.local/share/pnpm/store/v11/links/@pnpm/exe/11.9.0/ba7d0e4593f839f8a3f4faa2799a55b36b1d97f7709b79c6ede2aec641e668fe/node_modules/@pnpm/exe/dist/pnpm.mjs:54732:26
    at sqliteRetry (file:///home/leon/.local/share/pnpm/store/v11/links/@pnpm/exe/11.9.0/ba7d0e4593f839f8a3f4faa2799a55b36b1d97f7709b79c6ede2aec641e668fe/node_modules/@pnpm/exe/dist/pnpm.mjs:54539:14)
    at StoreIndex.setRawMany (file:///home/leon/.local/share/pnpm/store/v11/links/@pnpm/exe/11.9.0/ba7d0e4593f839f8a3f4faa2799a55b36b1d97f7709b79c6ede2aec641e668fe/node_modules/@pnpm/exe/dist/pnpm.mjs:54731:11)
    at StoreIndex.flush (file:///home/leon/.local/share/pnpm/store/v11/links/@pnpm/exe/11.9.0/ba7d0e4593f839f8a3f4faa2799a55b36b1d97f7709b79c6ede2aec641e668fe/node_modules/@pnpm/exe/dist/pnpm.mjs:54720:14)
    at file:///home/leon/.local/share/pnpm/store/v11/links/@pnpm/exe/11.9.0/ba7d0e4593f839f8a3f4faa2799a55b36b1d97f7709b79c6ede2aec641e668fe/node_modules/@pnpm/exe/dist/pnpm.mjs:54710:39
    at process.processTicksAndRejections (node:internal/process/task_queues:85:11) {
  code: 'ERR_SQLITE_ERROR',
  errcode: 8,
  errstr: 'attempt to write a readonly database'
}

Node.js v26.0.0


Exit code: 1


Debug Information:
    OS: Ubuntu, v24.04.4 LTS
    Node Version: v22.22.2
    Ghost-CLI Version: 1.29.3
    Environment: production
    Command: 'ghost install'

I’ve still got no idea why it’s trying to use sqlite over mysql, unless this is something internal to pnpm?

Yeah this appears to be an issue internal to pnpm, I’ll look and see if there’s a way we can fix this in Ghost-CLI.

Hi Austin, any update or ETA? :crossed_fingers:

Apologies, totally meant to look at this and got sidetracked :confused: will make sure to look today or tomorrow

No sweat, appreciate you looking into it! Thanks :grin:

Ok, I just published a new Ghost-CLI version 1.30.0 - can you try installing/using that version to see if it fixes the issue?

The updated version is working, thank you very much Austin! Have a great weekend :grin: