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

SNOW-379300: Exception when switching from jdk 15 to jdk 16 #533

Closed
rmanibus opened this issue Jul 6, 2021 · 33 comments
Closed

SNOW-379300: Exception when switching from jdk 15 to jdk 16 #533

rmanibus opened this issue Jul 6, 2021 · 33 comments
Assignees
Labels

Comments

@rmanibus
Copy link

rmanibus commented Jul 6, 2021

I'm running a simple query with the snowflake jdbc.

    try (Connection connection = manufDatasource.getConnection()){
      try(Statement statement = connection.createStatement()){
        try(ResultSet resultSet = statement.executeQuery("select distinct COL1, COL2 from \"THE_TABLE\"")){
          Set<Network.SubEntity> result = new HashSet<>();
          while (resultSet.next()) {
            result.add(new Network.SubEntity(resultSet.getLong(1), resultSet.getString(2)));
          }
          return result;
        }
      }
    }

it is working with the jdk 15. When I try with the jdk 16 I'm facing the following exception:

org.jboss.resteasy.spi.UnhandledException: net.snowflake.client.jdbc.SnowflakeSQLLoggedException: JDBC driver internal error: Fail to retrieve row count for first arrow chunk: null.
        at org.jboss.resteasy.core.ExceptionHandler.handleApplicationException(ExceptionHandler.java:106)
        at org.jboss.resteasy.core.ExceptionHandler.handleException(ExceptionHandler.java:372)
        at org.jboss.resteasy.core.SynchronousDispatcher.writeException(SynchronousDispatcher.java:218)
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:519)
        at org.jboss.resteasy.core.SynchronousDispatcher.lambda$invoke$4(SynchronousDispatcher.java:261)
        at org.jboss.resteasy.core.SynchronousDispatcher.lambda$preprocess$0(SynchronousDispatcher.java:161)
        at org.jboss.resteasy.core.interception.jaxrs.PreMatchContainerRequestContext.filter(PreMatchContainerRequestContext.java:364)
        at org.jboss.resteasy.core.SynchronousDispatcher.preprocess(SynchronousDispatcher.java:164)
        at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:247)
        at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:
@github-actions github-actions bot changed the title Exception when switching from jdk 15 to jdk 16 SNOW-379300: Exception when switching from jdk 15 to jdk 16 Jul 6, 2021
@markslater
Copy link
Contributor

This StackOverflow answer solved the problem for me. Specifically, execute this prior to querying:

ALTER SESSION SET JDBC_QUERY_RESULT_FORMAT='JSON'

@jcpsantiago
Copy link

Starting the JVM with J-Djdk.module.illegalAccess=permit worked for me. Can't find the link to the original answer anymore unfortunately.

@rmanibus
Copy link
Author

Thank you for the workaround !

@pyzhou-talend
Copy link

Hello,
Thanks for the workaround, but we still want a fix for this issue. As in our product, we cannot ask our user to run ALTER SESSION SET JDBC_QUERY_RESULT_FORMAT='JSON' in every session.

@rmanibus
Copy link
Author

rmanibus commented Sep 14, 2021

This is blocked by https://issues.apache.org/jira/browse/ARROW-12747

Maybe allowing to set the result format in the connection string can help ?

@pyzhou-talend
Copy link

Yes. I think that will help

@mdiskin
Copy link

mdiskin commented Sep 15, 2021

Java17 is now GA'd.
https://www.oracle.com/news/announcement/oracle-releases-java-17-2021-09-14/

So is there an ETA on snowflake support or atleast correct their requirement statement:

The Snowflake JDBC driver requires Java 1.8 or higher.

to:
The Snowflake JDBC driver requires Java 1.8 thru' Java15.

@teosbb
Copy link

teosbb commented Feb 16, 2022

any updates on this ?

@iamzafar
Copy link

@sfc-gh-wfateem will you be able to provide the ETA on this?

@sfc-gh-wfateem
Copy link
Collaborator

Hi @iamzafar,
We're blocked because of this issue:
ARROW-12747

It's actually the code responsible for the problem.

In the meantime, you can work around this in JDK 16 by adding the following JVM argument to your application:
-Djdk.module.illegalAccess=permit

This will not work unfortunately in JDK 17 because they finally removed that altogether.

@sfc-gh-wfateem
Copy link
Collaborator

@iamzafar it looks like you can also work around this in JDK 17 by adding the following Java option:
--add-opens java.base/java.nio=ALL-UNNAMED

@iamzafar
Copy link

Hi @sfc-gh-wfateem,
Thanks for the replay. Using JVM commands is not a viable or secure thing to do. It's actually can be a security issue, especially for applications in production during the runtime. How about this #682?

@sfc-gh-wfateem
Copy link
Collaborator

I'm looking into this @iamzafar

@sfc-gh-wfateem
Copy link
Collaborator

I cloned that PR locally and tested it. It doesn't work.
It's quite a big leap in Arrow's version, but it looks like we need to also add the arrow-memory-netty dependency. I was working on this at my end, and got the dependencies sorted out, but I found out that now the new Arrow library is instead causing the issue and not Netty:
https://github.com/apache/arrow/blob/apache-arrow-6.0.0/java/memory/memory-core/src/main/java/org/apache/arrow/memory/util/MemoryUtil.java#L84

The error I got was:
Caused by: java.lang.RuntimeException: Failed to initialize MemoryUtil. at net.snowflake.client.jdbc.internal.apache.arrow.memory.util.MemoryUtil.<clinit>(MemoryUtil.java:136) ... 17 more Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field long java.nio.Buffer.address accessible: module java.base does not "opens java.nio" to unnamed module @3c60b7e7 at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354) at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297) at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178) at java.base/java.lang.reflect.Field.setAccessible(Field.java:172) at net.snowflake.client.jdbc.internal.apache.arrow.memory.util.MemoryUtil.<clinit>(MemoryUtil.java:84)

Now MemoryUtil in Arrow is using reflection.

@caine-li
Copy link

caine-li commented May 7, 2022

communications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

@vkopichenko
Copy link

The ARROW-12747 blocker was finally resolved: #589 (comment)

@rmanibus
Copy link
Author

That's great news !

@nberney
Copy link

nberney commented May 21, 2022

You can add the following 2 settings in the following file (macOS)
/Applications/DBeaver.app/Contents/Eclipse/dbeaver.ini

-Djdk.module.illegalAccess=permit
--add-opens=java.base/java.nio=ALL-UNNAMED

Information from: https://support.dbvis.com/support/solutions/articles/1000309803-snowflake-fail-to-retrieve-row-count-for-first-arrow-chunk-


Another alternative that worked for me on my MAC M1, is to use JDK11

brew install openjdk@11

Edit: /Applications/DBeaver.app/Contents/Eclipse/dbeaver.ini this line:
../Eclipse/jre/Contents/Home/bin/java change to /opt/homebrew/opt/openjdk@11/bin/java

Restart dbeaver

@vkopichenko
Copy link

The issue can be marked as resolved since 3.13.19 snowflake-jdbc driver version.

@jcpsantiago
Copy link

Still doesn't work for me with AdoptOpenJDK 16 @vkopichenko

@vkopichenko
Copy link

Oh. It seems I got deceived by long-awaited eager expectations.
Sorry for spammy false alarm.

We'll have to await a bit more for another Arrow upgrade from 7.0.0 to 8.0.0: #589 (comment)

@sfc-gh-wfateem
Copy link
Collaborator

sfc-gh-wfateem commented May 31, 2022

This should be addressed in #1017

@segiddins
Copy link

It would be awesome to get a new release off of master so we can use arrow 8 & retry updating our service to JDK 17!

@datanrd
Copy link

datanrd commented Jul 8, 2022

After upgrading to 3.13.20 we are still seeing errors with JDK 17

java.lang.ExceptionInInitializerError: null
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.UnsafeAllocationManager.<clinit>(UnsafeAllocationManager.java:27)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.DefaultAllocationManagerFactory.<clinit>(DefaultAllocationManagerFactory.java:26)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:375)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.DefaultAllocationManagerOption.getFactory(DefaultAllocationManagerOption.java:111)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.DefaultAllocationManagerOption.getDefaultAllocationManagerFactory(DefaultAllocationManagerOption.java:101)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.BaseAllocator$Config.getAllocationManagerFactory(BaseAllocator.java:735)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.ImmutableConfig.access$801(ImmutableConfig.java:24)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.ImmutableConfig$InitShim.getAllocationManagerFactory(ImmutableConfig.java:83)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.ImmutableConfig.<init>(ImmutableConfig.java:47)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.ImmutableConfig.<init>(ImmutableConfig.java:24)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.ImmutableConfig$Builder.build(ImmutableConfig.java:485)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.BaseAllocator.<clinit>(BaseAllocator.java:63)
	at net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:560)
	at net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:479)
	at net.snowflake.client.core.SFResultSetFactory.getResultSet(SFResultSetFactory.java:29)
	at net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:220)
	at net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:135)
	at net.snowflake.client.core.SFStatement.execute(SFStatement.java:768)
	at net.snowflake.client.core.SFStatement.execute(SFStatement.java:678)
	at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:238)
	at net.snowflake.client.jdbc.SnowflakePreparedStatementV1.executeQuery(SnowflakePreparedStatementV1.java:117)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
	at io.opentracing.contrib.jdbc.TracingPreparedStatement.executeQuery(TracingPreparedStatement.java:62)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.opentracing.contrib.common.WrapperProxy$1.invoke(WrapperProxy.java:73)
	at jdk.proxy2/jdk.proxy2.$Proxy264.executeQuery(Unknown Source)
	at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:722)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:713)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:744)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:757)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:815)
	at com.reece.platform.products.pdw.repository.DataWarehouseRepository.getChangedProducts(DataWarehouseRepository.java:46)
	at com.reece.platform.products.pdw.repository.DataWarehouseRepository$$FastClassBySpringCGLIB$$36bc6300.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
	at com.reece.platform.products.pdw.repository.DataWarehouseRepository$$EnhancerBySpringCGLIB$$3c90c8c9.getChangedProducts(<generated>)
	at com.reece.platform.products.search.CreateIndexService.loadChangedProducts(CreateIndexService.java:145)
	at com.reece.platform.products.search.CreateIndexService.updateCurrentEngine(CreateIndexService.java:99)
	at com.reece.platform.products.controller.JobsController.updateIndex(JobsController.java:31)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:920)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:684)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at io.opentracing.contrib.web.servlet.filter.TracingFilter.doFilter(TracingFilter.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.RuntimeException: Failed to initialize MemoryUtil.
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.util.MemoryUtil.<clinit>(MemoryUtil.java:139)
	... 108 common frames omitted
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make field long java.nio.Buffer.address accessible: module java.base does not "opens java.nio" to unnamed module @5a4aa2f2
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
	at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
	at java.base/java.lang.reflect.Field.checkCanSetAccessible(Field.java:178)
	at java.base/java.lang.reflect.Field.setAccessible(Field.java:172)
	at net.snowflake.client.jdbc.internal.apache.arrow.memory.util.MemoryUtil.<clinit>(MemoryUtil.java:87)
	... 108 common frames omitted

...

net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver internal error: exception creating result java.lang.ExceptionInInitializerError at net.snowflake.client.jdbc.internal.apache.arrow.memory.UnsafeAllocationManager.<clinit>(UnsafeAllocationManager.java:27).
	at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:245)
	at net.snowflake.client.jdbc.SnowflakePreparedStatementV1.executeQuery(SnowflakePreparedStatementV1.java:117)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
	at io.opentracing.contrib.jdbc.TracingPreparedStatement.executeQuery(TracingPreparedStatement.java:62)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at io.opentracing.contrib.common.WrapperProxy$1.invoke(WrapperProxy.java:73)
	at jdk.proxy2/jdk.proxy2.$Proxy264.executeQuery(Unknown Source)
	at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:722)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:651)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:713)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:744)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:757)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:815)
	at com.reece.platform.products.pdw.repository.DataWarehouseRepository.getChangedProducts(DataWarehouseRepository.java:46)
	at com.reece.platform.products.pdw.repository.DataWarehouseRepository$$FastClassBySpringCGLIB$$36bc6300.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:783)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:753)
	at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:698)
	at com.reece.platform.products.pdw.repository.DataWarehouseRepository$$EnhancerBySpringCGLIB$$3c90c8c9.getChangedProducts(<generated>)
	at com.reece.platform.products.search.CreateIndexService.loadChangedProducts(CreateIndexService.java:145)
	at com.reece.platform.products.search.CreateIndexService.updateCurrentEngine(CreateIndexService.java:99)
	at com.reece.platform.products.controller.JobsController.updateIndex(JobsController.java:31)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:568)
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205)
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:150)
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:117)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:808)
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1067)
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:963)
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
	at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:920)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:684)
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:764)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:227)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:96)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:117)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at io.opentracing.contrib.web.servlet.filter.TracingFilter.doFilter(TracingFilter.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:189)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:162)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:197)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:97)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:135)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:78)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:360)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:399)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:889)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1743)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.base/java.lang.Thread.run(Thread.java:833)

@sfc-gh-wfateem
Copy link
Collaborator

Yes, I can confirm that the problem still occurs. Not sure what happened here, because Apache Arrow highlighted that this was fixed in 8.0. We'll need to dig into this a bit more.
Thanks for reporting this @datanrd

@sfc-gh-sghosh
Copy link
Contributor

Hi @sfc-gh-wfateem ,

Another customer also reported the same problem. I mentioned details in JIRA SNOW-379300.

Thanks,
Sujan

@sfc-gh-wfateem
Copy link
Collaborator

sfc-gh-wfateem commented Jul 11, 2022

It looks like that fix in Arrow v8.0 was just simply a workaround:
https://github.com/apache/arrow/pull/12941/files#r856290120
So we're still forced to use the workarounds discussed previously.

@olvgrolle
Copy link

olvgrolle commented Jul 25, 2022

can confirm that M1 CPU, snowflake jdbc [3.13.21] and jre17 (i.e. dbeaver Version 22.1.3.202207240747) still not functional.
downgrading to jre11 works as workaround.

might be because pom.xml for snowflake jdbc 3.13.21 still shows:
"<jna.version>5.5.0</jna.version>" as dependency - which is known to not work on M1.

-> related to: SNOW-349075: Upgrade JNA to support arm64-macos architecture
which asks for JNA-5.5.0 to be upgrade to JNA-5.7.0 minimally. JNA-5.11.0 fixes another aarch64 (M1) bug.

@Komdosh
Copy link
Contributor

Komdosh commented Aug 17, 2022

Same here, got this error on JDK 17

@rmanibus
Copy link
Author

Hello @sfc-gh-wfateem, do you have any ETA about this ?
It is causing a lot of pain in our ecosystem because we have some other problems that we could solve by upgrading to 17.
My client is starting to consider switching from snowflake to another DB because of that !

@IRus
Copy link

IRus commented Aug 17, 2022

Apache Arrow are not going to fix it. You can switch to using JSON in response, but I'll assume for huge selects it will work slower and network load will be higher.

@sfc-gh-wfateem
Copy link
Collaborator

@rmanibus @IRus please refer to my comment here.

dKatechev pushed a commit to dKatechev/vividus-build-system that referenced this issue Jan 12, 2023
valfirst pushed a commit to vividus-framework/vividus-build-system that referenced this issue Jan 12, 2023
Root cause: snowflakedb/snowflake-jdbc#533

Co-authored-by: Dzmitry Katsechau <Dzmitry_Katsechau@epam.com>
@sfc-gh-igarish
Copy link
Collaborator

Please follow-up using #589. So closing this issue as both are similar issues and comments. If anyone feels otherwise, please reopen it.

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

No branches or pull requests