GithubHelp home page GithubHelp logo

rundeck-telegram-plugin's People

Contributors

ajrnz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rundeck-telegram-plugin's Issues

Broken parts on version 3

Hi there, I've been using this plugin for a year ago always in version 2.10+, but it seems to have a little broke part in version3. For example, ${dateEnded} doesn't work anymore returning this exception:

rundeck stderr | Can't convert the date to a string, because it is not known which parts of the date variable are in use. Use ?date, ?time or ?datetime built-in, or ?string.<format> or ?string(format) built-in with this date.
The problematic instruction:
==> ${dateEnded} [on line 3, column 1 in message]

So far this is the only issue I found from the version2 to the version3. It would be very nice some fix for that... ;-)

emoji support

Please add support for sending emoji.
πŸ”₯ for example

[ERRO] Failed to send Telegram message: java.net.UnknownHostException: api.telegram.org

Helo, friend,

I configured the plugin but it does not send messages to the Telegram chat and presents the error below in the log file. Would you have any suggestions as to where the problem is?

Config: {botAuthToken=000000000:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, telegramApiBaseUrl=https://api.telegram.org , chatId=-123456789, templateName=status.ftl, templateMessage=Backup, telegramProperties=/etc/rundeck/telegram.properties, templateDir=/var/lib/rundeck/templates, projectBotAuthToken=messenger_bot, rundeckApiKey=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX, includeJobLog=true, templateNameProject=status.ftl}
templateDir: /var/lib/rundeck/templates
Failed to send Telegram message: java.net.UnknownHostException: api.telegram.org
java.net.UnknownHostException: api.telegram.org

status.ftl:

${job.project}: ${job.group}/${job.name}
Status: ${status} (${context.job.execid})

telegram.properties:

telegram.ids.chat.Devops-Forge=-123456789
telegram.ids.bot.messenger_bot=000000000:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
framework.plugin.Notification.TelegramNotification.templateNameProject=status.ftl
framework.plugin.Notification.TelegramNotification.templateDir=/var/lib/rundeck/templates
framework.plugin.Notification.TelegramNotification.projectBotAuthToken=000000000:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Project Configuration File

#Thu May 14 14:10:07 BRT 2020
#edit below
project.description=This Project running jobs for devops tools
project.disable.executions=false
project.disable.schedule=false
project.execution.history.cleanup.batch=500
project.execution.history.cleanup.enabled=true
project.execution.history.cleanup.retention.days=60
project.execution.history.cleanup.retention.minimum=50
project.execution.history.cleanup.schedule=0 0 0 1/1 * ? *
project.gui.motd.display=projectList,projectHome,navbar
project.gui.readme.display=projectList,projectHome
project.jobs.gui.groupExpandLevel=1
project.label=DevOpsCore
project.name=DevOpsCore
project.output.allowUnsanitized=true
project.plugin.Notification.TelegramNotification.projectBotAuthToken=messenger_bot
project.plugin.Notification.TelegramNotification.rundeckApiKey=GPPkXHAlOhsZ4AStMmGK4tjpOUhcwSlC
project.plugin.Notification.TelegramNotification.telegramApiBaseUrl=https\://api.telegram.org 
project.plugin.Notification.TelegramNotification.templateDir=/var/lib/rundeck/templates
project.plugin.Notification.TelegramNotification.templateNameProject=status.ftl
project.ssh-authentication=privateKey
project.ssh-command-timeout=0
project.ssh-connect-timeout=0
project.ssh-keypath=/var/lib/rundeck/.ssh/id_rsa
resources.source.1.type=local
resources.source.2.config.file=/etc/rundeck/nodes/indra-registry.xml
resources.source.2.config.format=resourcexml
resources.source.2.config.requireFileExists=true
resources.source.2.type=file
resources.source.3.config.file=/etc/rundeck/nodes/projdocker.xml
resources.source.3.config.format=resourcexml
resources.source.3.config.requireFileExists=true
resources.source.3.type=file
resources.source.4.config.file=/etc/rundeck/nodes/docker-prod-01.xml
resources.source.4.config.format=resourcexml
resources.source.4.config.requireFileExists=true
resources.source.4.type=file
service.FileCopier.default.provider=jsch-scp
service.NodeExecutor.default.provider=jsch-ssh

Notification Print:

Capturar

proxy settings via env

Please add support for proxy with auth and switch to standard proxy settings approach

currently i have standard proxy environment http_proxy/https_proxy.
by default i can provide such an url

      export {http,https,ftp}_proxy="http://user:pass@proxy:port/"
      export no_proxy=localhost,127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16

Please switch to that method for setting up proxy.

Got error with telegram chat id not int but long

As far as i can see i got telegram chatid that not fits into int type. but only long.
that's why i got
Missing auth token or chat Id in logs.
and

  def lookupChat(chatNameOrId: String): Option[Int] = {
    lookupNameOrId("chat", chatNameOrId).flatMap(x=> Try(x.toInt).toOption)
  }

is not working silently...
simple changes with

  def lookupChat(chatNameOrId: String): Option[Int] = {
    lookupNameOrId("chat", chatNameOrId).flatMap(x=> Try(x.toLong).toOption)
  }

is not compile.

[info] Compiling 1 Scala source to /opt/target/classes...
[error] /opt/src/main/scala/ajr/rundeck/telegram/TelegramIds.scala:22: type mismatch;
[error]  found   : Option[Long]
[error]  required: Option[Int]
[error]     lookupNameOrId("chat", chatNameOrId).flatMap(x=> Try(x.toLong).toOption)
[error]                                                                    ^
[error] one error found
[error] (compile:compileIncremental) Compilation failed

Incorrect plugin logic

Plugin version 1.1.3
Rundeck version 3.2.8
The description of the plugin says that we can configure chatId in project configuration
project.plugin.Notification.TelegramNotification.chatId=value
But it does not work. If we tick "Telegram" all settings such as bot token, chat id template text must be declared in Job-Notification tab. For example, this plugin https://github.com/higanworks/rundeck-slack-incoming-webhook-plugin
works that way: all settings are declared at the project level in the project configuration. If we click the checkmark "Slack", the form allows us to override the values, if we don’t enter anything there, the settings are taken from the project settings.
Tell me, did I correctly describe the logic of the plugin? If so, why are the settings for the project level specified in the description? If not, what could I configure wrong?

Notification in Markdown or HTML

Add the possibility to send a notification in Markdown.

It would be interesting to allow the modification of the parse_mode option of the Telegram API so that users can define a formatting in Markdown or HTML

Failed to send Telegram message: java.lang.IllegalArgumentException: source == null

I am trying to define a global template.

In my job definition I set "Bot name" and "Chat name" and leave the rest empty.

framework.properties:
framework.plugin.Notification.TelegramNotification.templateNameProject=telegram-status.ftl

The file is in /var/lib/rundeck/templates

I haven't set any other config options so I might be misunderstanding the README.

The error I get is:

templateDir: /var/lib/rundeck/templates

Failed to send Telegram message: java.lang.IllegalArgumentException: source == null
java.lang.IllegalArgumentException: source == null
        at freemarker.cache.StringTemplateLoader$StringTemplateSource.<init>(StringTemplateLoader.java:156)
        at freemarker.cache.StringTemplateLoader.putTemplate(StringTemplateLoader.java:128)
        at freemarker.cache.StringTemplateLoader.putTemplate(StringTemplateLoader.java:109)
        at ajr.rundeck.telegram.TelegramNotificationPlugin.buildMessage(TelegramNotificationPlugin.scala:236)
        at ajr.rundeck.telegram.TelegramNotificationPlugin.postNotification(TelegramNotificationPlugin.scala:141)
        at com.dtolabs.rundeck.plugins.notification.NotificationPlugin$postNotification.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:144)
        at rundeck.services.NotificationService.triggerPlugin(NotificationService.groovy:556)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:352)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:193)
        at rundeck.services.NotificationService$_triggerJobNotification_closure9.doCall(NotificationService.groovy:405)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at groovy.lang.Closure.call(Closure.java:418)
        at groovy.lang.Closure.call(Closure.java:434)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2125)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2110)
        at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:2163)
        at org.codehaus.groovy.runtime.dgm$165.invoke(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite$PojoMetaMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java:274)
        at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java:56)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
        at rundeck.services.NotificationService.triggerJobNotification(NotificationService.groovy:181)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:352)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:185)
        at rundeck.services.NotificationService$__tt__triggerJobNotification_closure12.doCall(NotificationService.groovy:123)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at groovy.lang.Closure.call(Closure.java:418)
        at groovy.lang.Closure.call(Closure.java:434)
        at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
        at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)
        at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:1014)
        at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:966)
        at org.grails.datastore.gorm.GormStaticApi.withNewTransaction(GormStaticApi.groovy:927)
        at org.grails.datastore.gorm.GormEntity$Trait$Helper.withNewTransaction(GormEntity.groovy:952)
        at org.grails.datastore.gorm.GormEntity$Trait$Helper$withNewTransaction$9.call(Unknown Source)
        at rundeck.ScheduledExecution.withNewTransaction(ScheduledExecution.groovy)
        at rundeck.ScheduledExecution$withNewTransaction$18.call(Unknown Source)
        at rundeck.services.NotificationService.$tt__triggerJobNotification(NotificationService.groovy:120)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:947)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:930)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethodSafe(InvokerHelper.java:92)
        at rundeck.services.NotificationService$_triggerJobNotification_closure5.doCall(NotificationService.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at groovy.lang.Closure.call(Closure.java:418)
        at groovy.lang.Closure.call(Closure.java:434)
        at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
        at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)
        at rundeck.services.NotificationService.triggerJobNotification(NotificationService.groovy)
        at rundeck.services.NotificationService$triggerJobNotification.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:144)
        at rundeck.services.ExecutionService$__tt__saveExecutionState_closure137.doCall(ExecutionService.groovy:2744)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at groovy.lang.Closure.call(Closure.java:418)
        at groovy.lang.Closure.call(Closure.java:434)
        at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
        at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)
        at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:1014)
        at org.grails.datastore.gorm.GormStaticApi.withTransaction(GormStaticApi.groovy:966)
        at org.grails.datastore.gorm.GormStaticApi.withNewTransaction(GormStaticApi.groovy:927)
        at org.grails.datastore.gorm.GormEntity$Trait$Helper.withNewTransaction(GormEntity.groovy:952)
        at org.grails.datastore.gorm.GormEntity$Trait$Helper$withNewTransaction$9.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:136)
        at rundeck.Execution.withNewTransaction(Execution.groovy)
        at rundeck.Execution$withNewTransaction$6.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
        at rundeck.services.ExecutionService.$tt__saveExecutionState(ExecutionService.groovy:2636)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod(InvokerHelper.java:947)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:930)
        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethodSafe(InvokerHelper.java:92)
        at rundeck.services.ExecutionService$_saveExecutionState_closure47.doCall(ExecutionService.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at groovy.lang.Closure.call(Closure.java:418)
        at groovy.lang.Closure.call(Closure.java:434)
        at grails.gorm.transactions.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:94)
        at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:133)
        at grails.gorm.transactions.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:91)
        at rundeck.services.ExecutionService.saveExecutionState(ExecutionService.groovy)
        at rundeck.services.ExecutionService$saveExecutionState$28.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at rundeck.quartzjobs.ExecutionJob$_saveState_closure4.doCall(ExecutionJob.groovy:572)
        at rundeck.quartzjobs.ExecutionJob$_saveState_closure4.doCall(ExecutionJob.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:41)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:56)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120)
        at rundeck.quartzjobs.ExecutionJob.withRetry(ExecutionJob.groovy:508)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite$PogoCachedMethodSiteNoUnwrap.invoke(PogoMetaMethodSite.java:190)
        at org.codehaus.groovy.runtime.callsite.PogoMetaMethodSite.callCurrent(PogoMetaMethodSite.java:59)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
        at rundeck.quartzjobs.ExecutionJob.saveState(ExecutionJob.groovy:582)
        at rundeck.quartzjobs.ExecutionJob$saveState$5.callCurrent(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
        at rundeck.quartzjobs.ExecutionJob.execute_internal(ExecutionJob.groovy:171)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:352)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:68)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:51)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:157)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:169)
        at rundeck.quartzjobs.ExecutionJob$_execute_closure1.doCall(ExecutionJob.groovy:98)
        at rundeck.quartzjobs.ExecutionJob$_execute_closure1.doCall(ExecutionJob.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at org.codehaus.groovy.runtime.metaclass.ClosureMetaClass.invokeMethod(ClosureMetaClass.java:264)
        at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1034)
        at groovy.lang.Closure.call(Closure.java:418)
        at groovy.lang.Closure.call(Closure.java:412)
        at com.codahale.metrics.Timer.time(Timer.java:99)
        at com.codahale.metrics.Timer$time$0.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:128)
        at rundeck.quartzjobs.ExecutionJob.execute(ExecutionJob.groovy:97)
        at org.quartz.core.JobRunShell.run(JobRunShell.java:202)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:573)

Can you see what I am doing wrong?

Failed to send telegram when running Rundeck on SSL (HTTPS)

In /var/log/rundeck/service.log:

Failed to send Telegram message: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

Running Rundeck 2.7.1 on docker using https://hub.docker.com/r/jordan/rundeck/

I managed to resolved it by manually importing SSL certificate from api.telegram.org using the following steps:

echo | openssl s_client -connect api.telegram.org:443 2>&1 | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > api-telegram-org.pub
keytool -import -file api-telegram-org.pub -alias api-telegram-org -keystore /etc/rundeck/ssl/truststore
/etc/init.d/rundeckd restart

But I wonder if this can be done automatically upon Rundeck installing the plugin the first time.

Failed do send Message: javax.net.ssl.SSLException

Hello, I got an error while trying to send telegram message:

Failed to send Telegram message: javax.net.ssl.SSLException: java.lang.RuntimeException: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty

full log: log.txt

Rundeck 3.0.8 on windows with version 1.0.6 of the plugin.
Can you help me make this work?

Thanks.

Enabling logs doesn't work

Hi,

i am trying to add logs to my telegram notifcations.
I create a rundeck api token.
And edit the project settigs like:
Bildschirmfoto 2022-11-14 um 12 06 28

Then i configured the job:
Bildschirmfoto 2022-11-14 um 12 08 13

But still no log output in my messages. If I insert a message it works. But still no logs.
Do I miss somthing?
Currently running rundeck 4.8 as docker conatiner.

If you need further information I will provied them asap.

Kind regards,

Michel

Failed to get execution log: java.net.SocketTimeoutException: connect timed out

I am trying to have a log file send when a job fails, but that fails with:

-01 13:45:25,581] web.requests "GET /menu/homeAjax" 172.30.92.168 https nohdke form 13 ? [application/json;charset=utf-8] (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170)

[2019-07-01 13:45:25,602] web.requests "GET /tour/listAll" 172.30.92.168 https nohdke form 5 ? [application/json;charset=utf-8] (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170)

[2019-07-01 13:45:25,767] web.requests "GET /execution/ajaxExecState/232" 172.30.92.168 https nohdke form 52 ? [application/json;charset=utf-8] (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170)

[2019-07-01 13:45:25,859] web.requests "GET /static/images/icon-tiny-disclosure-waiting.gif" 172.30.92.168 https form 4 ? [image/gif] (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170)

[2019-07-01 13:45:26,373] web.requests "GET /static/images/icon-tiny-disclosure-waiting.gif" 172.30.92.168 https form 3 ? [image/gif] (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170)

Failed to get execution log: java.net.SocketTimeoutException: connect timed out`

I do receive a Telegram message (correctly formatted), just no logfile. The API is correct, I triple checked.

Any ideas what I could try?

rundeck 3.0.21.

Error getting execution log using proxy

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"

Failed to send telegram Message: Null

Config: {telegramProperties=/etc/rundeck/telegram.properties, botAuthToken=12345678:xxxxxxxxxxxxxxxxxxxxx, templateMessage=mynet: ${job.group}/check_stuff
Status: ${status} (${context.job.execid}), templateDir=/var/lib/rundeck/templates, telegramApiBaseUrl=https://api.telegram.org, chatId=45483937, templateName=status.ftl}
Failed to send Telegram message: null
ERROR NotificationService: Notification Failed: TelegramNotification

status.ftl

${job.project}: ${job.group}/${job.name}
Status: ${status} (${context.job.execid})

telegram.properties

project.plugin.Notification.TelegramNotification.projectBotAuthToken=12345678:xxxxxxxxxxxxxxxxxxxxx
framework.plugin.Notification.TelegramNotification.projectBotAuthToken=12345678:xxxxxxxxxxxxxxxxxxxxx
project.plugin.Notification.TelegramNotification.templateDir=/var/lib/rundeck/templates
framework.plugin.Notification.TelegramNotification.templateDir=/var/lib/rundeck/templates
project.plugin.Notification.TelegramNotification.telegramApiBaseUrl=https://api.telegram.org 
telegram.ids.chat.me=myid
project.plugin.Notification.TelegramNotification.templateNameProject=status.ftl
framework.plugin.Notification.TelegramNotification.templateNameProject=status.ftl

Any suggestion?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.