When running `ansible-playbook -i environments/local couchdb.yml` after 
necessary setup using couchdb container, it will fail when waiting for couchdb 
to be running.

More specifically, I find it trying to connect to 
`http://172.17.0.1:5984/_utils/` but my actual configuration is 
`http://172.17.0.2:5984/_utils/`

> TASK [couchdb : wait until CouchDB in this host is up and running]
> Sunday 26 August 2018  11:51:59 +0000 (0:00:03.431)       0:00:07.474 
> ********* 
> ....
> FAILED - RETRYING: wait until CouchDB in this host is up and running (1 
> retries left).
> fatal: [172.17.0.1]: FAILED! => {"attempts": 12, "changed": false, "content": 
> "", "msg": "Status code was -1 and not [200]: Connection failure: timed out", 
> "redirected": false, "status": -1, "url": "http://172.17.0.1:5984/_utils/"}
> 
> Status code was -1 and not [200]: Connection failure: timed out
> 
> PLAY RECAP > 
> *************************************************************************************************************************************************************************************************
> 172.17.0.1                 : ok=4    changed=1    unreachable=0    failed=1   
> localhost                  : ok=2    changed=0    unreachable=0    failed=0

It was trying to connect to 172.17.0.1, but I've already configured the db host 
to be 172.17.0.2(I'm sure it is the ip of couchdb container because I inspect 
the docker network)! Here is my `db_local.ini`, which is auto-generated
```
[db_creds]
db_provider=CouchDB
db_username=password
db_password=password
db_protocol=http
db_host=172.17.0.2
db_port=5984

[controller]
db_username=whisk_local_controller0
db_password=some_controller_passw0rd

[invoker]
db_username=whisk_local_invoker0
db_password=some_invoker_passw0rd
```

I'm sure the couchdb is working because I can access 
`http://172.17.0.2:5984/_utils/`  in the browser.

## Environment details:

* local deployment
* couchdb docker image 2.1
* native ubuntu 16.04 with all updates installed
* docker 18.06.1-ce

## Steps to reproduce the issue:

1.   Follow all the instructions on 
[https://github.com/apache/incubator-openwhisk/tree/master/tools/ubuntu-setup](https://github.com/apache/incubator-openwhisk/tree/master/tools/ubuntu-setup)
2.   Set the db host in `db_local.init` to be `172.17.0.2`(which I confirm to 
be the ip of couchdb container)
3.   Then it gets stuck and I find the url wrong.

## Provide the expected results and outputs:

Expected 

It should detect the couchdb running on `http://172.17.0.2:5984`.


## Provide the actual results and outputs:
It tries to connect to `http://172.17.0.1:5984/_utils/` instead of 
`http://172.17.0.2:5984/_utils/`. An extra info is that when I do `curl 
http://172.17.0.2:5984/_utils/' ` instead of accessing it directly in the 
browser, it will return the following page saying I should enable javascript, 
but the status is 200 so I guess it's not a big issue.

```
<!--
// Licensed under the Apache License, Version 2.0 (the "License"); you may not
// use this file except in compliance with the License. You may obtain a copy of
// the License at
//
//   http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations under
// the License.
-->
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width,initial-scale=1">
  <meta http-equiv="Content-Language" content="en" />
  <link rel="shortcut icon" type="image/png" 
href="dashboard.assets/img/couchdb-logo.png"/>
  <title>Project Fauxton</title>

  <!-- Application styles. -->
  <style>
    .noscript-warning {
      font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
      padding: 1px 30px 10px 30px;
      color: #fff;
      background: @brandHighlight;
      margin: 100px;
      box-shadow: 2px 2px 5px #989898;
    }
  </style>

<link href="dashboard.assets/css/styles.d8020f4f946fe9d53787.css" 
rel="stylesheet"></head>

<body id="home">

  <noscript>
    <div class="noscript-warning">
      <h1>Please turn on JavaScript</h1>
      <p>Fauxton <strong>requires</strong> JavaScript to be enabled.</p>
    </div>
  </noscript>


  <div id="app"></div>

 <!-- Fauxton Release : 2018-07-08T21:27:27.776Z -->
<script type="text/javascript" 
src="dashboard.assets/js/manifest.3b43389dab4a50af4142.js"></script><script 
type="text/javascript" 
src="dashboard.assets/js/vendor.3d490a2718d0a2fa03f1.js"></script><script 
type="text/javascript" 
src="dashboard.assets/js/bundle.d8020f4f946fe9d53787.js"></script></body>
</html>
```

## Additional information you deem important:
* *issue happens only occasionally or under certain circumstances*
  No. It gets stuck every time. Am I using couchdb in a wrong way?
* changes you did or observed in the environment


[ Full content available at: 
https://github.com/apache/incubator-openwhisk/issues/3987 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to