Jenkins - Email-ext plugin - Templates - email

I am using the Jenkins plugin called email-ext and I want to get Jenkins to send an email generated from the html.jelly template which is located in $JENKINS_HOME/email-templates. The email should be always send when the code of a specific repo is built.
I have configured the email-ext plugin to always send the email when that specific repo is built and in the field 'Default Pre-send Script' I have referenced the template: ${JELLY_SCRIPT,template="html"}
However, when Jenkins builds the code the jelly script fails with the following error:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script1.groovy: 1: unexpected token: < # line 1, column 1.
<STYLE>
^
1 error
at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:302)
at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:149)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:119)
at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:131)
at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:359)
at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:142)
at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:108)
at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:236)
at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:161)
at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:846)
at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:550)
at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:526)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:503)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:302)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:281)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:731)
at groovy.lang.GroovyShell.parse(GroovyShell.java:743)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:578)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:618)
at groovy.lang.GroovyShell.evaluate(GroovyShell.java:589)
at hudson.plugins.emailext.ExtendedEmailPublisher.executePresendScript(ExtendedEmailPublisher.java:450)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:311)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:297)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:244)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:761)
at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:721)
at hudson.model.Build$BuildExecution.cleanUp(Build.java:192)
at hudson.model.Run.execute(Run.java:1764)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:89)
at hudson.model.Executor.run(Executor.java:240)
Do you have any solutions to solve this problem?
I appreciate any help, Thank you!

Please provide Jenkins and Email-ext version numbers.
Try to put ${JELLY_SCRIPT,template="html"} in the email "Default Content"
That should work.

Related

Error: HttpError: Resource not accessible by integration when using merge-schedule-action

I am attempting to use merge-schedule-action to update my webcomic. However the workflow job fails. The description goes like:
/schedule 2022-01-02(which is it)
But I get an error when it runs the job after creating the pull request.
Run gr[2](https://github.com/AHumanIBelieve/ahumanibelieve.github.io/actions/runs/3817569850/jobs/6493904876#step:2:2)m/merge-schedule-action#v2
with:
merge_method: merge
time_zone: UTC
require_statuses_success: false
automerge_fail_label: automerge-fail
env:
GITHUB_TOKEN: ***
Handling pull request opened for https://github.com/AHumanIBelieve/ahumanibelieve.github.io/pull/[5](https://github.com/AHumanIBelieve/ahumanibelieve.github.io/actions/runs/3817569850/jobs/6493904876#step:2:4)
Schedule date found: "2022-01-02"
Error: HttpError: Resource not accessible by integration
Is there something I am missing or is it just my repo? Do I need to give it permissions or something?
Link to pull request: AHumanIBelieve/ahumanibelieve.github.io#5
I have tried copy and pasting the workflow yaml file directly, but it doesn't work.
https://github.com/marketplace/actions/merge-schedule

rundeck git-plugin failed with error "No such property: op for class: com.rundeck.plugin.GitCloneWorkflowStep"

I want to use this plugin: git-plugin -> https://github.com/rundeck-plugins/git-plugin
but i'm face to an issue. When i use it, it failed with that error:
Workflow result: , step failures: {1=PluginFailed: No such property: op for class: com.rundeck.plugin.GitCloneWorkflowStep
However, the installation is quite easy and straight forward.
Just download .jar and put it in /var/lib/rundeck/libext folder with good rights.
I have already used it with success in another instance of rundeck.
But here, i don't know why it doesn't work.
Any tips or advice ?
regards
I reproduced the issue:
[2020-04-07 09:15:48.511] ERROR ExecutionUtilService --- [eduler_Worker-7] Execution failed: 8 in project ProjectGITHUB: [Workflow result: , step failures: {1=PluginFailed: No such property: op for class: com.rundeck.plugin.GitCloneWorkflowStep}, status: failed]
You need to put the path of your repo (Git URL textbox) on the Git Clone workflow step in this way (i used HTTPS way to connect):
https://user#github.com/user/test.git
Instead of:
https://user#github.com/user
(or an inexistent URL address)
Here you can see how to configure it. And here a Related thread.

Crowdin error when I tried to upload translations

I've an issue (I'm still blocked), I've created my configuration file like :
project_identifier: test
api_key: KeepTheAPIkeySecret
base_url: https://api.crowdin.com
base_path: /path/to/your/project
files:
-
source: /locale/en/LC_MESSAGES/messages.po
translation: /locale/%two_letters_code%/LC_MESSAGES/%original_file_name%
See : https://github.com/crowdin/crowdin-cli
However, I received an error message when I execute my command line to upload translation in Crowdin :
error: Seems Crowdin server API URL is not valid.
Please check the `base_url` parameter in the configuration file.
I don't know why it's not working!Thanks for any help !
Crowdin sent me another JAR,
The last one was not good for windows path.

Where are the logs for Kaleo workflow error: An error occurred in the workflow engine

I would like to know where to see more details on this Kaleo workflow error: An error occurred in the workflow engine.
I modified the single-approver-definition.xml to assign tasks to approvers depending on the category of the web content but I am unable to find the error. I also used Liferay's categorisation definition but am getting the same error.
https://github.com/liferay/liferay-plugins/blob/master/webs/kaleo-web/docroot/WEB-INF/src/META-INF/definitions/category-specific-definition.xml
Thank you!
Replace the code :
<?xml version="1.0"?>
<workflow-definition xmlns="urn:liferay.com:liferay-workflow_6.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:liferay.com:liferay-workflow_6.1.0 http://www.liferay.com/dtd/liferay-workflow-definition_6_1_0.xsd">
in header code xml. It resolves the problem.

Not able to send/receive email from Jenkins using Email-ext plugin

I am using Jenkins ver. 1.463 running on 32-bit Windows Server. I have installed Email-ext plugin version 2.30.2.
I am unable to get any email notifications.
What i am trying to do - is send an email after every job - irrespective of whether the operation is success, failure, abort, not-build, etc..
I am using Jenkins to run Automated Test Suites.
The way i have configured a test job is "In the Post-Build Actions , have selected Editable Email Notification", and filled in the required fields(recipient list,etc). In the Advanced - selected all the triggers from dropdown such as "Success, Failure, Aborted, Regression, Fixed, Not-Built, Stable.
i have verified the smtp server, recipients, Still I am unable to get any email,
in the Console Output of the job i see the following lines
Email was triggered for: Success
Sending email for trigger: Success.
In the Jenkins Server, in the "jenkins.err.log", see the following error message / exception being thrown, but dont know the exact cause
Aug 27, 2013 5:41:57 PM hudson.model.Run run
INFO: TestJob-for-Email #7 main build action completed: SUCCESS
Aug 27, 2013 5:41:58 PM hudson.model.Executor run
SEVERE: Executor threw an exception
java.lang.NoSuchMethodError: hudson.model.AbstractBuild.getPreviousBuild()Lhudson/model/AbstractBuild;
at hudson.plugins.emailext.plugins.content.BuildStatusContent.evaluate(BuildStatusContent.java:71)
at org.jenkinsci.plugins.tokenmacro.DataBoundTokenMacro.evaluate(DataBoundTokenMacro.java:177)
at org.jenkinsci.plugins.tokenmacro.TokenMacro.expand(TokenMacro.java:177)
at org.jenkinsci.plugins.tokenmacro.TokenMacro.expandAll(TokenMacro.java:219)
at hudson.plugins.emailext.plugins.ContentBuilder.transformText(ContentBuilder.java:63)
at hudson.plugins.emailext.ExtendedEmailPublisher.setSubject(ExtendedEmailPublisher.java:687)
at hudson.plugins.emailext.ExtendedEmailPublisher.createMail(ExtendedEmailPublisher.java:485)
at hudson.plugins.emailext.ExtendedEmailPublisher.sendMail(ExtendedEmailPublisher.java:319)
at hudson.plugins.emailext.ExtendedEmailPublisher._perform(ExtendedEmailPublisher.java:311)
at hudson.plugins.emailext.ExtendedEmailPublisher.perform(ExtendedEmailPublisher.java:271)
at hudson.tasks.BuildStepMonitor$3.perform(BuildStepMonitor.java:36)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:710)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:685)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.cleanUp(MavenModuleSetBuild.java:1018)
at hudson.model.Run.run(Run.java:1478)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:477)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:239)
Could someone please help,Thanks a lot!
You need to upgrade Jenkins. Your version is too old for the version of the email-ext plugin that you're using. See https://issues.jenkins-ci.org/browse/JENKINS-18728