You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "sunkai-cai (via GitHub)" <gi...@apache.org> on 2023/02/14 03:18:10 UTC

[GitHub] [shardingsphere] sunkai-cai opened a new issue, #24152: Add source database information when throws UnavailableDataSourceException

sunkai-cai opened a new issue, #24152:
URL: https://github.com/apache/shardingsphere/issues/24152

   ## Feature Request
   
   Add source database information when throws UnavailableDataSourceException.
   抛出 UnavailableDataSourceException 时,附加异常的源数据库信息。
   
   ```
   Exception in thread "main" org.apache.shardingsphere.infra.datasource.state.exception.UnavailableDataSourceException: DATA-SOURCE-00001: Data source unavailable.
       at org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions.checkState(ShardingSpherePreconditions.java:41)
       at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.checkState(DataSourceStateManager.java:87)
       at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initState(DataSourceStateManager.java:79)
       at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.lambda$initStates$0(DataSourceStateManager.java:70)
       at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684)
       at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initStates(DataSourceStateManager.java:70)
       at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.lambda$checkDataSourceStates$4(MetaDataContextsFactory.java:114)
       at java.util.HashMap.forEach(HashMap.java:1290)
       at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.checkDataSourceStates(MetaDataContextsFactory.java:112)
       at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:88)
       at org.apache.shardingsphere.mode.manager.cluster.ClusterContextManagerBuilder.build(ClusterContextManagerBuilder.java:59)
       at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:68)
       at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:58)
       at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:52)
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #24152: Add source database information when throws UnavailableDataSourceException

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24152:
URL: https://github.com/apache/shardingsphere/issues/24152#issuecomment-1432682624

   > Exception case:
   > 
   > 0. start MYSQL ("127.0.0.1:3306")
   > 1. start Proxy.
   > 2. CREATE DATABASE `CREATE DATABASE test_db;`
   > 3. REGISTER STORAGE `REGISTER STORAGE UNIT test_db (URL="jdbc:mysql://127.0.0.1:3306/test_db",USER="sharding", PASSWORD="sharding");`
   > 4. stop MYSQL ("127.0.0.1:3306")
   > 5. restart Proxy.
   
   @sunkai-cai Got it, thank you!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sunkai-cai commented on issue #24152: Add source database information when throws UnavailableDataSourceException

Posted by "sunkai-cai (via GitHub)" <gi...@apache.org>.
sunkai-cai commented on issue #24152:
URL: https://github.com/apache/shardingsphere/issues/24152#issuecomment-1434058506

   But I don't know which one source database is unavailable from the log context.
   
   ok, i try to submit a PR;


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sunkai-cai commented on issue #24152: Add source database information when throws UnavailableDataSourceException

Posted by "sunkai-cai (via GitHub)" <gi...@apache.org>.
sunkai-cai commented on issue #24152:
URL: https://github.com/apache/shardingsphere/issues/24152#issuecomment-1429421847

   Exception case:
   
   1. start Proxy.
   2. CREATE DATABASE `CREATE DATABASE test_db;`
   3. REGISTER STORAGE `REGISTER STORAGE UNIT test_db (URL="jdbc:mysql://127.0.0.1:3306/test_db",USER="sharding", PASSWORD="sharding");`
   4. STOP MYSQL ("127.0.0.1:3306")
   5. restart Proxy.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #24152: Add source database information when throws UnavailableDataSourceException

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24152:
URL: https://github.com/apache/shardingsphere/issues/24152#issuecomment-1434182610

   Yes, maybe we can log the dataSourceName.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #24152: Add source database information when throws UnavailableDataSourceException

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24152:
URL: https://github.com/apache/shardingsphere/issues/24152#issuecomment-1434056475

   The log context is already complete, and if the original information is appended, it may cause a sense of duplication.
   
   If you think it would work better with the added info, please submit a PR and we can ask others to take a look.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #24152: Add source database information when throws UnavailableDataSourceException

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24152:
URL: https://github.com/apache/shardingsphere/issues/24152#issuecomment-1434050519

   @sunkai-cai 
   This is the exception log I got. We can see the information of `Connection refused`, which is the original information provided by the driver.
   ```
   com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
   	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
   	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
   	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
   	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:342)
   	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2197)
   	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230)
   	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025)
   	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
   	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
   	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
   	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
   	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
   	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
   	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
   	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
   	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
   	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
   	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
   	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
   	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.checkState(DataSourceStateManager.java:84)
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initState(DataSourceStateManager.java:79)
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.lambda$initStates$0(DataSourceStateManager.java:70)
   	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initStates(DataSourceStateManager.java:70)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.lambda$checkDataSourceStates$4(MetaDataContextsFactory.java:113)
   	at java.base/java.util.HashMap.forEach(HashMap.java:1421)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.checkDataSourceStates(MetaDataContextsFactory.java:111)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:87)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:68)
   	at org.apache.shardingsphere.mode.manager.standalone.StandaloneContextManagerBuilder.build(StandaloneContextManagerBuilder.java:53)
   	at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:69)
   	at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:59)
   	at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:53)
   Caused by: java.net.ConnectException: Connection refused
   	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
   	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
   	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542)
   	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
   	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
   	at java.base/java.net.Socket.connect(Socket.java:633)
   	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
   	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:301)
   	... 34 common frames omitted
   Exception in thread "main" org.apache.shardingsphere.infra.datasource.state.exception.UnavailableDataSourceException: DATA-SOURCE-00001: Data source unavailable.
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.lambda$checkState$1(DataSourceStateManager.java:87)
   	at org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions.checkState(ShardingSpherePreconditions.java:41)
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.checkState(DataSourceStateManager.java:87)
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initState(DataSourceStateManager.java:79)
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.lambda$initStates$0(DataSourceStateManager.java:70)
   	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initStates(DataSourceStateManager.java:70)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.lambda$checkDataSourceStates$4(MetaDataContextsFactory.java:113)
   	at java.base/java.util.HashMap.forEach(HashMap.java:1421)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.checkDataSourceStates(MetaDataContextsFactory.java:111)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:87)
   	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:68)
   	at org.apache.shardingsphere.mode.manager.standalone.StandaloneContextManagerBuilder.build(StandaloneContextManagerBuilder.java:53)
   	at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:69)
   	at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:59)
   	at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:53)
   Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
   	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
   	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
   	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
   	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:342)
   	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2197)
   	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230)
   	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025)
   	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
   	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
   	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
   	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
   	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
   	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
   	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
   	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
   	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
   	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
   	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
   	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
   	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
   	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.checkState(DataSourceStateManager.java:84)
   	... 13 more
   Caused by: java.net.ConnectException: Connection refused
   	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
   	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
   	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542)
   	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
   	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
   	at java.base/java.net.Socket.connect(Socket.java:633)
   	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
   	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:301)
   	... 34 more
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] sunkai-cai commented on issue #24152: Add source database information when throws UnavailableDataSourceException

Posted by "sunkai-cai (via GitHub)" <gi...@apache.org>.
sunkai-cai commented on issue #24152:
URL: https://github.com/apache/shardingsphere/issues/24152#issuecomment-1434052827

   > @sunkai-cai This is the exception log I got. We can see the information of `Connection refused`, which is the original information provided by the driver.
   > 
   > ```
   > com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
   > 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   > 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
   > 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   > 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
   > 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
   > 	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   > 	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
   > 	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:342)
   > 	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2197)
   > 	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230)
   > 	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025)
   > 	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
   > 	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
   > 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   > 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
   > 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   > 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
   > 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
   > 	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   > 	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
   > 	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
   > 	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
   > 	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
   > 	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
   > 	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
   > 	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
   > 	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
   > 	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.checkState(DataSourceStateManager.java:84)
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initState(DataSourceStateManager.java:79)
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.lambda$initStates$0(DataSourceStateManager.java:70)
   > 	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initStates(DataSourceStateManager.java:70)
   > 	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.lambda$checkDataSourceStates$4(MetaDataContextsFactory.java:113)
   > 	at java.base/java.util.HashMap.forEach(HashMap.java:1421)
   > 	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.checkDataSourceStates(MetaDataContextsFactory.java:111)
   > 	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:87)
   > 	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:68)
   > 	at org.apache.shardingsphere.mode.manager.standalone.StandaloneContextManagerBuilder.build(StandaloneContextManagerBuilder.java:53)
   > 	at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:69)
   > 	at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:59)
   > 	at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:53)
   > Caused by: java.net.ConnectException: Connection refused
   > 	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
   > 	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
   > 	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542)
   > 	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
   > 	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
   > 	at java.base/java.net.Socket.connect(Socket.java:633)
   > 	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
   > 	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:301)
   > 	... 34 common frames omitted
   > Exception in thread "main" org.apache.shardingsphere.infra.datasource.state.exception.UnavailableDataSourceException: DATA-SOURCE-00001: Data source unavailable.
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.lambda$checkState$1(DataSourceStateManager.java:87)
   > 	at org.apache.shardingsphere.infra.util.exception.ShardingSpherePreconditions.checkState(ShardingSpherePreconditions.java:41)
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.checkState(DataSourceStateManager.java:87)
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initState(DataSourceStateManager.java:79)
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.lambda$initStates$0(DataSourceStateManager.java:70)
   > 	at java.base/java.util.LinkedHashMap.forEach(LinkedHashMap.java:721)
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.initStates(DataSourceStateManager.java:70)
   > 	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.lambda$checkDataSourceStates$4(MetaDataContextsFactory.java:113)
   > 	at java.base/java.util.HashMap.forEach(HashMap.java:1421)
   > 	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.checkDataSourceStates(MetaDataContextsFactory.java:111)
   > 	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:87)
   > 	at org.apache.shardingsphere.mode.metadata.MetaDataContextsFactory.create(MetaDataContextsFactory.java:68)
   > 	at org.apache.shardingsphere.mode.manager.standalone.StandaloneContextManagerBuilder.build(StandaloneContextManagerBuilder.java:53)
   > 	at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.createContextManager(BootstrapInitializer.java:69)
   > 	at org.apache.shardingsphere.proxy.initializer.BootstrapInitializer.init(BootstrapInitializer.java:59)
   > 	at org.apache.shardingsphere.proxy.Bootstrap.main(Bootstrap.java:53)
   > Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
   > 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   > 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
   > 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   > 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
   > 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
   > 	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   > 	at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:990)
   > 	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:342)
   > 	at com.mysql.jdbc.ConnectionImpl.coreConnect(ConnectionImpl.java:2197)
   > 	at com.mysql.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:2230)
   > 	at com.mysql.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:2025)
   > 	at com.mysql.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:778)
   > 	at com.mysql.jdbc.JDBC4Connection.<init>(JDBC4Connection.java:47)
   > 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
   > 	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
   > 	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
   > 	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
   > 	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
   > 	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
   > 	at com.mysql.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:386)
   > 	at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:330)
   > 	at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
   > 	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:364)
   > 	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
   > 	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:476)
   > 	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:561)
   > 	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
   > 	at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
   > 	at org.apache.shardingsphere.infra.datasource.state.DataSourceStateManager.checkState(DataSourceStateManager.java:84)
   > 	... 13 more
   > Caused by: java.net.ConnectException: Connection refused
   > 	at java.base/sun.nio.ch.Net.pollConnect(Native Method)
   > 	at java.base/sun.nio.ch.Net.pollConnectNow(Net.java:672)
   > 	at java.base/sun.nio.ch.NioSocketImpl.timedFinishConnect(NioSocketImpl.java:542)
   > 	at java.base/sun.nio.ch.NioSocketImpl.connect(NioSocketImpl.java:597)
   > 	at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:327)
   > 	at java.base/java.net.Socket.connect(Socket.java:633)
   > 	at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:211)
   > 	at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:301)
   > 	... 34 more
   > ```
   
   the `UnavailableDataSourceException` message is "DATA-SOURCE-00001: Data source unavailable." ,  We can add more information to it.
   ```
   Exception in thread "main" org.apache.shardingsphere.infra.datasource.state.exception.UnavailableDataSourceException: DATA-SOURCE-00001: Data source unavailable.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang commented on issue #24152: Add source database information when throws UnavailableDataSourceException

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang commented on issue #24152:
URL: https://github.com/apache/shardingsphere/issues/24152#issuecomment-1429236929

   Hi @sunkai-cai 
   Do you have more detailed information?
   If the root cause cannot be found, it is best to provide a reproducible way.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [shardingsphere] RaigorJiang closed issue #24152: Add source database information when throws UnavailableDataSourceException

Posted by "RaigorJiang (via GitHub)" <gi...@apache.org>.
RaigorJiang closed issue #24152: Add source database information when throws UnavailableDataSourceException 
URL: https://github.com/apache/shardingsphere/issues/24152


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org