4

Getting timeout waiting for download of chunk error. Snowflake JDBC driver version: 3.13.18 error encountered:

*net.snowflake.client.jdbc.SnowflakeSQLException*: JDBC driver internal error: Timeout waiting for the download of #chunk0(Total chunks: 4) retry=0.
Encountered an error while trying to retrieve the list of event log records. JDBC driver internal error: Timeout waiting for the download of #chunk0(Total chunks: 4) retry=0.
Sergiu
  • 4,039
  • 1
  • 13
  • 21
  • It looks your client is not able to reach the internal stage to download the result set. Do you have a proxy in between? I would suggest you run [SnowCD](https://docs.snowflake.com/en/user-guide/snowcd.html) and see if your network has any filtering. – Sergiu May 09 '22 at 14:58
  • @Sergiu I have multiple queries in the application which are running properly. Even with this query if I limit the output rows, I am getting the result. The issue only occurs when output result set is too big, say >1000 rows. – Haider Millwala May 09 '22 at 16:20
  • 5
    Queries that return a small result set are served directly, queries with large result sets are storing the result set temporarily on an internal stage and the client connector/driver is directed to retrieve the resultset from that stage. That stage uses a different URL than the Snowflake account (it's an S3 URL or an Azure blob storage URL) and if that URL is somehow filtered by a proxy in your network you might get this issue. Run SnowCD as I mentioned and you will see if the proxy is causing the issue. – Sergiu May 10 '22 at 13:51
  • @Sergiu Any idea how we can get that intermediate URL ? I tried looking into Spark logs, but couldn't fetch it. FYI - I am using AWS Glue for my job – abhijitcaps Jul 26 '22 at 12:35
  • 1
    The URL is returned by the function [SYSTEM$WHITELIST](https://docs.snowflake.com/en/sql-reference/functions/system_whitelist.html) and it's the one marked as "type":"STAGE". – Sergiu Jul 26 '22 at 12:55
  • @sergiu Is this mechanism documented anywhere? I have also run into this, and the debug logs show me the URLs it's trying (and failing due to firewall) to access, but I wish I could have learned about this mechanism from documentation rather than through debugging. – peedee Mar 02 '23 at 13:28

1 Answers1

0

Try increasing the timeout parameter https://docs.snowflake.com/en/user-guide/jdbc-parameters.html#querytimeout

NickW
  • 8,430
  • 2
  • 6
  • 19
  • Thanks for your time! But the default value of the parameter is zero which specifies that driver should wait indefinitely as per documentation. And I am using default value only. – Haider Millwala May 10 '22 at 07:36
  • This is not related to timeout as you're on the download part of the chunks and at retry 0, so it's more network related (proxy in general). – Sergiu May 10 '22 at 14:11