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

Wiki.js in docker container won't connect to mongodb #198

Closed jamalbernhard closed 5 years ago

jamalbernhard commented 5 years ago

Sorry, this is just a call for help. I'm a mongodb noob and have very little docker experience as well. I installed mongodb just to try Wiki.js. The daemon seems to be running fine:

$ mongo
MongoDB shell version v4.0.9
connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("f6a8a520-c5c3-4d28-af02-3fb8f4e7750a") }
...

I followed the instructions to fetch the Wiki.js docker image and run the container. It looks to be up and connects successfully to the Github repo I set up, according to the log. However I can't get it to connect to mongodb. From /logs/wiki-stderr.log:

2019-04-17T17:48:43.269Z - error: [AGENT] Failed to connect to MongoDB instance.
Unhandled rejection MongoError: failed to connect to server [localhost:27017]
on first connect [MongoError: connect ECONNREFUSED 127.0.0.1:27017]                                                                                   

I tried using both db: mongodb://localhost:27017/wiki and db: mongodb://127.0.0.1:27017/wiki explicitly in my config.yml. I tried creating the wiki db in mongo. I also tried downloading and using mongodb's docker image instead of the version I installed on the host. No dice. I'm probably doing something silly stupid here, but wasn't sure where else to turn.

I can try the Docker Compose instructions and see if that works, but I've never used Docker Compose before so I was trying the simpler instructions first.

Thanks.

jamalbernhard commented 5 years ago

Solved using --network="host" in the docker run command.

rashmi7321 commented 5 years ago

hi, while i am trying to deploy wiki.js using yaml files in kubernetes(in gcp(GKE)) its getting deployed but while i am trying to create user or save the documents getting "ERROR UNDEFINED". couldnot able to resolve it. error undefined

rashmi7321 commented 5 years ago

@ @jamalbernhard @felipeplets @Savageman hi, while i am trying to deploy wiki.js using yaml files in kubernetes(in gcp(GKE)) its getting deployed but while i am trying to create user or save the documents getting "ERROR UNDEFINED". couldnot able to resolve it. error undefined