requarks / wiki-v1

Legacy version (1.x) of Wiki.js
https://wiki.js.org
GNU Affero General Public License v3.0
101 stars 75 forks source link

Invalid DB Type Error when run docker-compse in ubuntu #252

Open stanislous opened 4 years ago

stanislous commented 4 years ago

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:

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 ]

Smankusors commented 4 years ago

MongoDB is not supported on Wiki.js 2.x

stanislous commented 4 years ago

@Smankusors what versions support MongoDB?

Smankusors commented 4 years ago

@Smankusors what versions support MongoDB?

1.x

stanislous commented 4 years ago

thanks, @Smankusors let me try that

stanislous commented 4 years ago

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 commented 4 years ago

@NGPixel any way to fix this?

NGPixel commented 4 years ago

Read the docs

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

stanislous commented 4 years ago

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.