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

ERROR: Unable to find storage adapter ghost-storage-github #37

Closed
lecoan opened this issue Dec 4, 2020 · 6 comments
Closed

ERROR: Unable to find storage adapter ghost-storage-github #37

lecoan opened this issue Dec 4, 2020 · 6 comments

Comments

@lecoan
Copy link

lecoan commented Dec 4, 2020

  • OS: ubuntu 20.04
  • Docker: 19.03.14

Hi, I am using ghost with docker, and after I installed this adapter following the README, it given me the following error:

[2020-12-04 04:29:05] ERROR Unable to find storage adapter ghost-storage-github in ,/var/lib/ghost/content/adapters/,/var/lib/ghost/versions/3.38.3/core/server/adapters/.

Unable to find storage adapter ghost-storage-github in ,/var/lib/ghost/content/adapters/,/var/lib/ghost/versions/3.38.3/core/server/adapters/.

Error ID:
    3e172b50-35e9-11eb-9036-3d0bb8ad1017

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

IncorrectUsageError: Unable to find storage adapter ghost-storage-github in ,/var/lib/ghost/content/adapters/,/var/lib/ghost/versions/3.38.3/core/server/adapters/.
    at new IncorrectUsageError (/var/lib/ghost/versions/3.38.3/node_modules/ghost-ignition/lib/errors/index.js:98:23)
    at AdapterManager.getAdapter (/var/lib/ghost/versions/3.38.3/node_modules/@tryghost/adapter-manager/lib/AdapterManager.js:110:19)
    at Object.getAdapter (/var/lib/ghost/versions/3.38.3/core/server/services/adapter-manager/index.js:26:31)
    at Object.getStorage (/var/lib/ghost/versions/3.38.3/core/server/adapters/storage/index.js:4:27)
    at setupSiteApp (/var/lib/ghost/versions/3.38.3/core/server/web/site/app.js:111:71)
    at setupParentApp (/var/lib/ghost/versions/3.38.3/core/server/web/parent/app.js:65:44)
    at /var/lib/ghost/versions/3.38.3/core/server/index.js:109:52

I examined the directory /var/lib/ghost/content/adapters/ and there did has storage/ghost-storage-github/,then according to the official document https://ghost.org/docs/concepts/storage-adapters/

Inside of content/adapters/storage create a file or a folder: content/adapters/storage/my-module.js or content/adapters/storage/my-module - if using a folder, create a file called index.js inside it

I moved the index.js and utils.js outside from build folder, but it didn't work either.

adapters/
└── storage
    └── ghost-storage-github
        ├── build
        │   ├── index.js
        │   └── utils.js
        ├── index.js
        ├── LICENSE.txt
        ├── package.json
        ├── README.md
        └── utils.js

My ghost configuration is:

{
  "url": "http://localhost:2368",
  "server": {
    "port": 2368,
    "host": "0.0.0.0"
  },
  "database": {
    "client": "mysql",
    "connection": {
    }
  },
  "mail": {
    "transport": "Direct"
  },
  "logging": {
    "transports": [
      "file",
      "stdout"
    ]
  },
  "process": "systemd",
  "paths": {
    "contentPath": "/var/lib/ghost/content"
  },
  "storage": {
    "active": "ghost-storage-github",
    "ghost-storage-github": {
        "token": "TOKEN",
        "owner": "OWNER",
        "repo": "ghost-assets",
        "branch": "master",
        "useRelativeUrls": false
    }
  }
}

and my docker-compse file is:

version: '3'
services:
	
# other services ...

  ghost:
    image: ghost
    volumes:
    - ./ghost/content/:/var/lib/ghost/content
    - ./ghost/config.json:/var/lib/ghost/config.production.json
    expose:
    - "2368"
    depends_on:
    - caddy
    - mariadb
@lecoan lecoan closed this as completed Dec 7, 2020
@ifvictr
Copy link
Owner

ifvictr commented Dec 8, 2020

Hi, @lecoan! Just saw this issue and noticed that you've closed it. How did you manage to solve the problem you were having?

@lecoan
Copy link
Author

lecoan commented Dec 8, 2020

@ifvictr I downloaded the module by npm outside the docker, but the node_modules didn't mount within docker container, as shown in my docker-compse.yaml file, thus the adapter can not find its dependencies.

@ifvictr
Copy link
Owner

ifvictr commented Dec 9, 2020

I see. Glad you were able to resolve this! :)

@quyleanh
Copy link

@lecoan could you tell me how did you update your docker-compose.yml file? Thank you.

@lecoan
Copy link
Author

lecoan commented Jun 22, 2022

@quyleanh I lost the config and don't use ghost for posting blogs now. But the configuration is easy.

After cp -r node_modules/ghost-storage-github content/adapters/storage/ghost-storage-github, you need mount the other node_modules inside your container so that ghost-storage-github can find its deps :)

    volumes:
    - ./ghost/content/:/var/lib/ghost/content
    - ./ghost/config.json:/var/lib/ghost/config.production.json
    - ./ghost/node_modules:/var/lib/ghost/node_modules # new

@quyleanh
Copy link

@lecoan thank you very much. I've manage to run it successfully.
Actually, my error is mistaken config.

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

No branches or pull requests

3 participants