Hi! I have a Rancher Server online that I set up to do some test a while ago. It uses an external mysql database.
Today I tried updating it (a big jump from 0.5.1 to 1.0.0), but it fails to connect to the database. I haven’t change anything, and I can connect to the db with mysql workbench.
I haven’t used it in a while, so it’s possible that I’m making some very stupid mistake.
This is the command I use:
docker run -p 8080:8080 --restart=always -d -e CATTLE_DB_CATTLE_MYSQL_HOST=rancherserver.cfpar5g3f1gu.us-east-1.rds.amazonaws.com -e CATTLE_DB_CATTLE_MYSQL_NAME=db -e CATTLE_DB_CATTLE_USERNAME=user -e CATTLE_DB_CATTLE_PASSWORD=password rancher/server
And this is the exception I get:
[pollingConfigurationSource] ERROR i.c.p.a.sources.LazyJDBCSource - Failed to get connection to database, will retry for 5 minutes
org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Could not connect to address=(host=rancherserver.cfpar5g3f1gu.us-east-1.rds.amazonaws.com)(port=3306)(type=master) : connect timed out)
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1549) ~[commons-dbcp-1.4.jar:1.4]
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1388) ~[commons-dbcp-1.4.jar:1.4]
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) ~[commons-dbcp-1.4.jar:1.4]
at io.cattle.platform.archaius.sources.LazyJDBCSource.checkInitial(LazyJDBCSource.java:50) [cattle-framework-archaius-0.5.0-SNAPSHOT.jar:na]
at io.cattle.platform.archaius.sources.LazyJDBCSource.poll(LazyJDBCSource.java:34) [cattle-framework-archaius-0.5.0-SNAPSHOT.jar:na]
at com.netflix.config.AbstractPollingScheduler$1.run(AbstractPollingScheduler.java:163) [archaius-core-0.5.14.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [na:1.7.0_95]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:304) [na:1.7.0_95]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:178) [na:1.7.0_95]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [na:1.7.0_95]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_95]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_95]
at java.lang.Thread.run(Thread.java:745) [na:1.7.0_95]
Caused by: java.sql.SQLNonTransientConnectionException: Could not connect to address=(host=rancherserver.cfpar5g3f1gu.us-east-1.rds.amazonaws.com)(port=3306)(type=master) : connect timed out
at org.mariadb.jdbc.internal.util.ExceptionMapper.get(ExceptionMapper.java:123) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.internal.util.ExceptionMapper.throwException(ExceptionMapper.java:69) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.Driver.connect(Driver.java:110) ~[mariadb-java-client-1.3.4.jar:na]
at org.apache.commons.dbcp.DriverConnectionFactory.createConnection(DriverConnectionFactory.java:38) ~[commons-dbcp-1.4.jar:1.4]
at org.apache.commons.dbcp.PoolableConnectionFactory.makeObject(PoolableConnectionFactory.java:582) ~[commons-dbcp-1.4.jar:1.4]
at org.apache.commons.dbcp.BasicDataSource.validateConnectionFactory(BasicDataSource.java:1556) ~[commons-dbcp-1.4.jar:1.4]
at org.apache.commons.dbcp.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:1545) ~[commons-dbcp-1.4.jar:1.4]
... 12 common frames omitted
Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Could not connect to address=(host=rancherserver.cfpar5g3f1gu.us-east-1.rds.amazonaws.com)(port=3306)(type=master) : connect timed out
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:674) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:580) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.Driver.connect(Driver.java:105) ~[mariadb-java-client-1.3.4.jar:na]
... 16 common frames omitted
Caused by: java.net.SocketTimeoutException: connect timed out
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.7.0_95]
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339) ~[na:1.7.0_95]
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200) ~[na:1.7.0_95]
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182) ~[na:1.7.0_95]
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.7.0_95]
at java.net.Socket.connect(Socket.java:579) ~[na:1.7.0_95]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connect(AbstractConnectProtocol.java:344) ~[mariadb-java-client-1.3.4.jar:na]
at org.mariadb.jdbc.internal.protocol.AbstractConnectProtocol.connectWithoutProxy(AbstractConnectProtocol.java:669) ~[mariadb-java-client-1.3.4.jar:na]
... 18 common frames omitted
Thanks!