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

Replication fails if mapped port are not 5984:5984 #17

Closed
popojargo opened this issue Jun 3, 2017 · 5 comments
Closed

Replication fails if mapped port are not 5984:5984 #17

popojargo opened this issue Jun 3, 2017 · 5 comments

Comments

@popojargo
Copy link
Member

Problem

I ran the docker image with the following command :

docker run -d -it -p 35984:5984  klaemo/couchdb:latest

So far, everything works fine except for replication. If I try to replicate one local db to another one, it hangs for more than 2 minutes and throw an error.

Expected Behavior

It should work normally and replicate?(Or am I misunderstanding docker ports mapping?)

Current Behavior

I hangs for a long time and throw an error.

Possible Solution

Steps to Reproduce (for bugs)

  1. Run the following command
docker run -d -it -p 35984:5984  klaemo/couchdb:latest
  1. Create two database (db1 and db2)
  2. Try to replicate one to the other
curl -X POST -d '
{"source":"http://localhost:35984/db1", "target":"http://localhost:35984/db2"}' http:/localhost:35984/_replicate -H "Content-type: application/json"
  1. There, it will hang...

Context

Your Environment

  • CouchDB 2.0
  • Docker on Windows (v 17.03.1)
  • Windows 10
@wohali
Copy link
Member

wohali commented Jun 3, 2017

So this is a limitation of how port mapping works. CouchDB can't see outside of the Docker container, so as far as it's concerned, it will only see itself on port 5984.

What if you tell it to replicate to & from port 5984 on localhost in your curl POST? That might work.

@popojargo
Copy link
Member Author

@wohali It works with 5984. So if I want the mapped port to work, I should change the binding port to the external one?

@wohali
Copy link
Member

wohali commented Jun 4, 2017 via email

@popojargo
Copy link
Member Author

@wohali Thank you very much! If I have any question regarding the docker image of CouchDB, is there any better place than the IRC ?

@wohali
Copy link
Member

wohali commented Jun 4, 2017

Actually, this is a Docker for Windows issue, not a CouchDB issue. See docker/for-win#204

@wohali wohali closed this as completed Jun 4, 2017
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

2 participants