-
Notifications
You must be signed in to change notification settings - Fork 133
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-1049322: Failing to load large data sets with snowflake-sdk ^v1.9.0 with message "Request to S3/Blob failed", works well with lower versions #763
Comments
hi - thank you for creating the issue. So you tested the ALLOWLIST output with SnowCD and generally it worked well. Next part would be seeing the logs, but as you mentioned you cannot share it here - can't share even in a sanitized way ? If so, i recommend opening a Snowflake Support case, where you can work 1:1 with a support engineer and only Snowflake can see the logs, not anyone who comes across this issue publicly. Without the trace logs it would be very hard to figure out what is failing in your particular situation. Generally, the driver is able to fetch data from S3-based internal stages. |
@sfc-gh-dszmolka winston:create-logger: Define prototype method for "error"
winston:create-logger: Define prototype method for "warn"
winston:create-logger: Define prototype method for "info"
winston:create-logger: Define prototype method for "http"
winston:create-logger: Define prototype method for "verbose"
winston:create-logger: Define prototype method for "debug"
winston:create-logger: Define prototype method for "silly"
winston:create-logger: Define prototype method for "error"
winston:create-logger: Define prototype method for "warn"
winston:create-logger: Define prototype method for "info"
winston:create-logger: Define prototype method for "http"
winston:create-logger: Define prototype method for "verbose"
winston:create-logger: Define prototype method for "debug"
winston:create-logger: Define prototype method for "silly"
winston:create-logger: Define prototype method for "OFF"
winston:create-logger: Define prototype method for "ERROR"
winston:create-logger: Define prototype method for "WARN"
winston:create-logger: Define prototype method for "INFO"
winston:create-logger: Define prototype method for "DEBUG"
winston:create-logger: Define prototype method for "TRACE"
{"level":"DEBUG","message":"[10:03:29.132 AM]: 300"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:29.154 AM]: Contacting SF: /session/v1/login-request?requestId=48369573-6933-4c35-830b-fb882219ef1f&warehouse=MY_WAREHOUSE&databaseName=MY_DB&schemaName=MY_SCHEMA, (1/7)"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:29.160 AM]: Create and add to cache new agent https://MY_PROD_SNOWFLAKE.snowflakecomputing.com:443-keepAlive"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:29.163 AM]: Proxy settings used in requests: // PROXY environment variables: HTTP_PROXY: MY_PROXY HTTPS_PROXY: MY_PROXY NO_PROXY: 127.0.0.1,localhost,.local,.internal,.kdc.MY_COMPANY.com,.prod.MY_COMPANY.com,.qa.MY_COMPANY.com,.prod.EU.MY_COMPANY.com,.qa.EU.MY_COMPANY.com,169.254.169.254,s3.amazonaws.com,.s3.amazonaws.com."}
winston:file: written true false
{"level":"TRACE","message":"[10:03:29.165 AM]: CALL POST with timeout 90000: https://MY_PROD_SNOWFLAKE.snowflakecomputing.com/session/v1/login-request?requestId=48369573-6933-4c35-830b-fb882219ef1f&warehouse=MY_WAREHOUSE&databaseName=MY_DB&schemaName=MY_SCHEMA"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:29.166 AM]: --createStatementPreExec"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:29.168 AM]: numBinds = 0"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:29.168 AM]: threshold = 100000"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:29.169 AM]: RowStatementPreExec"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:29.171 AM]: context.bindStage=undefined"}
winston:file: written true false
winston:file: logged 53 {"level":"DEBUG","message":"[10:03:29.132 AM]: 300"}
winston:file: logged 259 {"level":"DEBUG","message":"[10:03:29.154 AM]: Contacting SF: /session/v1/login-request?requestId=48369573-6933-4c35-830b-fb882219ef1f&warehouse=MY_WAREHOUSE&databaseName=MY_DB&schemaName=MY_SCHEMA, (1/7)"}
winston:file: logged 413 {"level":"TRACE","message":"[10:03:29.160 AM]: Create and add to cache new agent https://MY_PROD_SNOWFLAKE.snowflakecomputing.com:443-keepAlive"}
winston:file: logged 851 {"level":"DEBUG","message":"[10:03:29.163 AM]: Proxy settings used in requests: // PROXY environment variables: HTTP_PROXY: MY_PROXY HTTPS_PROXY: MY_PROXY NO_PROXY: 127.0.0.1,localhost,.local,.internal,.kdc.MY_COMPANY.com,.prod.MY_COMPANY.com,.qa.MY_COMPANY.com,.prod.EU.MY_COMPANY.com,.qa.EU.MY_COMPANY.com,169.254.169.254,s3.amazonaws.com,.s3.amazonaws.com."}
winston:file: logged 1121 {"level":"TRACE","message":"[10:03:29.165 AM]: CALL POST with timeout 90000: https://MY_PROD_SNOWFLAKE.snowflakecomputing.com/session/v1/login-request?requestId=48369573-6933-4c35-830b-fb882219ef1f&warehouse=MY_WAREHOUSE&databaseName=MY_DB&schemaName=MY_SCHEMA"}
winston:file: logged 1195 {"level":"DEBUG","message":"[10:03:29.166 AM]: --createStatementPreExec"}
winston:file: logged 1257 {"level":"DEBUG","message":"[10:03:29.168 AM]: numBinds = 0"}
winston:file: logged 1325 {"level":"DEBUG","message":"[10:03:29.168 AM]: threshold = 100000"}
winston:file: logged 1394 {"level":"DEBUG","message":"[10:03:29.169 AM]: RowStatementPreExec"}
winston:file: logged 1471 {"level":"DEBUG","message":"[10:03:29.171 AM]: context.bindStage=undefined"}
winston:file: stat done: snowflake.log { size: 539 }
winston:file: create stream start snowflake.log { flags: 'a' }
winston:file: create stream ok snowflake.log
winston:file: file open ok snowflake.log
Successfully connected to Snowflake.
{"level":"TRACE","message":"[10:03:29.743 AM]: Get agent with id: https://MY_PROD_SNOWFLAKE.snowflakecomputing.com:443-keepAlive from cache"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:29.747 AM]: CALL POST with timeout 90000: https://MY_PROD_SNOWFLAKE.snowflakecomputing.com/queries/v1/query-request?requestId=93d23f9c-5465-4c6a-9f78-ebccb423e082"}
winston:file: written true false
winston:file: logged 689 {"level":"TRACE","message":"[10:03:29.743 AM]: Get agent with id: https://MY_PROD_SNOWFLAKE.snowflakecomputing.com:443-keepAlive from cache"}
winston:file: logged 897 {"level":"TRACE","message":"[10:03:29.747 AM]: CALL POST with timeout 90000: https://MY_PROD_SNOWFLAKE.snowflakecomputing.com/queries/v1/query-request?requestId=93d23f9c-5465-4c6a-9f78-ebccb423e082"}
{"level":"TRACE","message":"[10:03:31.514 AM]: Mapping columns in resultset (total: 9)"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.519 AM]: Finished mapping columns."}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.520 AM]: Downloading 2951 chunks"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:31.534 AM]: deserializeQueryContext() called: data from server: {\"entries\":[{\"id\":0,\"timestamp\":201348722507844,\"priority\":0}]}"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:31.535 AM]: deserializeQueryContextElement `context` field is empty"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:31.537 AM]: checkCacheCapacity() called. treeSet size 1 cache capacity 5"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:31.537 AM]: checkCacheCapacity() returns. treeSet size 1 cache capacity 5"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:31.538 AM]: Cache Entry: id: 0 timestamp: 201348722507844 priority: 0"}
winston:file: written true false
winston:file: logged 986 {"level":"TRACE","message":"[10:03:31.514 AM]: Mapping columns in resultset (total: 9)"}
winston:file: logged 1061 {"level":"TRACE","message":"[10:03:31.519 AM]: Finished mapping columns."}
winston:file: logged 1134 {"level":"TRACE","message":"[10:03:31.520 AM]: Downloading 2951 chunks"}
winston:file: logged 1307 {"level":"DEBUG","message":"[10:03:31.534 AM]: deserializeQueryContext() called: data from server: {\"entries\":[{\"id\":0,\"timestamp\":201348722507844,\"priority\":0}]}"}
winston:file: logged 1412 {"level":"DEBUG","message":"[10:03:31.535 AM]: deserializeQueryContextElement `context` field is empty"}
winston:file: logged 1522 {"level":"DEBUG","message":"[10:03:31.537 AM]: checkCacheCapacity() called. treeSet size 1 cache capacity 5"}
winston:file: logged 1633 {"level":"DEBUG","message":"[10:03:31.537 AM]: checkCacheCapacity() returns. treeSet size 1 cache capacity 5"}
winston:file: logged 1740 {"level":"DEBUG","message":"[10:03:31.538 AM]: Cache Entry: id: 0 timestamp: 201348722507844 priority: 0"}
{"level":"TRACE","message":"[10:03:31.542 AM]: Create and add to cache new agent https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com:443-keepAlive"}
winston:file: written true false
{"level":"DEBUG","message":"[10:03:31.544 AM]: Proxy settings used in requests: // PROXY environment variables: HTTP_PROXY: MY_PROXY HTTPS_PROXY: MY_PROXY NO_PROXY: 127.0.0.1,localhost,.local,.internal,.kdc.MY_COMPANY.com,.prod.MY_COMPANY.com,.qa.MY_COMPANY.com,.prod.EU.MY_COMPANY.com,.qa.EU.MY_COMPANY.com,169.254.169.254,s3.amazonaws.com,.s3.amazonaws.com."}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.545 AM]: CALL GET with timeout 90000: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com/MY_SNOWFLAKE_BUCKET/results/MY_SNOWFLAKE_BUCKET_KEY/main/data_0_0_0?x-amz-server-side-encryption-customer-algorithm=AES256&response-content-encoding=gzip&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240208T160330Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21599&X-Amz-Credential=MY_AWS_CREDENTIALus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=MY_AWS_SIGNATURE"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.545 AM]: Get agent with id: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com:443-keepAlive from cache"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.545 AM]: CALL GET with timeout 90000: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com/MY_SNOWFLAKE_BUCKET/results/MY_SNOWFLAKE_BUCKET_KEY/main/data_0_0_1?x-amz-server-side-encryption-customer-algorithm=AES256&response-content-encoding=gzip&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240208T160330Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21599&X-Amz-Credential=MY_AWS_CREDENTIALus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=MY_AWS_SIGNATURE"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.546 AM]: Get agent with id: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com:443-keepAlive from cache"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.547 AM]: CALL GET with timeout 90000: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com/MY_SNOWFLAKE_BUCKET/results/MY_SNOWFLAKE_BUCKET_KEY/main/data_0_0_2?x-amz-server-side-encryption-customer-algorithm=AES256&response-content-encoding=gzip&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240208T160330Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21599&X-Amz-Credential=MY_AWS_CREDENTIALus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=MY_AWS_SIGNATURE"}
winston:file: written true false
winston:file: logged 1902 {"level":"TRACE","message":"[10:03:31.542 AM]: Create and add to cache new agent https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com:443-keepAlive"}
winston:file: logged 2340 {"level":"DEBUG","message":"[10:03:31.544 AM]: Proxy settings used in requests: // PROXY environment variables: HTTP_PROXY: MY_PROXY HTTPS_PROXY: MY_PROXY NO_PROXY: 127.0.0.1,localhost,.local,.internal,.kdc.MY_COMPANY.com,.prod.MY_COMPANY.com,.qa.MY_COMPANY.com,.prod.EU.MY_COMPANY.com,.qa.EU.MY_COMPANY.com,169.254.169.254,s3.amazonaws.com,.s3.amazonaws.com."}
winston:file: logged 2890 {"level":"TRACE","message":"[10:03:31.545 AM]: CALL GET with timeout 90000: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com/MY_SNOWFLAKE_BUCKET/results/MY_SNOWFLAKE_BUCKET_KEY/main/data_0_0_0?x-amz-server-side-encryption-customer-algorithm=AES256&response-content-encoding=gzip&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240208T160330Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21599&X-Amz-Credential=MY_AWS_CREDENTIALus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=MY_AWS_SIGNATURE"}
winston:file: logged 3048 {"level":"TRACE","message":"[10:03:31.545 AM]: Get agent with id: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com:443-keepAlive from cache"}
winston:file: logged 3598 {"level":"TRACE","message":"[10:03:31.545 AM]: CALL GET with timeout 90000: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com/MY_SNOWFLAKE_BUCKET/results/MY_SNOWFLAKE_BUCKET_KEY/main/data_0_0_1?x-amz-server-side-encryption-customer-algorithm=AES256&response-content-encoding=gzip&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240208T160330Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21599&X-Amz-Credential=MY_AWS_CREDENTIALus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=MY_AWS_SIGNATURE"}
winston:file: logged 3756 {"level":"TRACE","message":"[10:03:31.546 AM]: Get agent with id: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com:443-keepAlive from cache"}
winston:file: logged 4306 {"level":"TRACE","message":"[10:03:31.547 AM]: CALL GET with timeout 90000: https://MY_SNOWFLAKE_S3_VPC_STAGE.s3.us-west-2.amazonaws.com/MY_SNOWFLAKE_BUCKET/results/MY_SNOWFLAKE_BUCKET_KEY/main/data_0_0_2?x-amz-server-side-encryption-customer-algorithm=AES256&response-content-encoding=gzip&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20240208T160330Z&X-Amz-SignedHeaders=host&X-Amz-Expires=21599&X-Amz-Credential=MY_AWS_CREDENTIALus-west-2%2Fs3%2Faws4_request&X-Amz-Signature=MY_AWS_SIGNATURE"}
{"level":"DEBUG","message":"[10:03:31.710 AM]: Encountered an error when getting data from cloud storage: status: 400 \"Bad Request\" headers: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.712 AM]: Request won't be retried"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.713 AM]: Response headers are: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
winston:file: written true false
winston:file: logged 4638 {"level":"DEBUG","message":"[10:03:31.710 AM]: Encountered an error when getting data from cloud storage: status: 400 \"Bad Request\" headers: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
winston:file: logged 4712 {"level":"TRACE","message":"[10:03:31.712 AM]: Request won't be retried"}
winston:file: logged 4970 {"level":"TRACE","message":"[10:03:31.713 AM]: Response headers are: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
{"level":"DEBUG","message":"[10:03:31.718 AM]: Encountered an error when getting data from cloud storage: status: 400 \"Bad Request\" headers: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.720 AM]: Request won't be retried"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.720 AM]: Response headers are: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
winston:file: written true false
winston:file: logged 5302 {"level":"DEBUG","message":"[10:03:31.718 AM]: Encountered an error when getting data from cloud storage: status: 400 \"Bad Request\" headers: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
winston:file: logged 5376 {"level":"TRACE","message":"[10:03:31.720 AM]: Request won't be retried"}
winston:file: logged 5634 {"level":"TRACE","message":"[10:03:31.720 AM]: Response headers are: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
{"level":"DEBUG","message":"[10:03:31.725 AM]: Encountered an error when getting data from cloud storage: status: 400 \"Bad Request\" headers: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.727 AM]: Request won't be retried"}
winston:file: written true false
{"level":"TRACE","message":"[10:03:31.727 AM]: Response headers are: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
winston:file: written true false
winston:file: logged 5966 {"level":"DEBUG","message":"[10:03:31.725 AM]: Encountered an error when getting data from cloud storage: status: 400 \"Bad Request\" headers: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"}
winston:file: logged 6040 {"level":"TRACE","message":"[10:03:31.727 AM]: Request won't be retried"}
winston:file: logged 6298 {"level":"TRACE","message":"[10:03:31.727 AM]: Response headers are: {\"cache-control\":\"no-cache\",\"pragma\":\"no-cache\",\"content-type\":\"text/html; charset=utf-8\",\"proxy-connection\":\"close\",\"connection\":\"close\",\"content-length\":\"8693\"}"} |
thank you for sharing the logs ! so the biggest difference between 1.8.0 and 1.9.0 (and above) is that we replaced the main HTTP library furthermore the AWS SDK was also upgrade to v2 -> v3 in 1.9.0 and above. even furthermore, we upgraded If you have a bit of time, could you please:
var connection = snowflake.createConnection({
account: "MY_SF_ACCOUNT",
database: "MY_DB",
schema: "MY_SCHEMA",
warehouse: "MY_WH",
username: "MY_USER",
password: "MY_PWD",
proxyHost: "MY_PROXY", //please do not prepend http:// or https://
proxyPort: 8080 // please input the numerical proxyport
noProxy: "127.0.0.1|localhost|.local,.internal|.kdc.MY_COMPANY.com|.prod.MY_COMPANY.com|.qa.MY_COMPANY.com|.prod.EU.MY_COMPANY.com|.qa.EU.MY_COMPANY.com|169.254.169.254|s3.amazonaws.com|.s3.amazonaws.com",
proxyProtocol: "https" // only add this if your proxy is HTTPS. if it's HTTP, you can leave this option out, default is HTTP
}); (Reference: https://docs.snowflake.com/en/developer-guide/node-js/nodejs-driver-connect#connecting-through-an-authenticated-proxy) Finally: while I'll also try and reproduce the HTTP400 Bad Request issue, it might be particularly difficult to simulate your environment and it's possible that eventually we'll need to resort to such tools (like logging out the actual request which results in HTTP400), and especially if this issue affects a production flow for you (I see you're a Snowflake customer), I highly recommend creating an official case with Snowflake Support and continuing there. Otherwise if this issue is not urgent for you, we can continue the conversation here. Next step is on me, trying to set up a repro environment and reproduce the issue. |
@sfc-gh-dszmolka I'm working on this issue as well, and I've tried what you mentioned about unsetting the noProxy value. I've never really initialized the Snowflake object with that property, but I tried doing so and it results in the same error either way. As far as the major versions go, this issue is persistent from snowflake-sdk 1.9.0 and above, not just 1.9.3. When I do debug the S3 request being sent by the sdk and try fetching the response manually through an http client, I'm actually able to successfully fetch a response without an issue with the proper headers. Although admittedly, I haven't been able to replicate the same behavior through a manual axios fetch in code (or urllib), so that's something I'll play around with to see if I can make any progress. |
thanks @srikarm16 much appreciated! Good to know issue already is there with 1.9.0, it narrows it down a little bit (i.e. probably not related to the Couple of things:
Nevertheless, I'll keep looking into this and keep this thread posted. |
added some extra logging around where the requests towards the cloud storage are handled in a simple way, which should provide more insight:
(has a massive output as it logs both the request and response objects) of course we don't expect to share it here, but if you can perhaps take a look in your environment which reproduces the problem, and see any obvious reasons in the request (headers etc) sent by perhaps don't even need to get the full original query results, a |
@sfc-gh-dszmolka So you're saying I should try establishing the snowflake connection without the use of What I do want to mention, seeing as it's not already said in this issue here, the sdk does work for a very small subset of data (seemingly less than 500kb, I haven't max tested the true upper limit). Since axios was replaced as the main http client I did notice that the S3 |
Hey @sfc-gh-dszmolka Something interesting I found after doing some more testing. I was able to fetch the S3 get url and successfully send it using This was the error I got. It seems like other people have gotten this issue before with Axios (Issue#4840) Since the snowflake-sdk didn't ever really use Axios for the |
thank you for all these info @srikarm16 ! regarding the bug being or not being related to
So i still think what you found might be relevant. There's really a wide area of choice for the various bugs in axios when it comes to proxies, and in addition to not having access to your environment and not being able to reproduce the same issue doesn't make debugging easier. What you quoted in your last comment, seems to happen to many users due to how a That's why i was asking you to try without the envvars ( At the same time, if you can share any details on the proxy so maybe if it has a trial license, we could set it up here locally and try and reproduce the issue for ourselves to learn more about it. |
i think i managed to reproduce both problems (HTTP400 Bad Request +
in the Connection settings, while have no
HTTP400 Bad Request reproduces.
To me, even if the situation is a little bit different in the repro (Snowflake Do you think it's possible something similar happens to the request sent to the S3 buckets, when sent through the proxy? Perhaps it's worth considering comparing the proxy's configuration regarding requests towards |
Hey @sfc-gh-dszmolka I'm glad you were able to reproduce a similar error, this helps us trim down the problem further. I do want to mention that I have tried using the Axios debugging to eventually get the same results. Even removing proxies set through env variables didn't really change anything. What I want to know is why does this sdk seem to work for a small amount of rows then? I don't change the proxy settings whatsoever, but in my SQL query if I simply add a I guess I'm wondering if a small set of data is somehow a special case where the proxy configuration for s3 doesn't matter, or if there's a difference in how the largeResultSet chains the s3 requests with misconfigured proxies by any chance. To me it doesn't make sense why the exact same request to the same S3 bucket will work on a small enough data but fail on a large amount of data potentially due to proxy. |
The big difference here is, that when you put a It is coming directly from the Snowflake account host (youraccount.snowflakecomputing.com) That's why I was asking if there's any difference in the proxy configuration for the There's still a lot of moving parts, but I'm quite certain it's still related to one of the |
@sfc-gh-dszmolka Ahh I see, that makes more sense, thanks for the explanation. I did some more digging, and I think it's the It looks like someone made a custom fix to this issue and forked the Axios repo to make a new lib called I know you talked about proxy differences, but I got this custom version of Axios to successfully fetch a request with the same proxyHost and port set, whereas before Axios gave me the As for you other questions, I'm doing my best to find out more about proxy configurations in the meantime. |
@srikarm16 yes i also came across the Yes, the issue is very likely due to how Until we can find a way to reproduce the error on |
@sfc-gh-dszmolka So question for you, when you reproduced the errors, have you tried submitting the same request url and headers through a different client to see if you get the same errors? For me personally, I've had success through thunderclient and I'll try to mess around to see if I can get anything working through the client Agent setup in the sdk. Or do you think this might be something to potentially open up directly with |
yes, this is exactly my point. when I managed to reproduce the error symptoms (HTTP400 and so while it did reproduce the symptoms, it did not reproduce the actual error, which is exclusively specific to the bug is indeed with I did not have time yet to move forward with this and finding a proxy which behaves well with other http clients and only breaks axios. Of course since you already have the environment which I don't have, that would be a massive help from your side if you can tweak the agent setup. Otherwise I'll keep researching how to set up the reproduction environment so we could see the exact issue for ourselves (only with axios , not other http client) and therefore be able to write a fix and tests for it. |
@sfc-gh-dszmolka I was able to avoid using the outdated library and use the latest So, I tried something weird. Normally my code for trying a certain url and headers is as follows:
This usually is able to fetch me all the data. However on a whim, I decided to try this exact same code inside the Since |
@srikarm16 thank you for your continued efforts on this vague issue, really appreciated ! I tried your code with the proxy I used to see the error symptoms, but I ended up seeing the same error what I see even outside anyhow, I now involved the driver dev team to aid us in debugging this issue further . In the meantime I'm still searching for a proxy/setup which can reproduce the issue from snowflake-sdk (and not any client outside of snowflake-sdk). Tried mitmproxy, squid so far in 'regular proxy' mode; they seem to just nicely handle the |
still trying to reproduce the issue locally and searching for the proxy/config which could help, no breakthroughs so far. However I made another discovery which might be relevant. Took a step back and installed [email protected] (which still had When I launched the test script
(note I'm using the exact same I observed absolutely nothing is sent to the proxy. The traffic is not sent to the proxy, neither Snowflake-destined nor the bucket-destined traffic is actually, not even hitting the proxy. Maybe this is the source of all your problems? No traffic was sent to the proxy at all while Also the configuration for Would it be possible to try appending Of course this doesn't answer any questions or solve how |
As a quick summary:
therefore closing this issue as well. |
What version of NodeJS driver are you using? ^1.9.0
What operating system and processor architecture are you using? Darwin and arm
What version of NodeJS are you using? node 16.20.0 and npm 8.19.4
What are the component versions in the environment (
npm list
)?└── [email protected]
5.Server version:* 8.5.1
6. What did you do?
Tried out this sample code from https://docs.snowflake.com/en/developer-guide/sql-api/submitting-requests but because my data set size is between 6-7MB, it is failing with message Request to S3/Blob failed
We are observing this while upgrading snowflake-sdk from 1.6.23 to ^1.9.0. Things seem to be working fine with version 1.6.*, 1.7.0 and 1.8.0.
Is there a resolution for fetching large data sets with sdk version ^1.9.0?
What did you expect to see? With a minor version upgrade, we were expecting the code to be backward compatible. Expected data to be returned in same way as with v1.6.23 or v1.7.0 or v1.8.0
Can you set logging to DEBUG and collect the logs? Can't upload logs due to company security policies.
What is your Snowflake account identifier, if any? (Optional)
The text was updated successfully, but these errors were encountered: