title: Can't connect: Containerized Bitbucket -> Containerized Postgres (On CentOs Stream)
body: <p>I am trying to containerize the Atlassian tool set (Jira, Bitbucket, Confluence, Bamboo) and back it with Postgresql.</p>
  <p><strong>I am a Docker newbie</strong>. Although I learned a lot today alone...</p>
  <p><em><strong>TLDR - I cannot get the Bitbucket wizard to accept the connection to Postgresql. I also do not have access to Kubernetes.</strong></em></p>
  <p><em><strong>Note: I did use the --add-host=host.docker.internal:host.gateway to both containers. IS THIS A PROBLEM?!</strong></em></p>
  <ul>
  <li>I created and started the two necessary containers</li>
  </ul>
  <p>​</p>
  <pre><code>$ sudo docker ps
  CONTAINER ID   IMAGE                 COMMAND                  CREATED          STATUS          PORTS                                                                                  NAMES
  bba43f9e9aa6   atlassian/bitbucket   &quot;/usr/bin/tini -- /e…&quot;   50 minutes ago   Up 50 minutes   0.0.0.0:7990-&gt;7990/tcp, :::7990-&gt;7990/tcp, 0.0.0.0:7999-&gt;7999/tcp, :::7999-&gt;7999/tcp   bitbucket-docker
  050df8a05cce   postgres              &quot;docker-entrypoint.s…&quot;   54 minutes ago   Up 54 minutes   0.0.0.0:5432-&gt;5432/tcp, :::5432-&gt;5432/tcp                                              postgres-docker
  </code></pre>
  <ul>
  <li>I created a docker network and connected both containers to it</li>
  </ul>
  <p>​</p>
  <pre><code>[erik@localhost volumes]$ sudo docker network inspect atlassian-network
  [
      {
          &quot;Name&quot;: &quot;atlassian-network&quot;,
          &quot;Id&quot;: &quot;eb45fe5a08280ea0aacb9ee107edf26b9df690398d8e7e0db2d188662120d69a&quot;,
          &quot;Created&quot;: &quot;2022-05-13T12:31:30.417700947-04:00&quot;,
          &quot;Scope&quot;: &quot;local&quot;,
          &quot;Driver&quot;: &quot;bridge&quot;,
          &quot;EnableIPv6&quot;: false,
          &quot;IPAM&quot;: {
              &quot;Driver&quot;: &quot;default&quot;,
              &quot;Options&quot;: {},
              &quot;Config&quot;: [
                  {
                      &quot;Subnet&quot;: &quot;172.18.0.0/16&quot;,
                      &quot;Gateway&quot;: &quot;172.18.0.1&quot;
                  }
              ]
          },
          &quot;Internal&quot;: false,
          &quot;Attachable&quot;: false,
          &quot;Ingress&quot;: false,
          &quot;ConfigFrom&quot;: {
              &quot;Network&quot;: &quot;&quot;
          },
          &quot;ConfigOnly&quot;: false,
          &quot;Containers&quot;: {
              &quot;050df8a05cce53044cba9ab9b2aab80088c264228fc9e357077d60209db59e02&quot;: {
                  &quot;Name&quot;: &quot;postgres-docker&quot;,
                  &quot;EndpointID&quot;: &quot;1250dd25a1dc39faf9f56d2cb70b0b21922068840097c17c213b944b3d1e952b&quot;,
                  &quot;MacAddress&quot;: &quot;02:42:ac:12:00:02&quot;,
                  &quot;IPv4Address&quot;: &quot;172.18.0.2/16&quot;,
                  &quot;IPv6Address&quot;: &quot;&quot;
              },
              &quot;bba43f9e9aa6e677eb970734a2d16e955ceeff2f0e2ae328f50d377f74cd6a53&quot;: {
                  &quot;Name&quot;: &quot;bitbucket-docker&quot;,
                  &quot;EndpointID&quot;: &quot;ddcb259a4f5f217f144aa09fb99f059e9000a0c7afdcf8c2f0f4979479f7a5c4&quot;,
                  &quot;MacAddress&quot;: &quot;02:42:ac:12:00:03&quot;,
                  &quot;IPv4Address&quot;: &quot;172.18.0.3/16&quot;,
                  &quot;IPv6Address&quot;: &quot;&quot;
              }
          },
          &quot;Options&quot;: {},
          &quot;Labels&quot;: {}
      }
  ]
  </code></pre>
  <ul>
  <li>I used the postgres client to test the connection from the Bitbucket container(bba) to the Postgres container(050)</li>
  </ul>
  <p>​</p>
  <pre><code>root@bba43f9e9aa6:/var/atlassian/application-data/bitbucket# pg_isready -d bitbucket -h postgres-docker -p 5432 -U atlassian_user
  postgres-docker:5432 - accepting connections
  </code></pre>
  <p>**************************************</p>
  <ul>
  <li>The Bitbucket wizard (on 172.18.0.3:7990)
  <ul>
  <li>The configuration entered is not valid. A database connection could not be established. Please check your configuration and try again.</li>
  </ul>
  </li>
  </ul>
  <p>**************************************</p>
  <p>​</p>
  <p>Database -&gt; ExternalType -&gt; PostgreSQLHost-&gt; postgres-dockerPort-&gt; 5432DB Name -&gt; bitbucketDB User -&gt; atlassian_userDB Pass -&gt; pass</p>
  <p>​</p>
  <ul>
  <li>Some more debugging...</li>
  </ul>
  <p>​</p>
  <pre><code>root@050df8a05cce:/# psql bitbucket -U atlassian_user
  psql (14.2 (Debian 14.2-1.pgdg110+1))
  Type &quot;help&quot; for help.
  
  bitbucket=# \conninfo
  You are connected to database &quot;bitbucket&quot; as user &quot;atlassian_user&quot; via socket in &quot;/var/run/postgresql&quot; at port &quot;5432&quot;.
  
  root@050df8a05cce:/# ping bitbucket-docker
  PING bitbucket-docker (172.18.0.3) 56(84) bytes of data.
  64 bytes from bitbucket-docker.atlassian-network (172.18.0.3): icmp_seq=1 ttl=64 time=0.519 ms
  64 bytes from bitbucket-docker.atlassian-network (172.18.0.3): icmp_seq=2 ttl=64 time=0.188 ms
  64 bytes from bitbucket-docker.atlassian-network (172.18.0.3): icmp_seq=3 ttl=64 time=0.267 ms
  
  $ sudo docker ps
  CONTAINER ID   IMAGE                 COMMAND                  CREATED             STATUS             PORTS                                                                                  NAMES
  bba43f9e9aa6   atlassian/bitbucket   &quot;/usr/bin/tini -- /e…&quot;   About an hour ago   Up About an hour   0.0.0.0:7990-&gt;7990/tcp, :::7990-&gt;7990/tcp, 0.0.0.0:7999-&gt;7999/tcp, :::7999-&gt;7999/tcp   bitbucket-docker
  050df8a05cce   postgres              &quot;docker-entrypoint.s…&quot;   About an hour ago   Up About an hour   0.0.0.0:5432-&gt;5432/tcp, :::5432-&gt;5432/tcp                                              postgres-docker
  </code></pre>