error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO during React install GET package

andrew.hardy 10 Reputation points
2023-01-28T00:25:04.0666667+00:00

I am completely new to Azure.

We host an app service on Azure which comprises git version control, a node / ReactJS Frontend and a C# .NET Backend, which talks to an SQL Server Database and this deploys automatically when code is merged to the relevant branch (one app service for staging and one for development), installing the React App and building the .NET from scratch each time.

We have made like this about several deployments this year and I'd say tens of deployments last year, all successful. I'm pretty sure nothing about the configuration of the app service has changed in this time, we have only redeployed the code.

The last 2 or 3 deployments over a 2 day period failed during the React Web App installation, though the React installs successfully locally. The React install retrieves about 180 packages in this way...

npm http GET https://registry.npmjs.org/<package name>

These three recent deployments fail once each at differing points during the full 180 package retrievals with the following error passed up by the npm package:

EXEC : npm ERR! error : 1280:error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version:openssl\ssl\s23_clnt.c:602: [D:\home\site\repository\<project folder>\<project file>]
  npm ERR! 
  npm ERR!     at CleartextStream._puller (tls.js:501:24)
  npm ERR!     at CleartextStream._pull (tls.js:432:19)
  npm ERR!     at SecurePair.cycle (tls.js:727:20)
  npm ERR!     at EncryptedStream.write (tls.js:130:13)
  npm ERR!     at Socket.ondata (stream.js:38:26)
  npm ERR!     at Socket.emit (events.js:67:17)
  npm ERR!     at TCP.onread (net.js:367:14)
  npm ERR!  [Error: 1280:error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version:openssl\ssl\s23_clnt.c:602:
  npm ERR! ]
  npm ERR! You may report this log at:
  npm ERR!     <http://github.com/isaacs/npm/issues>
  npm ERR! or email it to:
  npm ERR!     <npm-@googlegroups.com>
  
  npm ERR! System Windows_NT 6.2.9200
  npm ERR! command "D:\\Program Files (x86)\\nodejs\\\\node.exe" "D:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
  npm ERR! cwd D:\home\site\repository\CTM.Approval.Web\ClientApp
  npm ERR! node -v v0.6.20
  npm ERR! npm -v 1.1.37
npm ERR! message 1280 : error : 1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version:openssl\ssl\s23_clnt.c:602: [D:\home\site\repository\CTM.Approval.Web\CTM.Approval.Web.csproj]
  npm ERR! message 

This causes the overall build to fail. At first glance this seems to me likely some kind of intermitent / dynamic / dependant comms issue, rather than a React install issue, given each failure is not at the same package GET and the install is successful locally.

Is anyone able to confirm this likelihood and suggest any further investigations or is aware of any recent issues on Azure which may possibly lead to these symptoms and when these recent issue may be resolved? Or alternatively how this might actually be an issue with the deployed code and why it might only fail on deployment?

It is odd that the error message includes these versions:

  npm ERR! node -v v0.6.20
  npm ERR! npm -v 1.1.37

The Azure App Service CLI includes:
User's image

Also odd. Though I am not sure if this is just a sandbox in some contexts.
Node v16.13.0 is as expected. Not sure why npm would be at ver 1 for this node installation.
However, the installations have always been successful (as described) and nothing has been explicitly changed on Azure at all or in the deploying application iro this.

Many thanks indeed.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,498 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
697 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Bill Rappleye 5 Reputation points
    2023-01-31T03:08:15.96+00:00

    We encountered this in some of our build environments in Azure just yesterday for the first time. Things were working fine prior. An investigation of Node and NPM versions showed us that for some reason, even though the node version was set properly, it was using a very old, incorrect version of NPM. We were able to resolve by adding the configuration value with the specific NPM version compatible with the node version specified, using the configuration setting WEBSITE_NPM_DEFAULT_VERSION.

    Make sure your Node and NPM versions are both compatible (https://nodejs.org/en/download/releases/) and also that those specific versions are installed on the image/environment where your app is deployed (look in the Node and NPM install directories that live under D:\Program Files (x86) in your console).

    As long as you have specified existing and compatible versions, you should see those versions listed when you query Node and NPM versions on the console (node --version and npm --version). Once you confirm that your environment is reporting that it is using the correct versions, everything should start to work properly again.

    Hope this helps!

    1 person found this answer helpful.

  2. Chris Green 0 Reputation points
    2023-02-01T23:46:24.5066667+00:00

    Hey @andrew.hardy -- we just had this issue today and your question and @Bill Rappleye helped point us in the right direction.

    For whatever reason, our azure app service has a mismatch between the npm versions listed in Kudu > Runtime versions, as opposed to what is actually installed, so it no longer could see our specified NPM version. Note the missing "8.1.0" version.
    Screenshot 2023-02-01 at 4.45.32 PM

    Screenshot 2023-02-01 at 4.45.41 PM

    Setting WEBSITE_NPM_DEFAULT_VERSION in Application Settings to a version listed in D:\Program Files (x86)\npm worked well, and our pipelines are succeeding again.

    Best of luck!

    0 comments No comments