Home > Blockchain >  problem installing bamboo trial using docker and connecting to the postgres database on localhost
problem installing bamboo trial using docker and connecting to the postgres database on localhost

Time:04-10

I am trying to run bamboo-server using a docker container and connect it to postgres db that is running on another container. First I run the postgres db and create an empty database named bamboo with a user postgres and password postgres.

Here is a test to show it works and I can connect to it

enter image description here

And I run this commend to run bamboo server from enter image description here

Then I open localhost:8085 and generate a license and reach to this point that I see this error

Error accessing database: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.

enter image description here

What is the problem?

Here is the docker log

C:\Users\aminb>docker logs 9e31ad6a773c
INFO:root:Generating /opt/atlassian/bamboo/conf/server.xml from template server.xml.j2
INFO:root:Generating /opt/atlassian/bamboo/atlassian-bamboo/WEB-INF/classes/seraph-config.xml from template seraph-config.xml.j2
INFO:root:Generating /opt/atlassian/bamboo/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties from template bamboo-init.properties.j2
INFO:root:/var/atlassian/application-data/bamboo/bamboo.cfg.xml exists; skipping.
INFO:root:User is currently root. Will downgrade run user to bamboo
INFO:root:Running Bamboo with command '/opt/atlassian/bamboo/bin/start-bamboo.sh', arguments ['/opt/atlassian/bamboo/bin/start-bamboo.sh', '-fg']

Server startup logs are located in /opt/atlassian/bamboo/logs/catalina.out

Bamboo Data Center
   Version : 8.2.1


If you encounter issues starting or stopping Bamboo Server, please see the Troubleshooting guide at https://confluence.atlassian.com/display/BAMBOO/Installing and upgrading Bamboo

Using BAMBOO_HOME:       /var/atlassian/application-data/bamboo
NOTE: Picked up JDK_JAVA_OPTIONS:  --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.rmi/sun.rmi.transport=ALL-UNNAMED
10-Apr-2022 03:29:59.852 WARNING [main] org.apache.tomcat.util.digester.SetPropertiesRule.begin [SetPropertiesRule]{Server} Setting property 'port' to '' did not find a matching property.
10-Apr-2022 03:30:00.078 WARNING [main] org.apache.catalina.startup.SetAllPropertiesRule.begin [SetAllPropertiesRule]{Server/Service/Connector} Setting property 'proxyPort' to '' did not find a matching property.
10-Apr-2022 03:30:00.117 INFO [main] org.apache.catalina.core.AprLifecycleListener.lifecycleEvent The Apache Tomcat Native library which allows using OpenSSL was not found on the java.library.path: [/usr/java/packages/lib:/usr/lib64:/lib64:/lib:/usr/lib]
10-Apr-2022 03:30:00.142 INFO [main] org.apache.coyote.http11.AbstractHttp11Protocol.configureUpgradeProtocol The ["http-nio-8085"] connector has been configured to support HTTP upgrade to [h2c]
10-Apr-2022 03:30:00.143 INFO [main] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler ["http-nio-8085"]
10-Apr-2022 03:30:00.159 INFO [main] org.apache.catalina.startup.Catalina.load Initialization processed in 363 ms
10-Apr-2022 03:30:00.185 INFO [main] org.apache.catalina.core.StandardService.startInternal Starting service [Catalina]
10-Apr-2022 03:30:00.185 INFO [main] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet engine: [Apache Tomcat/8.5.75]
10-Apr-2022 03:30:05.846 INFO [localhost-startStop-1] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...
10-Apr-2022 03:30:08.657 INFO [main] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler ["http-nio-8085"]
10-Apr-2022 03:30:08.663 INFO [main] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read
10-Apr-2022 03:30:08.681 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 8522 ms

CodePudding user response:

If you don't set network of your docker it will be used bridge mode as default.

I think the problem is you might use {containerName}:5432 instead of localhost:5432 from your JDBC connection string, because localhost mean your container of website instead of real computer, so that you can't connect to DB by that.

jdbc:postgresql://bamboo-pg-db-container:5432/bamboo
  • Related