snowflakedb / snowflake-jdbc

Snowflake JDBC Driver
Apache License 2.0
178 stars 170 forks source link

Include request URL in error message for chunk download timeouts #1455

Closed ash211 closed 1 year ago

ash211 commented 1 year ago

What is the current behavior?

When attempting to download large result sets from behind a network firewall that has the SNOWFLAKE_DEPLOYMENT but not the STAGE domains allowlisted (from https://docs.snowflake.com/en/sql-reference/functions/system_allowlist), then the user sees this error message:

Caused by: java.lang.Throwable: JDBC driver internal error: Timeout waiting for the download of #chunk0(Total chunks: 18) retry=0.
    at net.snowflake.client.jdbc.SnowflakeChunkDownloader.getNextChunkToConsume(SnowflakeChunkDownloader.java:602)
    at net.snowflake.client.core.SFArrowResultSet.fetchNextRowUnsorted(SFArrowResultSet.java:232)
    at net.snowflake.client.core.SFArrowResultSet.fetchNextRow(SFArrowResultSet.java:209)
    at net.snowflake.client.core.SFArrowResultSet.next(SFArrowResultSet.java:344)
    at net.snowflake.client.jdbc.SnowflakeResultSetV1.next(SnowflakeResultSetV1.java:92)

What is the desired behavior?

It would be very helpful if this exception include the URL of the request that timed out, so that users have some hint of what domains they need to allowlist.

How would this improve snowflake-jdbc?

It would point users towards what kind of networking problem they have, so they can get connected to their Snowflake instance more quickly.

References, Other Background

None

What is your Snowflake account identifier, if any?

None

ash211 commented 1 year ago

My proposed fix would be to modify the message here and add the scrubbedUrl field from SnowflakeResultChunk to the log statement.

ash211 commented 1 year ago

Thank you for merging that fix @sfc-gh-igarish !

Do you have an upcoming release of this driver planned? The most recent one (3.13.33) was almost a month ago. I would like to deploy this change to assist with debugging an active issue that one of our mutual customers is experiencing.

sfc-gh-spanaite commented 1 year ago

@ash211 We usually release monthly, but it might not make it in the July release, therefore the safest bet is the August release.

ash211 commented 1 year ago

Ok thank you, I'll keep an eye out then.