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

CouchDb port not available issue when adding more peers #58

Open
anandhakumarpalanisamy opened this issue Oct 18, 2021 · 0 comments
Open
Labels
good first issue Good for newcomers

Comments

@anandhakumarpalanisamy
Copy link
Contributor

anandhakumarpalanisamy commented Oct 18, 2021

CouchDb port not available issue when adding more peers

  • spiros reported a error on couch_db when trying to add new peer.
  • For every new peer which uses couchdb, a new couchdb service with name "couchdb_PEERNAME" will be started. For example, the service names would be couchdb_peer3, couchdb_peer4, etc.
  • But the couch_db port number 5984 is hard coded in the couch_db playbook. This works for the default organisation set up as only one peer(peer2) is using couchdb.
  • When a new couchdb_peer3 service starts it fails as port is already occupied by couchdb_peer2

Here is the error from spiros:

"msg": "An unexpected docker error occurred: 400 Client Error for http+docker://localhost/v1.41/services/create: Bad Request ("rpc error: code = InvalidArgument desc = port '5984' is already in use by service 'couchdb_peer2' (j9h35naenfg9j4z07ie87gonz) as an ingress port")",
"exception": "Traceback (most recent call last):\n File "/usr/local/lib/python3.6/dist-packages/docker/api/client.py", line 268, in raise_for_status\n response.raise_for_status()\n File "/usr/lib/python3/dist-packages/requests/models.py", line 935, in raise_for_status\n raise HTTPError(http_error_msg, response=self)\nrequests.exceptions.HTTPError: 400 Client Error: Bad Request for url: http+docker://localhost/v1.41/services/create\n\nDuring handling of the above exception, another exception occurred:\n\nTraceback (most recent call last):\n File "/tmp/ansible_docker_swarm_service_payload_m388bywu/ansible_docker_swarm_service_payload.zip/ansible/modules/cloud/docker/docker_swarm_service.py", line 2974, in main\n File "/tmp/ansible_docker_swarm_service_payload_m388bywu/ansible_docker_swarm_service_payload.zip/ansible/modules/cloud/docker/docker_swarm_service.py", line 2656, in run_safe\n File "/tmp/ansible_docker_swarm_service_payload_m388bywu/ansible_docker_swarm_service_payload.zip/ansible/modules/cloud/docker/docker_swarm_service.py", line 2646, in run\n File "/tmp/ansible_docker_swarm_service_payload_m388bywu/ansible_docker_swarm_service_payload.zip/ansible/modules/cloud/docker/docker_swarm_service.py", line 2476, in create_service\n File "/usr/local/lib/python3.6/dist-packages/docker/utils/decorators.py", line 34, in wrapper\n return f(self, args, *kwargs)\n File "/usr/local/lib/python3.6/dist-packages/docker/api/service.py", line 190, in create_service\n self._post_json(url, data=data, headers=headers), True\n File "/usr/local/lib/python3.6/dist-packages/docker/api/client.py", line 274, in result\n self._raise_for_status(response)\n File "/usr/local/lib/python3.6/dist-packages/docker/api/client.py", line 270, in _raise_for_status\n raise create_api_error_from_http_exception(e)\n File "/usr/local/lib/python3.6/dist-packages/docker/errors.py", line 31, in create_api_error_from_http_exception\n raise cls(e, response=response, explanation=explanation)\ndocker.errors.APIError: 400 Client Error for http+docker://localhost/v1.41/services/create: Bad Request ("rpc error: code = InvalidArgument desc = port '5984' is already in use by service 'couchdb_peer2' (j9h35naenfg9j4z07ie87gonz) as an ingress port")\n",

@anandhakumarpalanisamy anandhakumarpalanisamy added the good first issue Good for newcomers label Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant