Skip to content

Storage adapters (and possibly other types) placed in the content folder are not detected. #22883

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

Open
1 task done
Southpaw1496 opened this issue Apr 14, 2025 · 0 comments
Open
1 task done
Labels
needs:triage [triage] this needs to be triaged by the Ghost team

Comments

@Southpaw1496
Copy link

Southpaw1496 commented Apr 14, 2025

Issue Summary

Adapters placed in content/adapters/storage are not found, failing with the error unable to find storage adapter <adapter> in <root path>/content/adapters/. The same adapters placed in <root path>/versions/<version>/core/server/adapters/storage load correctly.

I made a storage adapter for S3 and placed it in content/adapters/storage, in line with the documentation When I tried to start Ghost, it failed, even though I could ls the exact path that the error printed and see the files. This forum post suggested putting the files in Ghost's internal adapter store, and it worked perfectly. However, it isn't ideal using Ghost internals that don't persist between upgrades, and this behaviour is undocumented.

The included logs were run on a local install of Ghost 5.114.0, but I have reproduced the issue in a production install of 5.116.0 in Ubuntu, and a Docker install of 5.116.0 on Debian.

Steps to Reproduce

  1. Create a storage adapter. This is the one I have been working on: ghost-s3-adapter.tar.gz
  2. Add the adapter to content/adapters/storage.
  3. Add the following to your ghost config:
"adapters": {
    "storage": {
      "active": "ghost-s3-adapter"
    }
}

(the name under "active:" is specific to the folder you put the adapter in).
4. Attempt to start Ghost (ghost run -D works fine).
5. Observe the error unable to find storage adapter ghost-s3-adapter in <root path>/content/adapters/. This shouldn't occur because the adapter is, in fact, in content/adapters/storage. The adapter should load without issues.
6. Move the adapter to versions/5.116.0/core/server/adapters/storage, where Ghost keeps its internal storage adapters. This may be aliased to current/core/server/adapters/storage.
7. Start ghost
8. The server will still crash, but with a different error: Cannot read properties of undefined. This is because the adapter hasn't been configured yet, however, the fact that this error occurs indicates that it has loaded. For my adapter, you can add the following values to storage.adapters:

"ghost-s3-adapter": {
        "clientID": "<AWS Client ID>",
        "clientSecret": "<AWS Client Secret>",
        "endpoint": "<AWS Endpoint>",
        "serveUrl": "<URL to serve files from>",
        "bucket": "<AWS bucket>",
        "region": "<AWS Region>"
      }

and Ghost will start correctly.

Ghost Version

5.116.0

Node.js Version

20

How did you install Ghost?

Tested in local install on macOS 15, Production Install on Ubuntu 20.10, Docker Install on Debian 12

Database type

MySQL 8

Browser & OS version

No response

Relevant log / error output

The `ghost run` command is used by the configured Ghost process manager and for debugging. If you're not running this to debug something, you should run `ghost start` instead.
[2025-04-14 09:13:25] INFO Ghost is running in development...
[2025-04-14 09:13:25] INFO Listening on: 127.0.0.1:2368
[2025-04-14 09:13:25] INFO Url configured as: http://localhost:2368/
[2025-04-14 09:13:25] INFO Ctrl+C to shut down
[2025-04-14 09:13:25] INFO Ghost server started in 0.318s
[2025-04-14 09:13:25] INFO Database is in a ready state.
[2025-04-14 09:13:25] INFO Ghost database ready in 0.442s
[2025-04-14 09:13:26] ERROR The currently active theme "source" is missing.

The currently active theme "source" is missing.

"name: source"
"path: /Users/southpaw/Docker/Log/ghost/content/themes/"

Error ID:
    b9044000-1910-11f0-a1de-3b5efdfe5c7c

Error Code:
    ENOENT


[2025-04-14 09:13:26] ERROR Unable to find storage adapter ghost-s3-adapter in ,/Users/southpaw/Docker/Log/ghost/content/adapters/,/Users/southpaw/Docker/Log/ghost/versions/5.114.0/core/server/adapters/.

Unable to find storage adapter ghost-s3-adapter in ,/Users/southpaw/Docker/Log/ghost/content/adapters/,/Users/southpaw/Docker/Log/ghost/versions/5.114.0/core/server/adapters/.

Error ID:
    b9333f40-1910-11f0-a1de-3b5efdfe5c7c

----------------------------------------

IncorrectUsageError: Unable to find storage adapter ghost-s3-adapter in ,/Users/southpaw/Docker/Log/ghost/content/adapters/,/Users/southpaw/Docker/Log/ghost/versions/5.114.0/core/server/adapters/.
    at AdapterManager.getAdapter (/Users/southpaw/Docker/Log/ghost/versions/5.114.0/node_modules/@tryghost/adapter-manager/lib/AdapterManager.js:128:19)
    at Object.getAdapter (/Users/southpaw/Docker/Log/ghost/versions/5.114.0/core/server/services/adapter-manager/index.js:31:31)
    at Object.getStorage (/Users/southpaw/Docker/Log/ghost/versions/5.114.0/core/server/adapters/storage/index.js:14:27)
    at setupSiteApp (/Users/southpaw/Docker/Log/ghost/versions/5.114.0/core/frontend/web/site.js:87:71)
    at module.exports (/Users/southpaw/Docker/Log/ghost/versions/5.114.0/core/server/web/parent/frontend.js:22:58)
    at initExpressApps (/Users/southpaw/Docker/Log/ghost/versions/5.114.0/core/boot.js:242:68)
    at bootGhost (/Users/southpaw/Docker/Log/ghost/versions/5.114.0/core/boot.js:573:32)

[2025-04-14 09:13:26] WARN Ghost is shutting down
[2025-04-14 09:13:26] WARN Ghost has shut down
[2025-04-14 09:13:26] WARN Ghost was running for a few seconds

Code of Conduct

  • I agree to be friendly and polite to people in this repository
@github-actions github-actions bot added the needs:triage [triage] this needs to be triaged by the Ghost team label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs:triage [triage] this needs to be triaged by the Ghost team
Projects
None yet
Development

No branches or pull requests

1 participant