timestamp-related error when synching with redshift DB

So, I've setup a new redshift datasource, and can connect to (and query) my redshift DB without issues; however, I cannot browse the DB layout, and when I try to synchronize, I get the following error:

[Amazon][JDBC](10140) Error converting value to Timestamp.
[Amazon][JDBC](10140) Error converting value to Timestamp.
The SQL statement:
select current_database(),
       current_schema(),
       current_timestamp as current_timestamp


  at org.jetbrains.jdba.jdbc.BaseExceptionRecognizer.recognizeException(BaseExceptionRecognizer.java:48)
  at org.jetbrains.jdba.jdbc.JdbcIntermediateSession.recognizeException(JdbcIntermediateSession.java:347)
  at org.jetbrains.jdba.jdbc.JdbcIntermediateCursor.fetch(JdbcIntermediateCursor.java:257)
  at com.intellij.database.remote.jdba.impl.RemoteCursorImpl.fetch(RemoteCursorImpl.java:31)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
  at sun.rmi.transport.Transport$1.run(Transport.java:200)
  at sun.rmi.transport.Transport$1.run(Transport.java:197)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$79(TCPTransport.java:683)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:276)
  at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:253)
  at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:162)
  at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:217)
  at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:171)
  at com.sun.proxy.$Proxy100.fetch(Unknown Source)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at com.intellij.execution.rmi.RemoteUtil.invokeRemote(RemoteUtil.java:124)
  at com.intellij.execution.rmi.RemoteUtil.access$100(RemoteUtil.java:36)
  at com.intellij.execution.rmi.RemoteUtil$RemoteInvocationHandler.invoke(RemoteUtil.java:229)
  at com.sun.proxy.$Proxy101.fetch(Unknown Source)
  at org.jetbrains.jdba.intermediate.AdaptIntermediateStructCollectingCursor.fetch(AdaptIntermediateStructCollectingCursor.java:107)
  at org.jetbrains.jdba.core.BaseQueryRunner.fetchPack(BaseQueryRunner.java:88)
  at org.jetbrains.jdba.core.BaseQueryRunner.run(BaseQueryRunner.java:70)
  at com.intellij.dbm.postgres.PostgresIntrospector.a(PostgresIntrospector.java:108)
  at com.intellij.dbm.postgres.PostgresIntrospector.access$100(PostgresIntrospector.java:36)
  at com.intellij.dbm.postgres.PostgresIntrospector$1.working(PostgresIntrospector.java:100)
  at com.intellij.dbm.postgres.PostgresIntrospector$1.working(PostgresIntrospector.java:97)
  at com.intellij.dbm.common.BaseIntrospector$1.run(BaseIntrospector.java:92)
  at org.jetbrains.jdba.core.BaseSession.inTransaction(BaseSession.java:88)
  at org.jetbrains.jdba.core.BaseFacade$2.run(BaseFacade.java:93)
  at org.jetbrains.jdba.core.BaseFacade.inSession(BaseFacade.java:125)
  at org.jetbrains.jdba.core.BaseFacade.inTransaction(BaseFacade.java:89)
  at com.intellij.dbm.common.BaseIntrospector.workWithModel(BaseIntrospector.java:85)
  at com.intellij.dbm.postgres.PostgresIntrospector.a(PostgresIntrospector.java:97)
  at com.intellij.dbm.postgres.PostgresIntrospector.introspect(PostgresIntrospector.java:91)
  at com.intellij.database.dataSource.NativeSchemaLoader.a(NativeSchemaLoader.java:113)
  at com.intellij.database.dataSource.NativeSchemaLoader.introspectAndAdapt(NativeSchemaLoader.java:67)
  at com.intellij.database.dataSource.DatabaseSchemaLoader.loadDataSourceState(DatabaseSchemaLoader.java:99)
  at com.intellij.database.dataSource.AbstractDataSource.refreshMetaData(AbstractDataSource.java:61)
  at com.intellij.database.dataSource.AbstractDataSource$1.perform(AbstractDataSource.java:36)
  at com.intellij.database.dataSource.AbstractDataSource$1.perform(AbstractDataSource.java:34)
  at com.intellij.database.dataSource.AbstractDataSource.performJdbcOperation(AbstractDataSource.java:116)
  at com.intellij.database.dataSource.AbstractDataSource.refreshMetaData(AbstractDataSource.java:34)
  at com.intellij.database.dataSource.DataSourceUiUtil$2.run(DataSourceUiUtil.java:187)
  at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:563)
  at com.intellij.openapi.progress.impl.CoreProgressManager$2.run(CoreProgressManager.java:142)
  at com.intellij.openapi.progress.impl.CoreProgressManager.a(CoreProgressManager.java:446)
  at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:392)
  at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:54)
  at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:127)
  at com.intellij.openapi.progress.impl.ProgressManagerImpl$1.run(ProgressManagerImpl.java:126)
  at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:365)
  at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
  at java.util.concurrent.FutureTask.run(FutureTask.java:266)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)
  at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
Caused by: java.sql.SQLDataException: [Amazon][JDBC](10140) Error converting value to Timestamp.
  at com.amazon.exceptions.ExceptionConverter.toSQLException(Unknown Source)
  at com.amazon.utilities.conversion.TypeConverter.convertToTimestamp(Unknown Source)
  at com.amazon.utilities.conversion.TypeConverter.toTimestamp(Unknown Source)
  at com.amazon.jdbc.common.SForwardResultSet.getTimestamp(Unknown Source)
  at org.jetbrains.jdba.jdbc.JdbcValueGetters$TimestampGetter.getValue(JdbcValueGetters.java:429)
  at org.jetbrains.jdba.jdbc.JdbcValueGetters$TimestampGetter.getValue(JdbcValueGetters.java:425)
  at org.jetbrains.jdba.jdbc.JdbcRowFetchers$TupleFetcher.fetchRow(JdbcRowFetchers.java:163)
  at org.jetbrains.jdba.jdbc.JdbcRowFetchers$TupleFetcher.fetchRow(JdbcRowFetchers.java:145)
  at org.jetbrains.jdba.jdbc.JdbcRowsCollectors$ListCollector.collectRows(JdbcRowsCollectors.java:211)
  at org.jetbrains.jdba.jdbc.JdbcRowsCollectors$ListCollector.collectRows(JdbcRowsCollectors.java:198)
  at org.jetbrains.jdba.jdbc.JdbcIntermediateCursor.fetch(JdbcIntermediateCursor.java:253)
  at com.intellij.database.remote.jdba.impl.RemoteCursorImpl.fetch(RemoteCursorImpl.java:31)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:497)
  at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
  at sun.rmi.transport.Transport$1.run(Transport.java:200)
  at sun.rmi.transport.Transport$1.run(Transport.java:197)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
  at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$79(TCPTransport.java:683)
  at java.security.AccessController.doPrivileged(Native Method)
  at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  at java.lang.Thread.run(Thread.java:745)


My "redshift" driver is the RedshiftJDBC41-1.1.7.1007.jar that amazon offers for download, and I've set the class to com.amazon.redshift.jdbc41.Driver (dialect is set to "<default>"). Btw, I'm on Ubuntu 14.04 with

$ java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)


Has anyone else experienced this issue?

4 comments
Comment actions Permalink

Hello Steven,

Could you please attach output from Test Connection in Datasource properties dialog for your Redshift datasource? I've created the issue in YouTrack for this error, please follow the https://youtrack.jetbrains.com/issue/DBE-1696 for progress.

0
Comment actions Permalink

Sure:

Database: PostgreSQL/08.00.0002
Driver name: RedshiftJDBC
Driver version: 01.01.07.1007
JDBC version: 4.1
Case sensitivity: MIXED (quoted: EXACT)

Connection successful
0
Comment actions Permalink

same error

---------------------

Error encountered when performing Introspect schema public: [Amazon][JDBC](10140) Error converting value to Timestamp..
[Amazon][JDBC](10140) Error converting value to Timestamp.
(4s 876ms)

on pycharm 2017.2 aug 22

Database: PostgreSQL (ver. 09.05.0004) Identifier case sensitivity: mixed (plain), exact (delimited) Driver (JDBC4.2): RedshiftJDBC (ver. 01.02.01.1001)

-------------------

0

Please sign in to leave a comment.