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-1764129: Result set iteration fails with 403 error 4 hours after query completes #1941

Open
ehclark opened this issue Oct 25, 2024 · 0 comments
Labels

Comments

@ehclark
Copy link

ehclark commented Oct 25, 2024

Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!

  1. What version of JDBC driver are you using? 3.14.4
  2. What operating system and processor architecture are you using? Linux, amd64
  3. What version of Java are you using? 11
  4. What did you do? We have a Java program that extracts data from Snowflake. It runs a query then downloads, transforms and outputs result to local files. After running successfully for about 4 hours after query completion, the process failed with the following errors:
Oct 24, 2024 1:17:03 AM net.snowflake.client.jdbc.RestRequest execute
SEVERE: Error response: HTTP Response code: 403, request: GET https://r6eleusfcb1stg.blob.core.windows.net/results/01b7e306-0d07-ac45-0001-f61e257298ba_0%2Fmain%2Fdata_0_3_214?sv=2021-04-10&spr=https&se=2024-10-24T01%3A16%3A51Z&sr=b&sp=r&sig=****&rsce=gzip HTTP/1.1
Oct 24, 2024 1:17:03 AM net.snowflake.client.jdbc.DefaultResultStreamProvider getInputStream
SEVERE: Error fetching chunk from: https://r6eleusfcb1stg.blob.core.windows.net/results/01b7e306-0d07-ac45-0001-f61e257298ba_0%2Fmain%2Fdata_0_3_214?sv=2021-04-10&spr=https&se=2024-10-24T01%3A16%3A51Z&sr=b&sp=r&sig=****&rsce=gzip
Oct 24, 2024 1:17:03 AM net.snowflake.client.jdbc.SnowflakeUtil logResponseDetails
SEVERE: Response status line reason: Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Oct 24, 2024 1:17:03 AM net.snowflake.client.jdbc.SnowflakeUtil logResponseDetails
SEVERE: Response content: <?xml version="1.0" encoding="utf-8"?><Error><Code>AuthenticationFailed</Code><Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
RequestId:7abdcf6d-501e-00b5-09b2-25ccec000000
Time:2024-10-24T01:17:03.3836985Z</Message><AuthenticationErrorDetail>Signed expiry time [Thu, 24 Oct 2024 01:16:51 GMT] must be after signed start time [Thu, 24 Oct 2024 01:17:03 GMT]</AuthenticationErrorDetail></Error>

The signed expiry time mentioned in the error log is exactly 4 hours after the query completed. It would appear that the authentication tokens used to download the chunks from object storage are generated when the query completes and valid for up to 4 hours.

  1. What did you expect to see? The program should run to completion. The result set for a query should be available to iterate as long as the session is still open and valid.

  2. Can you set logging to DEBUG and collect the logs?

    https://community.snowflake.com/s/article/How-to-generate-log-file-on-Snowflake-connectors

    Before sharing any information, please be sure to review the log and remove any sensitive
    information.

@ehclark ehclark added the bug label Oct 25, 2024
@github-actions github-actions bot changed the title Result set iteration fails with 403 error 4 hours after query completes SNOW-1764129: Result set iteration fails with 403 error 4 hours after query completes Oct 25, 2024
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

1 participant