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

Presto java.net.SocketTimeoutException: timeout java.io.UncheckedIOException: java.net.SocketTimeoutException: timeout #10735

Closed
nimmicv opened this issue May 31, 2018 · 9 comments · Fixed by trinodb/trino#833 or #24466
Labels

Comments

@nimmicv
Copy link

nimmicv commented May 31, 2018

I am trying to execute presto queries from a presto-cli and I am getting the following error

[hadoop@ip-172-16-125-74 ~]$ presto-cli --debug
presto> show schemas from hive.default;
Error running command: java.net.SocketTimeoutException: timeout
java.io.UncheckedIOException: java.net.SocketTimeoutException: timeout
at com.facebook.presto.client.JsonResponse.execute(JsonResponse.java:148)
at com.facebook.presto.client.StatementClient.(StatementClient.java:118)
at com.facebook.presto.cli.QueryRunner.startInternalQuery(QueryRunner.java:102)
at com.facebook.presto.cli.QueryRunner.startQuery(QueryRunner.java:97)
at com.facebook.presto.cli.Console.process(Console.java:336)
at com.facebook.presto.cli.Console.runConsole(Console.java:262)
at com.facebook.presto.cli.Console.run(Console.java:148)
at com.facebook.presto.cli.Presto.main(Presto.java:32)
Caused by: java.net.SocketTimeoutException: timeout
at okio.Okio$4.newTimeoutException(Okio.java:230)
at okio.AsyncTimeout.exit(AsyncTimeout.java:285)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:345)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:217)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:211)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
at okhttp3.RealCall.execute(RealCall.java:69)
at com.facebook.presto.client.JsonResponse.execute(JsonResponse.java:130)
... 7 more
Caused by: java.net.SocketException: Socket closed
at java.net.SocketInputStream.read(SocketInputStream.java:204)
at java.net.SocketInputStream.read(SocketInputStream.java:141)
at okio.Okio$2.read(Okio.java:139)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
... 27 more

@daigexuyu
Copy link

do you have the server.log about the problem? Your error stack is from the presto-cli, but we may find the root cause easier from server side.

@nico-arianto
Copy link

nico-arianto commented Feb 28, 2019

I got the same issue for Presto 0.217 + Hive 2.3.3.

I'm able to query user tables but I'm not able to extract from information_table (e.g show tables).

Here is the stack trace that I got from Presto Web UI:

Error Information:

Error Type | EXTERNAL
Error Code | HIVE_METASTORE_ERROR (16777216)

	at com.facebook.presto.hive.metastore.thrift.ThriftHiveMetastore.getAllViews(ThriftHiveMetastore.java:579)
	at com.facebook.presto.hive.metastore.thrift.BridgingHiveMetastore.getAllViews(BridgingHiveMetastore.java:128)
	at com.facebook.presto.hive.metastore.CachingHiveMetastore.loadAllViews(CachingHiveMetastore.java:369)
	at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:165)
	at com.google.common.cache.CacheLoader$1.load(CacheLoader.java:188)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2273)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2156)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2046)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3943)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3967)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4952)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4958)
	at com.facebook.presto.hive.metastore.CachingHiveMetastore.get(CachingHiveMetastore.java:213)
	at com.facebook.presto.hive.metastore.CachingHiveMetastore.getAllViews(CachingHiveMetastore.java:364)
	at com.facebook.presto.hive.metastore.CachingHiveMetastore.loadAllViews(CachingHiveMetastore.java:369)
	at com.google.common.cache.CacheLoader$FunctionToCacheLoader.load(CacheLoader.java:165)
	at com.google.common.cache.CacheLoader$1.load(CacheLoader.java:188)
	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)
	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2273)
	at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2156)
	at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2046)
	at com.google.common.cache.LocalCache.get(LocalCache.java:3943)
	at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3967)
	at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4952)
	at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4958)
	at com.facebook.presto.hive.metastore.CachingHiveMetastore.get(CachingHiveMetastore.java:213)
	at com.facebook.presto.hive.metastore.CachingHiveMetastore.getAllViews(CachingHiveMetastore.java:364)
	at com.facebook.presto.hive.metastore.SemiTransactionalHiveMetastore.getAllViews(SemiTransactionalHiveMetastore.java:285)
	at com.facebook.presto.hive.HiveMetadata.listViews(HiveMetadata.java:1512)
	at com.facebook.presto.spi.connector.ConnectorMetadata.listViews(ConnectorMetadata.java:444)
	at com.facebook.presto.spi.connector.classloader.ClassLoaderSafeConnectorMetadata.listViews(ClassLoaderSafeConnectorMetadata.java:394)
	at com.facebook.presto.metadata.MetadataManager.listViews(MetadataManager.java:842)
	at com.facebook.presto.metadata.MetadataListing.listViews(MetadataListing.java:71)
	at com.facebook.presto.connector.system.jdbc.TableJdbcTable.cursor(TableJdbcTable.java:98)
	at com.facebook.presto.connector.system.SystemPageSourceProvider$1.cursor(SystemPageSourceProvider.java:124)
	at com.facebook.presto.split.MappedRecordSet.cursor(MappedRecordSet.java:53)
	at com.facebook.presto.spi.RecordPageSource.<init>(RecordPageSource.java:37)
	at com.facebook.presto.connector.system.SystemPageSourceProvider.createPageSource(SystemPageSourceProvider.java:103)
	at com.facebook.presto.split.PageSourceManager.createPageSource(PageSourceManager.java:56)
	at com.facebook.presto.operator.ScanFilterAndProjectOperator.getOutput(ScanFilterAndProjectOperator.java:221)
	at com.facebook.presto.operator.Driver.processInternal(Driver.java:379)
	at com.facebook.presto.operator.Driver.lambda$processFor$8(Driver.java:283)
	at com.facebook.presto.operator.Driver.tryWithLock(Driver.java:675)
	at com.facebook.presto.operator.Driver.processFor(Driver.java:276)
	at com.facebook.presto.execution.SqlTaskExecution$DriverSplitRunner.processFor(SqlTaskExecution.java:1077)
	at com.facebook.presto.execution.executor.PrioritizedSplitRunner.process(PrioritizedSplitRunner.java:162)
	at com.facebook.presto.execution.executor.TaskExecutor$TaskRunner.run(TaskExecutor.java:483)
	at com.facebook.presto.$gen.Presto_0_217____20190228_150817_1.run(Unknown Source)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.thrift.transport.TTransportException: localhost:9083: java.net.SocketTimeoutException: Read timed out
	at com.facebook.presto.hive.metastore.thrift.Transport.rewriteException(Transport.java:91)
	at com.facebook.presto.hive.metastore.thrift.Transport.access$000(Transport.java:32)
	at com.facebook.presto.hive.metastore.thrift.Transport$TTransportWrapper.readAll(Transport.java:168)
	at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:362)
	at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:284)
	at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:191)
	at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.recv_get_table_names_by_filter(ThriftHiveMetastore.java:1282)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Client.get_table_names_by_filter(ThriftHiveMetastore.java:1267)
	at com.facebook.presto.hive.metastore.thrift.ThriftHiveMetastoreClient.getTableNamesByFilter(ThriftHiveMetastoreClient.java:92)
	at com.facebook.presto.hive.metastore.thrift.ThriftHiveMetastore.lambda$getAllViews$28(ThriftHiveMetastore.java:571)
	at com.facebook.presto.hive.metastore.thrift.HiveMetastoreApiStats.lambda$wrap$0(HiveMetastoreApiStats.java:42)
	at com.facebook.presto.hive.RetryDriver.run(RetryDriver.java:139)
	at com.facebook.presto.hive.metastore.thrift.ThriftHiveMetastore.getAllViews(ThriftHiveMetastore.java:568)
	... 51 more
	Suppressed: org.apache.thrift.transport.TTransportException: localhost:9083: java.net.SocketTimeoutException: Read timed out
		... 65 more
	Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
		at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
		at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
		at com.facebook.presto.hive.metastore.thrift.Transport$TTransportWrapper.readAll(Transport.java:165)
		... 62 more
	Caused by: java.net.SocketTimeoutException: Read timed out
		at java.net.SocketInputStream.socketRead0(Native Method)
		at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
		at java.net.SocketInputStream.read(SocketInputStream.java:171)
		at java.net.SocketInputStream.read(SocketInputStream.java:141)
		at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
		at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
		at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
		at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
		... 64 more
	Suppressed: org.apache.thrift.transport.TTransportException: localhost:9083: java.net.SocketTimeoutException: Read timed out
		... 65 more
	Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
		at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
		at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
		at com.facebook.presto.hive.metastore.thrift.Transport$TTransportWrapper.readAll(Transport.java:165)
		... 62 more
	Caused by: java.net.SocketTimeoutException: Read timed out
		at java.net.SocketInputStream.socketRead0(Native Method)
		at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
		at java.net.SocketInputStream.read(SocketInputStream.java:171)
		at java.net.SocketInputStream.read(SocketInputStream.java:141)
		at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
		at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
		at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
		at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
		... 64 more
Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
	at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
	at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
	at com.facebook.presto.hive.metastore.thrift.Transport$TTransportWrapper.readAll(Transport.java:165)
	... 62 more
Caused by: java.net.SocketTimeoutException: Read timed out
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.socketRead(SocketInputStream.java:116)
	at java.net.SocketInputStream.read(SocketInputStream.java:171)
	at java.net.SocketInputStream.read(SocketInputStream.java:141)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
	at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
	at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
	... 64 more```

@nico-arianto
Copy link

I found an error log from the Hive-Metastore when Presto connected:

19/02/28 23:46:17 INFO metastore.HiveMetaStore: 93: source:127.0.0.1 get_table_names_by_filter: db = default, filter = hive_filter_field_params__presto_view = "true"
19/02/28 23:46:17 INFO HiveMetaStore.audit: ugi=hive	ip=127.0.0.1	cmd=source:127.0.0.1 get_table_names_by_filter: db = default, filter = hive_filter_field_params__presto_view = "true"
19/02/28 23:46:17 ERROR metastore.RetryingHMSHandler: HMSHandler Fatal error: javax.jdo.JDOException: Exception thrown when executing query : SELECT A0.TBL_NAME FROM TBLS A0 LEFT OUTER JOIN DBS B0 ON A0.DB_ID = B0.DB_ID INNER JOIN TABLE_PARAMS C0 ON A0.TBL_ID = C0.TBL_ID WHERE C0.PARAM_KEY = 'presto_view' AND B0."NAME" = ? AND C0.PARAM_VALUE = ?
	at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:677)
	at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:391)
	at org.datanucleus.api.jdo.JDOQuery.executeWithMap(JDOQuery.java:279)
	at org.apache.hadoop.hive.metastore.ObjectStore.listTableNamesByFilter(ObjectStore.java:3128)
	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:101)
	at com.sun.proxy.$Proxy6.listTableNamesByFilter(Unknown Source)
	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_table_names_by_filter(HiveMetaStore.java:2163)
	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:148)
	at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
	at com.sun.proxy.$Proxy7.get_table_names_by_filter(Unknown Source)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_table_names_by_filter.getResult(ThriftHiveMetastore.java:11511)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_table_names_by_filter.getResult(ThriftHiveMetastore.java:11495)
	at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
	at org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:110)
	at org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:106)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1762)
	at org.apache.hadoop.hive.metastore.TUGIBasedProcessor.process(TUGIBasedProcessor.java:118)
	at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
NestedThrowablesStackTrace:
java.sql.SQLSyntaxErrorException: Comparisons between 'CLOB (UCS_BASIC)' and 'CLOB (UCS_BASIC)' are not supported. Types must be comparable. String types must also have matching collation. If collation does not match, a possible solution is to cast operands to force them to the default collation (e.g. SELECT tablename FROM sys.systables WHERE CAST(tablename AS VARCHAR(128)) = 'T1')
	at org.apache.derby.client.am.SQLExceptionFactory.getSQLException(Unknown Source)
	at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
	at org.apache.derby.client.am.ClientConnection.prepareStatement(Unknown Source)
	at com.jolbox.bonecp.ConnectionHandle.prepareStatement(ConnectionHandle.java:1193)
	at org.datanucleus.store.rdbms.SQLController.getStatementForQuery(SQLController.java:345)
	at org.datanucleus.store.rdbms.query.RDBMSQueryUtils.getPreparedStatementForQuery(RDBMSQueryUtils.java:211)
	at org.datanucleus.store.rdbms.query.JDOQLQuery.performExecute(JDOQLQuery.java:609)
	at org.datanucleus.store.query.Query.executeQuery(Query.java:1855)
	at org.datanucleus.store.query.Query.executeWithMap(Query.java:1762)
	at org.datanucleus.api.jdo.JDOQuery.executeInternal(JDOQuery.java:372)
	at org.datanucleus.api.jdo.JDOQuery.executeWithMap(JDOQuery.java:279)
	at org.apache.hadoop.hive.metastore.ObjectStore.listTableNamesByFilter(ObjectStore.java:3128)
	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.hive.metastore.RawStoreProxy.invoke(RawStoreProxy.java:101)
	at com.sun.proxy.$Proxy6.listTableNamesByFilter(Unknown Source)
	at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_table_names_by_filter(HiveMetaStore.java:2163)
	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invokeInternal(RetryingHMSHandler.java:148)
	at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:107)
	at com.sun.proxy.$Proxy7.get_table_names_by_filter(Unknown Source)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_table_names_by_filter.getResult(ThriftHiveMetastore.java:11511)
	at org.apache.hadoop.hive.metastore.api.ThriftHiveMetastore$Processor$get_table_names_by_filter.getResult(ThriftHiveMetastore.java:11495)
	at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:39)
	at org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:110)
	at org.apache.hadoop.hive.metastore.TUGIBasedProcessor$1.run(TUGIBasedProcessor.java:106)
	at java.security.AccessController.doPrivileged(Native Method)
	at javax.security.auth.Subject.doAs(Subject.java:422)
	at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1762)
	at org.apache.hadoop.hive.metastore.TUGIBasedProcessor.process(TUGIBasedProcessor.java:118)
	at org.apache.thrift.server.TThreadPoolServer$WorkerProcess.run(TThreadPoolServer.java:286)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: ERROR 42818: Comparisons between 'CLOB (UCS_BASIC)' and 'CLOB (UCS_BASIC)' are not supported. Types must be comparable. String types must also have matching collation. If collation does not match, a possible solution is to cast operands to force them to the default collation (e.g. SELECT tablename FROM sys.systables WHERE CAST(tablename AS VARCHAR(128)) = 'T1')
	at org.apache.derby.client.am.ClientStatement.completeSqlca(Unknown Source)
	at org.apache.derby.client.net.NetStatementReply.parsePrepareError(Unknown Source)
	at org.apache.derby.client.net.NetStatementReply.parsePRPSQLSTTreply(Unknown Source)
	at org.apache.derby.client.net.NetStatementReply.readPrepareDescribeOutput(Unknown Source)
	at org.apache.derby.client.net.StatementReply.readPrepareDescribeOutput(Unknown Source)
	at org.apache.derby.client.net.NetStatement.readPrepareDescribeOutput_(Unknown Source)
	at org.apache.derby.client.am.ClientStatement.readPrepareDescribeOutput(Unknown Source)
	at org.apache.derby.client.am.ClientPreparedStatement.readPrepareDescribeInputOutput(Unknown Source)
	at org.apache.derby.client.am.ClientPreparedStatement.flowPrepareDescribeInputOutput(Unknown Source)
	at org.apache.derby.client.am.ClientPreparedStatement.prepare(Unknown Source)
	at org.apache.derby.client.am.ClientConnection.prepareStatementX(Unknown Source)
	... 35 more

@sudhanshuptl
Copy link

Hi,
I am trying running a query directly in presto CLI that works fine
but when trying to run via command form

prestotde --server *****:8080 --debug --schema ** --catalog hive --source **** --user **** --execute query
then it is throwing error, and issue is for just one specific query only

the query failed, error trace b'Error running command: java.net.SocketTimeoutException: timeout
java.io.UncheckedIOException: java.net.SocketTimeoutException: timeout
    at com.facebook.presto.client.JsonResponse.execute(JsonResponse.java:148)
    at com.facebook.presto.client.StatementClient.<init>(StatementClient.java:118)
    at com.facebook.presto.cli.QueryRunner.startInternalQuery(QueryRunner.java:105)
    at com.facebook.presto.cli.QueryRunner.startQuery(QueryRunner.java:100)
    at com.facebook.presto.cli.Console.process(Console.java:363)
    at com.facebook.presto.cli.Console.executeCommand(Console.java:335)
    at com.facebook.presto.cli.Console.run(Console.java:167)
    at com.facebook.presto.cli.Presto.main(Presto.java:32)
Caused by: java.net.SocketTimeoutException: timeout
    at okio.Okio$4.newTimeoutException(Okio.java:230)
    at okio.AsyncTimeout.exit(AsyncTimeout.java:285)
    at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
    at okio.RealBufferedSource.indexOf(RealBufferedSource.java:345)
    at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:217)
    at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:211)
    at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
    at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:75)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:120)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:92)
    at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:67)
    at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:185)
    at okhttp3.RealCall.execute(RealCall.java:69)
    at com.facebook.presto.client.JsonResponse.execute(JsonResponse.java:130)
    ... 7 more
Caused by: java.net.SocketException: Socket closed
    at java.net.SocketInputStream.read(SocketInputStream.java:204)
    at java.net.SocketInputStream.read(SocketInputStream.java:141)
    at okio.Okio$2.read(Okio.java:139)
    at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
    ... 27 more'```

@nezihyigitbasi
Copy link
Contributor

The root cause is java.net.SocketException: Socket closed, which means that at that instant the thread was trying to read from a socket that's already closed. So, some thread has already closed that socket.

I am not that familiar with okhttp connection management, but one thing I would check is, when the issue happens is a timeout triggered on the client side (connect/read/write timeouts are all 30s, see this)? That may happen if the coordinator is unavailable long enough (say due to a garbage collection pause). This is for checking whether a timeout condition and closing of a socket is correlated.

@sudhanshuptl
Copy link

That issue is resolved it was happening because of presto cli version.
After upgrading presto cli issue was resolved

@georgehdd
Copy link

@nico-arianto @nimmicv were you able to workaround this?

@nico-arianto
Copy link

I solved this by replaced the Derby with PostgreSQL

Reference: nico-arianto/big-data-local#1

@stale
Copy link

stale bot commented Jun 11, 2021

This issue has been automatically marked as stale because it has not had any activity in the last 2 years. If you feel that this issue is important, just comment and the stale tag will be removed; otherwise it will be closed in 7 days. This is an attempt to ensure that our open issues remain valuable and relevant so that we can keep track of what needs to be done and prioritize the right things.

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