Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

MySQL is not connecting. (Driver installed, and logs are in the Details)

Hello! Recently, I just wanted to start a migration, I press on "Migrate" and type in these details.

Afasd.pngNow this is what happens, I cannot connnect!

Here is the logs:

itbucket | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
bitbucket | at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)
bitbucket | at com.atlassian.stash.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:43)
bitbucket | at com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:214)
bitbucket | at com.atlassian.stash.internal.migration.DefaultDatabaseMigrationService.validateConfiguration(DefaultDatabaseMigrationService.java:85)
bitbucket | at com.atlassian.stash.internal.web.admin.DbConfigurationController.testAndMigrateDbConfig(DbConfigurationController.java:97)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.bitbucket.internal.ratelimit.servlet.filter.RateLimitFilter.doFilter(RateLimitFilter.java:75)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.stash.internal.web.auth.AuthorizationFailureInterceptor.doFilterInternal(AuthorizationFailureInterceptor.java:39)
bitbucket | at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:85)
bitbucket | at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:112)
bitbucket | at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75)
bitbucket | at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)
bitbucket | at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)
bitbucket | at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.plugin.connect.plugin.auth.oauth2.DefaultSalAuthenticationFilter.doFilter(DefaultSalAuthenticationFilter.java:69)
bitbucket | at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109)
bitbucket | at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
bitbucket | at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:26)
bitbucket | at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:48)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:90)
bitbucket | at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73)
bitbucket | at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:81)
bitbucket | at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)
bitbucket | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
bitbucket | at java.lang.Thread.run(Thread.java:748)
bitbucket | ... 309 frames trimmed
bitbucket | Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
bitbucket |
bitbucket | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
bitbucket | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
bitbucket | at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
bitbucket | at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
bitbucket | at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:335)
bitbucket | at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187)
bitbucket | at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220)
bitbucket | at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015)
bitbucket | at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768)
bitbucket | at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
bitbucket | at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
bitbucket | at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385)
bitbucket | at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323)
bitbucket | at java.sql.DriverManager.getConnection(DriverManager.java:664)
bitbucket | at java.sql.DriverManager.getConnection(DriverManager.java:208)
bitbucket | at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:155)
bitbucket | at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:146)
bitbucket | at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:205)
bitbucket | at org.springframework.jdbc.datasource.SingleConnectionDataSource.initConnection(SingleConnectionDataSource.java:224)
bitbucket | at org.springframework.jdbc.datasource.SingleConnectionDataSource.getConnection(SingleConnectionDataSource.java:164)
bitbucket | at org.springframework.jdbc.datasource.DelegatingDataSource.getConnection(DelegatingDataSource.java:99)
bitbucket | at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158)
bitbucket | at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116)
bitbucket | at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
bitbucket | ... 36 common frames omitted
bitbucket | Caused by: java.net.ConnectException: Connection refused (Connection refused)
bitbucket | at java.net.PlainSocketImpl.socketConnect(Native Method)
bitbucket | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
bitbucket | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
bitbucket | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
bitbucket | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
bitbucket | at java.net.Socket.connect(Socket.java:607)
bitbucket | at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
bitbucket | at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:299)
bitbucket | ... 55 common frames omitted
bitbucket | 2020-12-18 09:13:16,751 WARN [http-nio-7990-exec-9] SnailDOS @1UI3O4Mx553x54x0 8znbdg 172.19.0.1 "POST /admin/db/edit HTTP/1.0" c.a.s.i.db.DefaultDatabaseManager A connection could not be opened with the DataSource
bitbucket | org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
bitbucket |
bitbucket | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
bitbucket | at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:82)
bitbucket | at com.atlassian.stash.internal.db.DefaultDatabaseValidator.validate(DefaultDatabaseValidator.java:43)
bitbucket | at com.atlassian.stash.internal.db.DefaultDatabaseManager.validateConfiguration(DefaultDatabaseManager.java:214)
bitbucket | at com.atlassian.stash.internal.migration.DefaultDatabaseMigrationService.validateConfiguration(DefaultDatabaseMigrationService.java:85)
bitbucket | at com.atlassian.stash.internal.web.admin.DbConfigurationController.testAndMigrateDbConfig(DbConfigurationController.java:97)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.bitbucket.internal.ratelimit.servlet.filter.RateLimitFilter.doFilter(RateLimitFilter.java:75)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.stash.internal.web.auth.AuthorizationFailureInterceptor.doFilterInternal(AuthorizationFailureInterceptor.java:39)
bitbucket | at com.atlassian.stash.internal.spring.security.StashAuthenticationFilter.doFilter(StashAuthenticationFilter.java:85)
bitbucket | at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doInsideSpringSecurityChain(BeforeLoginPluginAuthenticationFilter.java:112)
bitbucket | at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:75)
bitbucket | at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)
bitbucket | at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.security.auth.trustedapps.filter.TrustedApplicationsFilter.doFilter(TrustedApplicationsFilter.java:94)
bitbucket | at com.atlassian.oauth.serviceprovider.internal.servlet.OAuthFilter.doFilter(OAuthFilter.java:67)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.plugin.connect.plugin.auth.oauth2.DefaultSalAuthenticationFilter.doFilter(DefaultSalAuthenticationFilter.java:69)
bitbucket | at com.atlassian.plugin.connect.plugin.auth.user.ThreeLeggedAuthFilter.doFilter(ThreeLeggedAuthFilter.java:109)
bitbucket | at com.atlassian.jwt.internal.servlet.JwtAuthFilter.doFilter(JwtAuthFilter.java:37)
bitbucket | at com.atlassian.analytics.client.filter.DefaultAnalyticsFilter.doFilter(DefaultAnalyticsFilter.java:26)
bitbucket | at com.atlassian.analytics.client.filter.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:48)
bitbucket | at com.atlassian.stash.internal.spring.lifecycle.LifecycleJohnsonServletFilterModuleContainerFilter.doFilter(LifecycleJohnsonServletFilterModuleContainerFilter.java:42)
bitbucket | at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doBeforeBeforeLoginFilters(BeforeLoginPluginAuthenticationFilter.java:90)
bitbucket | at com.atlassian.stash.internal.web.auth.BeforeLoginPluginAuthenticationFilter.doFilter(BeforeLoginPluginAuthenticationFilter.java:73)
bitbucket | at com.atlassian.stash.internal.request.DefaultRequestManager.doAsRequest(DefaultRequestManager.java:81)
bitbucket | at com.atlassian.stash.internal.hazelcast.ConfigurableWebFilter.doFilter(ConfigurableWebFilter.java:38)
bitbucket | at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
bitbucket | at java.lang.Thread.run(Thread.java:748)
bitbucket | ... 309 frames trimmed
bitbucket | Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
bitbucket |
bitbucket | The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.
bitbucket | at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
bitbucket | at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
bitbucket | at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
bitbucket | at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:335)
bitbucket | at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2187)
bitbucket | at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2220)
bitbucket | at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2015)
bitbucket | at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:768)
bitbucket | at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
bitbucket | at com.mysql.jdbc.Util.handleNewInstance(Util.java:403)
bitbucket | at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:385)
bitbucket | at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:323)
bitbucket | at java.sql.DriverManager.getConnection(DriverManager.java:664)
bitbucket | at java.sql.DriverManager.getConnection(DriverManager.java:208)
bitbucket | at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriverManager(DriverManagerDataSource.java:155)
bitbucket | at org.springframework.jdbc.datasource.DriverManagerDataSource.getConnectionFromDriver(DriverManagerDataSource.java:146)
bitbucket | at org.springframework.jdbc.datasource.AbstractDriverBasedDataSource.getConnectionFromDriver(AbstractDriverBasedDataSource.java:205)
bitbucket | at org.springframework.jdbc.datasource.SingleConnectionDataSource.initConnection(SingleConnectionDataSource.java:224)
bitbucket | at org.springframework.jdbc.datasource.SingleConnectionDataSource.getConnection(SingleConnectionDataSource.java:164)
bitbucket | at org.springframework.jdbc.datasource.DelegatingDataSource.getConnection(DelegatingDataSource.java:99)
bitbucket | at org.springframework.jdbc.datasource.DataSourceUtils.fetchConnection(DataSourceUtils.java:158)
bitbucket | at org.springframework.jdbc.datasource.DataSourceUtils.doGetConnection(DataSourceUtils.java:116)
bitbucket | at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:79)
bitbucket | ... 36 common frames omitted
bitbucket | Caused by: java.net.ConnectException: Connection refused (Connection refused)
bitbucket | at java.net.PlainSocketImpl.socketConnect(Native Method)
bitbucket | at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
bitbucket | at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
bitbucket | at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
bitbucket | at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
bitbucket | at java.net.Socket.connect(Socket.java:607)
bitbucket | at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
bitbucket | at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:299)
bitbucket | ... 55 common frames omitted

 

This is really annoying. I don't know what to do.

Pinging the server works, the MariaDB server is up, and yes, its running on the same device as Bitbucket.

Bitbucket is running a docker container, and the MariaDB is running on the host machine.

1 answer

0 votes
Daniel Ebers Community Leader Dec 25, 2020

Hi Zara,

from "just looking" at the log you posted I'd confirm what Bitbucket is complaining about - the database cannot be reached.

As to the way: it is very hard to pinpoint it from the outside. Further inspection by you on the server will be needed, indeed.

Have you checked if there are more information available from database logfile - otherwise more basic configuration like in Docker and/or some kind of firewall blocking access to the database?

Regards,
Daniel

Hey Daniel,

Thanks for your reply, I don't think its a issue with mysql and instead I think it's a issue with the JBDC driver, do you have a DIRECT download too it?

Daniel Ebers Community Leader Dec 27, 2020

What I can suggest is the following page:
https://confluence.atlassian.com/bitbucketserver/connecting-bitbucket-server-to-mysql-776640382.html

Is this what you were looking for?

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

New improvements to user management in Bitbucket Cloud 👥

Hey Community! We’re willing to wager that quite a few of you not only use Bitbucket, but administer it too. Our team is excited to share that we’ll be releasing improvements throughout this month of...

3,719 views 10 16
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you