Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.net.ConnectException: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:8080 #11208

Closed
walter-weinmann opened this issue Feb 26, 2022 · 3 comments

Comments

@walter-weinmann
Copy link

walter-weinmann commented Feb 26, 2022

The problem occurs in versions 369, 370 and 371 with MySQL, Oracle, PostgreSQL and SQL Server.

I have tested all versions from 364 to 368 and found no problem.

Unfortunately, I cannot find a reason for the problem in the release notes for versions 369 to 371.

    2022-02-26 03:19:29,180 [DatabaseSeeder.java] INFO  Start MySQL Database via trino
    2022-02-26 03:19:29,184 [AbstractDbmsSeeder.java] INFO  tickerSymbolIntern =mysql
    2022-02-26 03:19:29,191 [AbstractJdbcSeeder.java] INFO  tickerSymbolExtern =mysql_trino
    java.sql.SQLException: Error executing query
    at io.trino.jdbc.TrinoStatement.internalExecute(TrinoStatement.java:287)
    at io.trino.jdbc.TrinoStatement.execute(TrinoStatement.java:240)
    at ch.konnexions.db_seeder.jdbc.AbstractJdbcSeeder.executeSQLStmnts(AbstractJdbcSeeder.java:1367)
    at ch.konnexions.db_seeder.jdbc.mysql.MysqlSeeder.setupDatabase(MysqlSeeder.java:143)
    at ch.konnexions.db_seeder.jdbc.AbstractJdbcSeeder.createData(AbstractJdbcSeeder.java:410)
    at ch.konnexions.db_seeder.DatabaseSeeder.main(DatabaseSeeder.java:202)
    Caused by: java.io.UncheckedIOException: java.net.ConnectException: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:8080
    at io.trino.jdbc.$internal.client.JsonResponse.execute(JsonResponse.java:148)
    at io.trino.jdbc.$internal.client.StatementClientV1.<init>(StatementClientV1.java:109)
    at io.trino.jdbc.$internal.client.StatementClientFactory.newStatementClient(StatementClientFactory.java:24)
    at io.trino.jdbc.TrinoConnection.startQuery(TrinoConnection.java:750)
    at io.trino.jdbc.TrinoStatement.internalExecute(TrinoStatement.java:252)
    ... 5 more
    Caused by: java.net.ConnectException: Failed to connect to localhost/[0:0:0:0:0:0:0:1]:8080
    at io.trino.jdbc.$internal.okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:265)
    at io.trino.jdbc.$internal.okhttp3.internal.connection.RealConnection.connect(RealConnection.java:183)
    at io.trino.jdbc.$internal.okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:224)
    at io.trino.jdbc.$internal.okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:108)
    at io.trino.jdbc.$internal.okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:88)
    at io.trino.jdbc.$internal.okhttp3.internal.connection.Transmitter.newExchange(Transmitter.java:169)
    at io.trino.jdbc.$internal.okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:41)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at io.trino.jdbc.$internal.okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at io.trino.jdbc.$internal.okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at io.trino.jdbc.$internal.client.OkHttpUtil.lambda$userAgent$0(OkHttpUtil.java:69)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
    at io.trino.jdbc.$internal.okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
    at io.trino.jdbc.$internal.okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
    at io.trino.jdbc.$internal.okhttp3.RealCall.execute(RealCall.java:81)
    at io.trino.jdbc.$internal.client.JsonResponse.execute(JsonResponse.java:130)
    ... 9 more
    Caused by: java.net.ConnectException: Connection refused: no further information
    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 io.trino.jdbc.$internal.okhttp3.internal.platform.Platform.connectSocket(Platform.java:130)
    at io.trino.jdbc.$internal.okhttp3.internal.connection.RealConnection.connectSocket(RealConnection.java:263)
    ... 31 more

@ebyhr
Copy link
Member

ebyhr commented Feb 26, 2022

Can you share the steps to reproduce? It would be nice if you can prepare simple steps without your library.
Also, you are listing some remote databases, but I think they are unrelated because the issue looks happening between Trino JDBC driver and Trino server.

@walter-weinmann
Copy link
Author

I found my problem in the Release Notes (369):

Remove distinction between system and user memory to simplify cluster configuration. The configuration property query.max-total-memory-per-node is removed. Use query.max-memory-per-node instead. (#10574)

@samer1977
Copy link

Hi,

Im my case I got this error because I was running Trino on different port and ip than 8080 and localhost. It turns out the Trino CLI has its own server configuration that can be set using the following bash command :
trino --server=http://<trinp-ip>:<port-number>

Once I did that the CLI started working as expected. Im surprised that there is nothing that talks about this out there despite I have seen few posts complaining about the same issue. Hopefully this will help in saving others the time and effort that I had to go through.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants