wiki-v1 icon indicating copy to clipboard operation
wiki-v1 copied to clipboard

Invalid DB Type Error when run docker-compse in ubuntu

Open stanislous opened this issue 4 years ago • 8 comments

Question I tried to run wikijs and MongoDB services using docker-compose on ubuntu 18.04. I set up config.yml file

//Port the server should listen to port: 80

db: type: mongodb

// PostgreSQL / MySQL / MariaDB / MS SQL Server only: host: localhost port: 5432 user: wikijs pass: wikijsrocks db: wiki ssl: false

Then I configured docker-compose.yml file with wikijs and MongoDB services.

version: '3' services: wikidb: image: mongo:3 expose: - '27017' command: '--smallfiles --bind_ip ::,0.0.0.0' environment: - 'MONGO_LOG_DIR=/dev/null' volumes: - $HOME/volumes/mongo/db:/data/db wikijs: image: 'requarks/wiki:latest' links: - wikidb depends_on: - wikidb ports: - '80:80' environment: WIKI_ADMIN_EMAIL: [email protected] volumes: - $HOME/volumes/wiki/config.yml:/var/wiki/config.yml

I changed the database parameter in the config using these commands

SEARCH="mongodb://localhost:27017/wiki" REPLACE="mongodb://wikidb:27017/wiki" FILEPATH="$HOME/volumes/wiki/config.yml" sed -i "s;$SEARCH;$REPLACE;" $FILEPATH

Finally i run the docker-compose up on the terminal. It pulled both mongoDB and wikijs containers successfully but finally showed this error.

wikijs_1 | Loading configuration from /wiki/config.yml... OK wikijs_1 | 2020-04-08T05:29:44.323Z [MASTER] info: ============================== wikijs_1 | 2020-04-08T05:29:44.327Z [MASTER] info: = Wiki.js 2.2.51 ==================== wikijs_1 | 2020-04-08T05:29:44.328Z [MASTER] info: ============================== wikijs_1 | 2020-04-08T05:29:44.328Z [MASTER] info: Initializing... wiki_wikidb_1 exited with code 1 wikijs_1 | 2020-04-08T05:29:44.663Z [MASTER] error: Invalid DB Type wiki_wikijs_1 exited with code 1

There is no spacing issues in both .yml files. Also I disabled git. Can someone help me to figure this out?

Host Info (please complete the following information): OS: [e.g. Ubuntu 18.04, Docker] Wiki.js version: [e.g. 2.2] Database engine: [e.g. mongodb:3 ]

stanislous avatar Apr 08 '20 09:04 stanislous

MongoDB is not supported on Wiki.js 2.x

Smankusors avatar Apr 08 '20 10:04 Smankusors

@Smankusors what versions support MongoDB?

stanislous avatar Apr 08 '20 10:04 stanislous

@Smankusors what versions support MongoDB?

1.x

Smankusors avatar Apr 08 '20 10:04 Smankusors

thanks, @Smankusors let me try that

stanislous avatar Apr 08 '20 10:04 stanislous

I changed the version of the wikijs from 2.2 to 1.0. Then it shows this error.

wikijs_1 | 2020-04-08 11:59:50,365 INFO spawned: 'wikijs' with pid 7 wikijs_1 | 2020-04-08 11:59:50,507 INFO exited: wikijs (exit status 1; not expected) wikijs_1 | 2020-04-08 11:59:51,509 INFO spawned: 'wikijs' with pid 13 wikijs_1 | 2020-04-08 11:59:51,660 INFO exited: wikijs (exit status 1; not expected) wikijs_1 | 2020-04-08 11:59:53,667 INFO spawned: 'wikijs' with pid 19 wikijs_1 | 2020-04-08 11:59:53,783 INFO exited: wikijs (exit status 1; not expected) wikijs_1 | 2020-04-08 11:59:56,789 INFO spawned: 'wikijs' with pid 25 wikijs_1 | 2020-04-08 11:59:56,904 INFO exited: wikijs (exit status 1; not expected) wikijs_1 | 2020-04-08 11:59:57,905 INFO gave up: wikijs entered FATAL state, too many start retries too quickly

I think config.yml is available and it's path is correct.

stanislous avatar Apr 08 '20 12:04 stanislous

@NGPixel any way to fix this?

stanislous avatar Apr 09 '20 05:04 stanislous

Read the docs

You can't just replace the version number and expect it to work.

NGPixel avatar Apr 09 '20 06:04 NGPixel

I set db connection string to: mongodb://wikidb:27017/wiki. WikiJs port is:- '8080:3000' and config.yml port set to 8080. And didn't change any other settings. But i'm getting the same error.

stanislous avatar Apr 09 '20 07:04 stanislous