snowflake-connector-nodejs: SNOW-872164: TypeError: Cannot read properties of null (reading 'getPeerCertificate') resulting in S3/Blob read 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? 1.6.22 & 1.6.23 (Tried with both)

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

  3. What version of NodeJS are you using? node:20-alpine

  4. What are the component versions in the environment (npm list)? up-report-generation@1.0.0 /Users/sankaranak/code/qp-report-generation ├── @google-cloud/secret-manager@4.2.2 ├── @google-cloud/storage@6.12.0 ├── @shelf/jest-mongodb@4.1.7 ├── @types/archiver@5.3.2 ├── @types/async-retry@1.4.5 ├── @types/async@3.2.20 ├── @types/correlation-id@2.1.2 ├── @types/exceljs@1.3.0 ├── @types/express@4.17.17 ├── @types/generic-pool@3.8.1 ├── @types/jest@29.5.3 ├── @types/lodash@4.14.195 ├── @types/snowflake-sdk@1.6.13 ├── @types/unzipper@0.10.6 ├── @typescript-eslint/eslint-plugin@5.62.0 ├── @typescript-eslint/parser@5.62.0 ├── agenda@5.0.0 ├── async-retry@1.3.3 ├── async@3.2.4 ├── correlation-id@5.0.2 ├── dd-trace@4.7.0 ├── delay@5.0.0 ├── eslint-config-airbnb-typescript@17.1.0 ├── eslint-config-prettier@8.8.0 ├── eslint-plugin-import@2.27.5 ├── eslint-plugin-prettier@4.2.1 ├── eslint@8.45.0 ├── exceljs@4.3.0 ├── express@4.18.2 ├── generic-pool@3.9.0 ├── is-iso-date@0.0.1 ├── jest-mock-extended@3.0.4 ├── jest@29.6.1 ├── lodash@4.17.21 ├── mock-jwks@2.1.1 ├── moment@2.29.4 ├── mongodb@5.7.0 ├── nock@13.3.2 ├── node-config-ts@3.3.1 ├── nodemon@2.0.22 ├── prettier@2.8.8 ├── snowflake-sdk@1.6.23 ├── ts-custom-error@3.3.1 ├── ts-jest@29.1.1 ├── typescript@5.1.6 ├── unzipper@0.10.14 ├── uuid@9.0.0 └── winston@3.10.0

5.Server version:* E.g. 1.90.1 You may get the server version by running a query:

7.23.1
  1. What did you do? Download data for a report with 250000 rows

  2. What did you expect to see? Download should have completed. What should have happened and what happened instead? We have a service in production that has been running for long and downloads data for reports(using streaming). For the past few days, we are consistently getting below error.

uncaughtException: Cannot read properties of null (reading 'getPeerCertificate')
TypeError: Cannot read properties of null (reading 'getPeerCertificate')
    at TLSSocket.validate (/app/node_modules/snowflake-sdk/lib/agent/socket_util.js:90:36)
    at TLSSocket.emit (node:events:524:35)
    at TLSSocket.emit (node:domain:489:12)
    at TLSSocket.emit (/app/node_modules/dd-trace/packages/datadog-instrumentations/src/net.js:61:25)
    at TLSSocket._finishInit (node:_tls_wrap:1038:8)
    at ssl.onhandshakedone (node:_tls_wrap:824:12)
    at TLSWrap.callbackTrampoline (node:internal/async_hooks:130:17)
    
    Network error. Could not reach S3/Blob.
  1. Can you set logging to DEBUG and collect the logs?

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

e.g Add this to get standard output.

var snowflake = require('snowflake-sdk');
snowflake.configure(
{
  logLevel: 'trace'
});
  1. What is your Snowflake account identifier, if any? (Optional)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 1
  • Comments: 22 (1 by maintainers)

Most upvoted comments

wonder if that can happen here, since there’s a null returned.

The error is saying that it’s calling getPeerCertificate on a null object Cannot read properties of null (reading 'getPeerCertificate') The issue is that socket.ssl is null for some reason, and it’s not being checked.