snowflake-connector-nodejs: SNOW-1042878: Axios ERR_FR_TOO_MANY_REDIRECTS (proxy error)

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

  1. What version of NodeJS driver are you using? snowflake-sdk@1.9.3

  2. What operating system and processor architecture are you using? W10 AMD64

  3. What version of NodeJS are you using? (node --version and npm --version) 18.18.2

  4. What are the component versions in the environment (npm list)?

$ npm list
snowflake@1.0.0 C:\dev\tests\snowflake
└── snowflake-sdk@1.9.3

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

{"level":"TRACE","message":"[2:49:47.001 PM]: CALL POST with timeout 90000: https://***.snowflakecomputing.com/session/v1/login-request?requestId=***&warehouse=***&databaseName=***&roleName=***"}
{"level":"DEBUG","message":"[2:49:50.240 PM]: Encountered an error when sending the request. Details: {\"message\":\"Maximum number of redirects exceeded\",\"name\":\"Error [ERR_FR_TOO_MANY_REDIRECTS]\",\"stack\":\"Error [ERR_FR_TOO_MANY_REDIRECTS]: Maximum number of redirects exceeded\\n    at AxiosError.from (C:\\\\dev\\\\tests\\\\snowflake\\\\node_modules\\\\axios\\\\dist\\\\node\\\\axios.cjs:837:14)\\n    at RedirectableRequest.handleRequestError (C:\\\\dev\\\\tests\\\\snowflake\\\\node_modules\\\\axios\\\\dist\\\\node\\\\axios.cjs:3087:25)\\n    at RedirectableRequest.emit (node:e"}

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

  1. What did you expect to see?

    Successful connection 😃

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 1
  • Comments: 15

Most upvoted comments

Good to hear! It will work with a HttpAgent/HttpsAgent if you add in the axios configuration proxy: false, httpAgent: xxx (or httpsAgent) Both should be configurable This agent could be the one I gave you in the link before

forgot to update this one - Snowflake node.js driver latest released 1.15.0 introduced support for *_PROXY envvars, and with that, this issue should be fixed. (Had a test case for this specific scenario too, failed with 1.14.0 with the exact error mentioned here, and worked with the new fix branch, which is now released since couple days)

that might be indeed help some issues if the axios config could be exposed with a pre-existing default. Thank you for the idea, we’ll take a look into it and I’ll keep this thread posted.