-
Notifications
You must be signed in to change notification settings - Fork 134
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-1042878: Axios ERR_FR_TOO_MANY_REDIRECTS (proxy error) #761
Comments
Hi - generally, the driver works using a proxy, so I'm wondering what is the difference in your case. Let me confirm how it behaves using Windows and a proxy. |
just tested using the following simple script var snowflake = require('snowflake-sdk');
//require('log-timestamp');
console.log(`\nNode.js process version is: ${process.version}\n`);
//snowflake.configure({ logLevel: 'trace' });
var connection = snowflake.createConnection({
validateDefaultParameters: true,
// please set up environment variables accordingly
account: process.env.SFACCOUNT,
username: process.env.SFUSER,
password: process.env.SFPASS,
proxyHost: '172.20.XXX.XXX', // please replace me
proxyPort: 8080 // me too
});
connection.connect(function(err, conn) {
if (err) {
console.error('Unable to connect: ' + err.message);
} else {
console.log('Successfully connected as id: ' + connection.getId());
}
});
var statement = connection.execute({
sqlText: 'select \'Query run successfully on Snowflake\' as result;',
complete: function(err, stmt, rows) {
if (err) {
console.error('Failed to execute statement due to the following error: ' + err.message);
} else {
console.log('[queryID ' + statement.getStatementId() + ', requestId ' + statement.getRequestId() + '] Number of rows produced: ' + rows.length);
}
}
}); on a Windows 10 machine:
looks like Snowflake Node.js driver generally works with proxy on Windows 10. Can you please provide more details on your issue? For example, run the above test script with tracing enabled, and provide me with the full logs (all the logs generated from start to end of execution) ? Please sanitize the logs if you need, or you can work directly 1 on 1 with a Snowflake Support engineer if you don't want to share the logs here. Alternatively if you could please provide a reproduction snippet, which when run, leads to the issue - that might be also good but for now I would like to be able to determine if your issue stems from a driver bug, or an environmental issue which is specific for your runtime. Thank you in advance ! |
|
thank you ! the logs (and the repro script :) ) indicate that both
are configured. This is incorrect and may lead to problems, as you already see. As a test, would it be please possible to:
and re-test? |
Hello, It use something like a tunnel with a first Edit: I also remove proxy on requestOptions on http/base.js (line 233 => proxy: false) How can you add support for this proxy ? |
so i tested the following scenarios, still on Windows 10, now using keypair auth to match your situation.
edit: further tests indicate that as soon as HTTPS_PROXY is set, the contents of proxyHost/proxyPort is ignored/overridden when actually sending the request. so I'm starting to think maybe as next step it would be worth looking at the proxy service you're using - is this perhaps something which is available as a community version or a trial so I could try it ? I'm currently using mitmproxy to test and as you see, the issue does not reproduce in the above permutations. Also if you could please share more details on the 'it's not working' part - which of the above scenarios you're attempting to use ? Is it still not working as recommended initially: ditching the environment variables and using I also understand you made it work for your environment by modifying the SDK and it's great news to hear you're unblocked here, but for the sake of the rest of the users I would like to understand and issue better how it is not working in your environment if that's possible. Anyways, I'll keep trying to reproduce the issue. |
a random question, but do you by any chance use ZScaler ? |
Yes We use ZScaler :( |
Thank you for confirming - asking because we had another customer having very similar problem to yours. The solution in their case was to disable the ZScaler client connector on the host, since the connection was already sent through the proxy once due to the envvars - and using the 'client connector' again somehow directed the traffic to the proxy. The workaround you found (dropping the whole |
Thank you for your reply. In my case I can't disable ZScaler :( |
I finally managed to reproduce the same issue even without ZScaler, using tinyproxy Then run Another scenario was working well, when I did not use the environment variable proxyHost: my.pro.xy, // no http:// is prepended!!
proxyPort: 8888 and this went through the proxy as well, but was successfully connecting and logging in. We'll take a look how to address this in |
Good to hear! |
Another idea, for |
that might be indeed help some issues if the |
forgot to update this one - Snowflake node.js driver latest released 1.15.0 introduced support for |
Please answer these questions before submitting your issue.
In order to accurately debug the issue this information is required. Thanks!
What version of NodeJS driver are you using?
snowflake-sdk@1.9.3
What operating system and processor architecture are you using?
W10
AMD64
What version of NodeJS are you using?
(
node --version
andnpm --version
)18.18.2
What are the component versions in the environment (
npm list
)?5.Server version:
8.4.1
6. What did you do?
Behind a corporate proxy I get this error when I try to connect to snowflake
In another context, it helps me get through the corporate proxy : https://antoinevastel.com/nodejs/2022/02/26/nodejs-optimized-https-proxy-no-dependencies.html
What did you expect to see?
Successful connection :)
The text was updated successfully, but these errors were encountered: