StackStorm/serverless-plugin-stackstorm

sls stackstorm info and install command failing on Mac OS Siera V 10.12.16

um255 opened this issue · 11 comments

um255 commented

Hi Team,

I installed openssl & node on mac using brew install.

I also installed all the prerequisites required.

But when I tried to run the command sls stackstorm install packs -p aws
it gives me the below error

Serverless: Load command stackstorm:info
Serverless: Invoke stackstorm:install:packs
 
  Error --------------------------------------------------
 
  write EPROTO 140736412791744:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:

 
     For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
 
  Stack Trace --------------------------------------------
 
Error: write EPROTO 140736412791744:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:827:

    at _errnoException (util.js:999:13)
    at WriteWrap.afterWrite [as oncomplete] (net.js:883:14)
From previous event:
    at PluginManager.invoke (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:368:22)
    at PluginManager.run (/usr/local/lib/node_modules/serverless/lib/classes/PluginManager.js:399:17)
    at variables.populateService.then (/usr/local/lib/node_modules/serverless/lib/Serverless.js:102:33)
    at runCallback (timers.js:773:18)
    at tryOnImmediate (timers.js:734:5)
    at processImmediate [as _immediateCallback] (timers.js:711:5)
From previous event:
    at Serverless.run (/usr/local/lib/node_modules/serverless/lib/Serverless.js:89:74)
    at serverless.init.then (/usr/local/lib/node_modules/serverless/bin/serverless:42:50)
    at <anonymous>
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Forums:        forum.serverless.com
     Chat:          gitter.im/serverless/serverless
 
  Your Environment Information -----------------------------
     OS:                     darwin
     Node Version:           9.3.0
     Serverless Version:     1.25.0

I also configured the brew installed openssl path in the bash profile

which openssl
/usr/local/opt/openssl/bin/openssl

And also exported the flags in the bash profile
export CPATH=/usr/local/opt/openssl/include
export LIBRARY_PATH=/usr/local/opt/openssl/lib

Could you please help me to resolve the issue.

Kind Regards,
UM

I am facing the same issue as well

Kami commented

Thanks for reporting this.

@enykeev any ideas?

I had some ssl related issues due to missing libraries on Fedora (libssl-dev, curl-dev, gnutls-dev), but it worked fine on Ubuntu.

Sadly I don't have any experience with OS X.

Frankly, I have no idea either. There is a long standing issue (nodejs/node#3692) related to OpenSSL throwing EPROTO on some combinations of servers and openssl, but I surely don't have enough knowledge on inner workings of the openssl to claim anything.

What I can suggest though is to remove OpenSSL out of equation by setting index_root to http:

custom:
  stackstorm:
    index_root: http://index.stackstorm.org/v1/

I've checked and in my case, both http and https works on OSX 10.13.2 with

$ brew info openssl
openssl: stable 1.0.2n (bottled) [keg-only]

and

$ openssl version
LibreSSL 2.2.7
um255 commented

Hi @enykeev

I tried to set index_root in the serverless.yml but still getting the same issue.

@um255 @psogani is there a chance that you have some sort of proxy in between the machine you're running sls on and our index?

upd btw, sorry for the delay, I was on holidays and afk. You have my full attention now.

Hi no worries @enykeev!..yea I do have a corporate proxy setup behind which I am trying to run the command

@psogani found a similar issue in the repo of http library we're using: axios/axios#925

Is your corporate proxy installed system-wide or are you feeding sls some ENV variables to make it use it?

It is system-wide but we need to setup some env vars in either bash or the npmrc to make npm use it

@enykeev so this is how my package.json looks like:-

  "name": "stackstorm",
  "version": "1.0.0",
  "description": "Test package.json for stackstorm",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "serverless-plugin-stackstorm": "^1.1.0"
  },
  "dependencies": {
    "openssl": "^1.1.0"
  }
}

Since my openssl version is 1.0.2n i changed package.json to reflect the same:

{
  "name": "stackstorm",
  "version": "1.0.0",
  "description": "Test package.json for stackstorm",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "serverless-plugin-stackstorm": "^1.1.0"
  },
  "dependencies": {
    "openssl": "1.0.2n"
  }
}

But that did not resolve my issue either..:'(

@psogani you do realize that package.json dependencies section defines npm dependencies, not system one and there's no openssl npm package of that version?

As for this proxy thing, my guess is that you're defining the proxy as HTTP one. Try setting your corporate proxy as HTTPS. That should solve the problem.

@enykeev My bad i thought that the openssl dependency defined in package.json is for the system version. I am not sure if there is an openssl npm package of that version.
I don't know if it is possible to set the corporate proxy as HTTPS because we always have the HTTP proxy link. I will try though and get back