Open hongbo-miao opened 3 months ago
I found even "test the destination" succeed, but when actually run the job, I still got error no matter which Snowflake destination connector version:
2024-07-01 05:37:10 destination > WARN type-and-dedupe c.z.h.p.ProxyConnection(checkException):178 HikariPool-1 - Connection net.snowflake.client.jdbc.SnowflakeConnectionV1@d66a18f marked as broken because of SQLSTATE(57P03), ErrorCode(606) net.snowflake.client.jdbc.SnowflakeSQLException: No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command.
at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:144) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:501) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:407) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:482) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:199) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:133) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.core.SFStatement.execute(SFStatement.java:769) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.core.SFStatement.execute(SFStatement.java:677) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:267) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at net.snowflake.client.jdbc.SnowflakePreparedStatementV1.executeQuery(SnowflakePreparedStatementV1.java:122) ~[snowflake-jdbc-3.14.1.jar:3.14.1]
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52) ~[HikariCP-5.1.0.jar:?]
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java) ~[HikariCP-5.1.0.jar:?]
at io.airbyte.cdk.db.jdbc.DefaultJdbcDatabase.unsafeQuery(DefaultJdbcDatabase.java:129) ~[airbyte-cdk-core-0.23.2.jar:?]
at io.airbyte.cdk.db.jdbc.JdbcDatabase.unsafeQuery(JdbcDatabase.java:200) ~[airbyte-cdk-core-0.23.2.jar:?]
at io.airbyte.cdk.db.jdbc.JdbcDatabase.queryJsons(JdbcDatabase.java:216) ~[airbyte-cdk-core-0.23.2.jar:?]
at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeV1V2Migrator.doesAirbyteInternalNamespaceExist(SnowflakeV1V2Migrator.java:42) ~[io.airbyte.airbyte-integrations.connectors-destination-snowflake.jar:?]
at io.airbyte.integrations.base.destination.typing_deduping.BaseDestinationV1V2Migrator.doesValidV2RawTableAlreadyExist(BaseDestinationV1V2Migrator.java:114) ~[airbyte-cdk-typing-deduping-0.23.2.jar:?]
at io.airbyte.integrations.base.destination.typing_deduping.BaseDestinationV1V2Migrator.shouldMigrate(BaseDestinationV1V2Migrator.java:47) ~[airbyte-cdk-typing-deduping-0.23.2.jar:?]
at io.airbyte.integrations.base.destination.typing_deduping.BaseDestinationV1V2Migrator.migrateIfNecessary(BaseDestinationV1V2Migrator.java:27) ~[airbyte-cdk-typing-deduping-0.23.2.jar:?]
at io.airbyte.integrations.base.destination.typing_deduping.DefaultTyperDeduper.lambda$runMigrationsAsync$0(DefaultTyperDeduper.java:138) ~[airbyte-cdk-typing-deduping-0.23.2.jar:?]
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Stack Trace: net.snowflake.client.jdbc.SnowflakeSQLException: No active warehouse selected in the current session. Select an active warehouse with the 'use warehouse' command.
at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowExceptionSub(SnowflakeUtil.java:144)
at net.snowflake.client.jdbc.SnowflakeUtil.checkErrorAndThrowException(SnowflakeUtil.java:77)
at net.snowflake.client.core.StmtUtil.pollForOutput(StmtUtil.java:501)
at net.snowflake.client.core.StmtUtil.execute(StmtUtil.java:407)
at net.snowflake.client.core.SFStatement.executeHelper(SFStatement.java:482)
at net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:199)
at net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:133)
at net.snowflake.client.core.SFStatement.execute(SFStatement.java:769)
at net.snowflake.client.core.SFStatement.execute(SFStatement.java:677)
at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:267)
at net.snowflake.client.jdbc.SnowflakePreparedStatementV1.executeQuery(SnowflakePreparedStatementV1.java:122)
at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
at io.airbyte.cdk.db.jdbc.DefaultJdbcDatabase.unsafeQuery(DefaultJdbcDatabase.java:129)
at io.airbyte.cdk.db.jdbc.JdbcDatabase.unsafeQuery(JdbcDatabase.java:200)
at io.airbyte.cdk.db.jdbc.JdbcDatabase.queryJsons(JdbcDatabase.java:216)
at io.airbyte.integrations.destination.snowflake.typing_deduping.SnowflakeV1V2Migrator.doesAirbyteInternalNamespaceExist(SnowflakeV1V2Migrator.java:42)
at io.airbyte.integrations.base.destination.typing_deduping.BaseDestinationV1V2Migrator.doesValidV2RawTableAlreadyExist(BaseDestinationV1V2Migrator.java:114)
at io.airbyte.integrations.base.destination.typing_deduping.BaseDestinationV1V2Migrator.shouldMigrate(BaseDestinationV1V2Migrator.java:47)
at io.airbyte.integrations.base.destination.typing_deduping.BaseDestinationV1V2Migrator.migrateIfNecessary(BaseDestinationV1V2Migrator.java:27)
at io.airbyte.integrations.base.destination.typing_deduping.DefaultTyperDeduper.lambda$runMigrationsAsync$0(DefaultTyperDeduper.java:138)
at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1804)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
It turns out a false alarm. I think all verisons including latest v3.10.1 all work well!
I actually made several mistakes.
Here are tips to make it work, let's based on this Snowflake destination settings:
PRODUCTION_HM_AIRBYTE_DB_OWNER_ROLE
should have permission of PRODUCTION_HM_AIRBYTE_WH
.PRODUCTION_HM_AIRBYTE_WH
.PRODUCTION_HM_AIRBYTE_DB_OWNER_USER
default warehouse is PRODUCTION_HM_AIRBYTE_WH
and default role is PRODUCTION_HM_AIRBYTE_DB_OWNER_ROLE
.Hope it helps future users! ☺️
I will leave this open as I feel the error is kind of misleading, maybe worth to throw different errors such as
PRODUCTION_HM_AIRBYTE_DB_OWNER_ROLE
does not have PRODUCTION_HM_AIRBYTE_WH
permissionXXX_WH
warehouse does not exist.@airbytehq/destinations can someone take a look into this?
Can I take a jab at this as a first time contributor?
I see the only time that string is used is at:
AssertionsForClassTypes.assertThat(standardCheckConnectionOutput.message)
.contains(
SnowflakeInsertDestinationAcceptanceTest.Companion.NO_ACTIVE_WAREHOUSE_ERR_MSG
)
It seems like a pretty generic catch all error message so I can just edit the ERROR Message (NO_ACTIVE_WAREHOUSE_ERR_MSG) to allude to a permission issue as well.
@airbytehq/destinations would be someone able to check the suggestion to fix the issue? Thanks!
@HishamAssi - sure, please link the PR once you have it ready
We'll tackle this in-house
Connector Name
destination-snowflake
Connector Version
v3.9.0 ~ v3.10.1 have the issue.(Turns out false alarm, please check comment here)What step the error happened?
Configuring a new connector
Relevant information
I found this bug starts to show since destination-snowflake v3.9.0, v3.10.1 (latest as of today) also has this issue. However, v3.8.4 works well.
Here is my Terraform config
Relevant log output
v3.8.4
Here is the screenshot when test the destination:
v3.9.0 to v3.10.1 (latest as of today)
Here is the screenshot when test the destination:
airbyte-worker log:
Contribute