ndelitski / rancher-alarms

Will kick your ass if found unhealthy service in Rancher environment
85 stars 20 forks source link

SSL error with email notification #25

Closed courcelm closed 7 years ago

courcelm commented 7 years ago

30/01/2017 10:37:50[ERROR] 2017-1-30 15:37:49:994 { [Error: 140126026197800:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794: 30/01/2017 10:37:50] 30/01/2017 10:37:50 cause: 30/01/2017 10:37:50 [Error: 140126026197800:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794: 30/01/2017 10:37:50 ], 30/01/2017 10:37:50 isOperational: true } Error: 140126026197800:error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol:../deps/openssl/openssl/ssl/s23_clnt.c:794: 30/01/2017 10:37:50 30/01/2017 10:37:50 at Error (native) 30/01/2017 10:37:50 30/01/2017 10:37:50npm ERR! Linux 4.4.0-59-generic 30/01/2017 10:37:50npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "start" 30/01/2017 10:37:50npm ERR! node v4.7.2 30/01/2017 10:37:50npm ERR! npm v2.15.11 30/01/2017 10:37:50npm ERR! code ELIFECYCLE 30/01/2017 10:37:50npm ERR! rancher-alarms@0.1.7 start: node bin/rancher-alarms.js 30/01/2017 10:37:50npm ERR! Exit status 1 30/01/2017 10:37:50npm ERR! 30/01/2017 10:37:50npm ERR! Failed at the rancher-alarms@0.1.7 start script 'node bin/rancher-alarms.js'. 30/01/2017 10:37:50npm ERR! This is most likely a problem with the rancher-alarms package, 30/01/2017 10:37:50npm ERR! not with npm itself. 30/01/2017 10:37:50npm ERR! Tell the author that this fails on your system: 30/01/2017 10:37:50npm ERR! node bin/rancher-alarms.js 30/01/2017 10:37:50npm ERR! You can get information on how to open an issue for this project with: 30/01/2017 10:37:50npm ERR! npm bugs rancher-alarms 30/01/2017 10:37:50npm ERR! Or if that isn't available, you can get their info via: 30/01/2017 10:37:50npm ERR! 30/01/2017 10:37:50npm ERR! npm owner ls rancher-alarms 30/01/2017 10:37:50npm ERR! There is likely additional logging output above. 30/01/2017 10:37:50 30/01/2017 10:37:50npm ERR! Please include the following file with any support request: 30/01/2017 10:37:50npm ERR! /usr/src/app/npm-debug.log

flaccid commented 7 years ago

SSL23_GET_SERVER_HELLO:unknown protocol typically indicates that the server communicated with doesn't support SSL or at least the version trying to handshake with. Best to at least show your config and advise what the server/port supports (hopefully the config isn't connecting to plain SMTP).

courcelm commented 7 years ago

I'm trying to use gmail server.

Here is my docker-compose.yml

Send SMTP notifications with using full list of sutomization parameters

rancher-alarms: image: ndelitski/rancher-alarms environment: ALARM_EMAIL_ADDRESSES: myemail ALARM_EMAIL_USER: user ALARM_EMAIL_PASS: pass ALARM_EMAIL_SMTP_HOST: smtp.gmail.com ALARM_EMAIL_SMTP_PORT: 587 ALARM_EMAIL_FROM: 'Alarm of a Night Watch alarm@user@gmail.com' ALARM_EMAIL_SSL: true ALARM_EMAIL_SUBJECT: '[Rancher-Alarms] problems with #{serviceName}' ALARM_EMAIL_TEMPLATE: 'service #{serviceName} become #{monitorState}' labels: io.rancher.container.create_agent: true io.rancher.container.agent.role: environment

flaccid commented 7 years ago

587 requires TLS. For SSL use 465. https://support.google.com/a/answer/176600?hl=en

courcelm commented 7 years ago

It works. Thanks!