Image processing failed Sharp wasn't installed

Output from npm ls sharp:

`-- sharp@0.34.2

Output from ghost doctor: (I’m running Ubuntu 24.04.2 LTS)

:check_mark: Checking system Node.js version - found v18.20.8
:check_mark: Checking logged in user
:check_mark: Ensuring user is not logged in as ghost user
:check_mark: Checking if logged in user is directory owner
:check_mark: Checking current folder permissions
System checks failed with message: ‘Linux version is not Ubuntu 16, 18, 20, or 22’
Some features of Ghost-CLI may not work without additional configuration.
For local installs we recommend using ghost install local instead.
? Continue anyway? Yes
System stack check skipped
:information_source: Checking system compatibility [skipped]
:check_mark: Checking for a MySQL installation

  • sudo systemctl is-active ghost_www-DOMAIN-org
    Instance is currently running
    :information_source: Validating config [skipped]
    :check_mark: Checking folder permissions
    :check_mark: Checking file permissions
    :check_mark: Checking content folder ownership
    :check_mark: Checking memory availability
    :check_mark: Checking binary dependencies
    :check_mark: Checking free space
    :check_mark: Checking systemd unit file
    :check_mark: Checking systemd node version - found v18.20.8

Ghost error log shows this:

“req”: {
“meta”: {
“requestId”: “313ab983-5397-4494-8825-0a09920daae3”,
“userId”: “1”
},
“url”: “/images/upload/”,
“method”: “POST”,
“originalUrl”: “/ghost/api/admin/images/upload/”,
“params”: {},
“headers”: {
“x-forwarded-for”: “2601:246:5d80:e090:24e8:215d:4009:3f87, 172.69.17.191, 10.0.0.158”,
“x-forwarded-proto”: “https”,
“x-real-ip”: “10.0.0.158”,
“host”: “www.DOMAIN.org”,
“connection”: “close”,
“content-length”: “57018”,
“x-forwarded-scheme”: “https”,
“referer”: “https://www.DOMAIN.org/ghost/”,
“sec-fetch-dest”: “empty”,
“sec-fetch-site”: “same-origin”,
“cf-ray”: “951c1fa28e5050d9-ORD”,
“sec-fetch-mode”: “cors”,
“user-agent”: “Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:139.0) Gecko/20100101 Firefox/139.0”,
“accept”: “text/plain, /; q=0.01”,
“accept-language”: “en-US,en;q=0.5”,
“accept-encoding”: “gzip, br”,
“x-ghost-version”: “5.125”,
“app-pragma”: “no-cache”,
“x-requested-with”: “XMLHttpRequest”,
“content-type”: “multipart/form-data; boundary=----geckoformboundary90a33eb0f735af1538d96e728ea61deb”,
“origin”: “https://www.DOMAIN.org”,
“cf-visitor”: “{"scheme":"https"}”,
“cdn-loop”: “cloudflare; loops=1”,
“cf-connecting-ip”: “2601:246:5d80:e090:24e8:215d:4009:3f87”,
“cf-ipcountry”: “US”,
“cookie”: “REDACTED
},
“query”: {}
},
“res”: {
“_headers”: {
“x-powered-by”: “Express”,
“content-version”: “v5.125”,
“vary”: “Accept-Version, Origin, Accept-Encoding”,
“cache-control”: “no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0”,
“access-control-allow-origin”: “https://www.DOMAIN.org”,
“content-type”: “application/json; charset=utf-8”,
“content-length”: “317”,
“etag”: “W/"13d-krP7VKHtFa1yx1KO4YnzEpQ9Vww"”
},
“statusCode”: 400,
“responseTime”: “19ms”
},
“err”: {
“id”: “605c2bb1-4c60-11f0-ae20-73a421c3aebb”,
“domain”: “https://www.DOMAIN.org”,
“code”: null,
“name”: “BadRequestError”,
“statusCode”: 400,
“level”: “normal”,
“message”: “Image processing failed”,
“context”: “"Sharp wasn’t installed"”,
“help”: “"Please verify that the image is valid"”,
“stack”: “BadRequestError: Image processing failed\n at Object.query (/home/ljhardy/public_html/DOMAIN.org/versions/5.125.1/core/server/api/endpoints/images.js:43:27)\n at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n at async getResponse (/home/ljhardy/public_html/DOMAIN.org/versions/5.125.1/node_modules/@tryghost/api-framework/lib/pipeline.js:259:34)\n at async ImplWrapper (/home/ljhardy/public_html/DOMAIN.org/versions/5.125.1/node_modules/@tryghost/api-framework/lib/pipeline.js:264:30)\n at async Http (/home/ljhardy/public_html/DOMAIN.org/versions/5.125.1/node_modules/@tryghost/api-framework/lib/http.js:70:28)”,
“hideStack”: false
},
“msg”: “Image processing failed”,
“time”: “2025-06-18T16:22:06.575Z”,
“v”: 0
}

Is the error message “Sharp wasn’t installed”, a red herring here? Sharp is installed. I’ve found a bunch of forum posts on this, but nothing recent and nothing with the latest version of Ghost, which is what I’m running.

any help with this?

[2025-06-21 10:25:51] ERROR "POST /ghost/api/admin/images/upload/" 400 28ms

NAME: BadRequestError
MESSAGE: Image processing failed

level: normal

"Sharp wasn't installed"
"Please verify that the image is valid"
BadRequestError: Image processing failed

Depending on where I try to upload the image, feature image, in a post etc. I get different errors, but the ghost logs always say the same thing, ERROR on the POST 400, BadRequestError, Image processing failed, “Sharp wasn’t installed”. This is the latest to show on the UI after attempt to upload an image as part of a post, I actually think that the upload worked, because the image flashes in the background before this error message:

Is This Thing On GIFs | Tenor

You’ve already tried the fixes here?

Yes, I’ve done all of that short of a complete re-install:

Ghost-CLI version: 1.27.0
Ghost version: 5.119.2

Sharp version ’ npm ls sharp’ from within the Ghost directory:
-- sharp@0.34.2

I didn’t need to install with root, ‘ghost doctor’ shows no errors or warnings.

I should also add that I thought it might be a Cloudflare issue, so I removed the Cloudflare proxy, but still received the exact same errors in the log.

I added:

"imageOptimization": {
    "resize": false
  },

to my config.production.json and image uploads worked, so it’s definitely something with sharper or how it was installed. Does it need to be installed with root user?

What should the permissions be on the sharp stuff in node_modules/@img? I removed and reinstalled sharp, ran ghost doctor and it said the permissions were wrong, I ran the suggested command to fix them, this is what they are now:

drwxr-xr-x 3 root root 4096 Jun 22 10:29 sharp-libvips-linux-x64
drwxr-xr-x 3 root root 4096 Jun 22 10:29 sharp-libvips-linuxmusl-x64
drwxr-xr-x 3 root root 4096 Jun 22 10:29 sharp-linux-x64
drwxr-xr-x 3 root root 4096 Jun 22 10:29 sharp-linuxmusl-x64

More and more I’m thinking that I have a permissions problem, although ghost doctor is not showing anything. Running “ghost backup” in the cli give me:

✖ Backing up site
An error occurred.
Message: 'Response code 403 (Forbidden)'


Debug Information:
    OS: Ubuntu, v24.04.2 LTS
    Node Version: v18.18.2
    Ghost Version: 5.126.1
    Ghost-CLI Version: 1.27.0
    Environment: production
    Command: 'ghost backup'

Additional log info available in: /home/ljhardy/.ghost/logs/ghost-cli-debug-2025-06-23T13_50_48_835Z.log

Try running ghost doctor to check your system for known issues.

ghost doctor shows no issues.

There’s a known issue with backup via ghost-cli. The issue is in the ghost-cli repo.

Is my only alternative to my original “sharp not found” error on image upload a complete reinstall? Previous posts on this thread have shown all of my debugging attempts. Sharp is installed. I’m at a standstill here.

I think you’ve pretty well established that it’s something related to sharp. In this situation, I might try removing the node_modules folder (from inside current) and then forcing an update to your current Ghost version, which should cause it to fix dependencies.

ghost update [version] --force

Make a backup or snapshot first, if you have valuable content.

Thank you, I will try that and report back.

Same failure. If I was going to install from scratch and then restore a backup, would the backup file created from “ghost backup” contain everything needed to restore to current state?

Ok, I give up. Seems like this should be easy to figure out, but not so, I’ve been working on this for 2 weeks.

Ok, I didn’t really give up. lol. I provisioned a new VM and reinstalled ghost from scratch, then recovered a backup. It was a bit of a hassle because of ssl, domain names, my reverse proxy, cloudflare etc., but it all appears to be working again. Fingers crossed.

1 Like