ajrnz / rundeck-telegram-plugin

Allows Rundeck to send notifications to Telegram
Apache License 2.0
18 stars 9 forks source link

Error getting execution log using proxy #2

Closed alexandrevasconcelos closed 7 years ago

alexandrevasconcelos commented 7 years ago

Configuring a proxy to send notifications affects the get execution log. Our proxy doesn't resolve local ips... it's possible to include a property to bypass proxy for local address??

ERROR ExecutionUtilService: Execution failed: 129689: [Workflow result: , step failures: {1=Dispatch failed on 1 nodes: [informatica01: NonZeroResultCode: Remote command failed with exit status 255]}, Node failures: {informatica01=[NonZeroResultCode: Remote command failed with exit status 255]}, status: failed] TelegramNotification: failure

ExecutionData: {id=129689, href=https://10.121.65.85:4443/project/INFORMATICA/execution/follow/129689, status=failed, user=admin, dateStarted=2016-12-07 11:00:01.0, dateStartedUnixtime=1481119201000, dateStartedW3c=2016-12-07T14:00:01Z, description=PROCESSA OS DADOS DE CDS., argstring=null, project=INFORMATICA, failedNodeListString=informatica01, failedNodeList=[informatica01], succeededNodeListString=null, succeededNodeList=null, loglevel=INFO, dateEnded=2016-12-07 11:00:05.0, dateEndedUnixtime=1481119205000, dateEndedW3c=2016-12-07T14:00:05Z, abortedby=null, nodestatus={succeeded=0, failed=1, total=1}, job={id=a8597509-d3b7-428d-be45-efab97ff6205, href=https://10.121.65.85:4443/project/INFORMATICA/job/show/a8597509-d3b7-428d-be45-efab97ff6205, name=NOKIA_CDS, group=, project=INFORMATICA, description=PROCESSA OS DADOS DE CDS., averageDuration=29099}, context={job={loglevel=INFO, wasRetry=false, url=https://10.121.65.85:4443/project/INFORMATICA/execution/follow/129689, id=a8597509-d3b7-428d-be45-efab97ff6205, project=INFORMATICA, username=admin, retryAttempt=0, user.name=admin, name=NOKIA_CDS, serverUUID=null, group=null, serverUrl=https://10.121.65.85:4443/, execid=129689}, option={}}}

Config: {telegramProperties=/etc/rundeck/telegram.properties, botAuthToken=smart_rundeck_bot, proxyHost=10.221.199.15, templateMessage=INFORMATICA: ${job.group}/NOKIA_CDS Status: ${status} (${context.job.execid}), rundeckApiKey=OUdNwjiTIBL4Miep2OPk9JIrmx1DP8hC, templateDir=/var/lib/rundeck/templates, projectBotAuthToken=smart_rundeck_bot, includeJobLog=true, telegramApiBaseUrl=https://api.telegram.org, proxyPort=3128, chatId=alertas, templateName=} Using proxy: 10.221.199.15:3128 templateDir: /var/lib/rundeck/templates Telegram mesage sent Failed to get execution log: java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 403 Forbidden"

ajrnz commented 7 years ago

Thanks for the report.

The proxy should not be being used to retrieve the job log from the RunDeck instance.

I've make a fix which I can't check at the moment. Can you please have a go (pre-release v1.0.4) and let me know if it solves your problem.

alexandrevasconcelos commented 7 years ago

Hi,

the fix works, but now we have another problem with ssl certificates.... rundeck is running in https without certificate and get log fails with a SSLException... is possible to fix this??

Config: {telegramProperties=/etc/rundeck/telegram.properties, botAuthToken=smart_rundeck_bot, proxyHost=10.221.199.15, templateMessage=INFORMATICA: ${job.group}/EAQ_CDR Status: ${status} (${context.job.execid}), rundeckApiKey=OUdNwjiTIBL4Miep2OPk9JIrmx1DP8hC, templateDir=/var/lib/rundeck/templates, projectBotAuthToken=smart_rundeck_bot, includeJobLog=true, telegramApiBaseUrl=https://api.telegram.org, proxyPort=3128, chatId=alertas, templateName=} Using proxy: 10.221.199.15:3128 templateDir: /var/lib/rundeck/templates Telegram mesage sent Failed to get execution log: javax.net.ssl.SSLHandshakeException: java.security.cert.CertificateException: No subject alternative names present 2016-12-08 08:00:08.586:WARN:oeji.nio:javax.net.ssl.SSLException: Received fatal alert: certificate_unknown

ajrnz commented 7 years ago

You have a few options here:

I guess it would be possible with a config option and a bit of work but it's not really something I'm very keen on.