Re: Jenkins not able to launch the slave due to unrecognizable JAVA_HOME

2024-04-19 Thread 'Maciej Jaros' via Jenkins Users

Just do this on the agent:

 * Get JDK 17 from Adoptium
   
   (Linux x64 in my case).
 * Unpack to |/var/jenkins|.
 * Rename unpacked “jdk[version]” to “jdk”.
 * Check: |/var/jenkins/jdk/bin/java -version|

Jenkins agent will use |/var/jenkins/jdk/bin/java| over any other version.

Cheers,
Nux

Sai Bhargav Kottisa (2024-04-18 18:40):

Hi,

I have upgraded java on both the controller and agent machines to 
OpenJdk 17 and tried to launch again via ssh but still i am getting 
the same error


*Controller* machine(*/usr/lib/jvm/Openjdk_17.0.6.0/bin/java*
* drwxr-xr-x* 10 *root* *root* 131 Jan 13  2023 *Openjdk_17.0.6.0* )
*
*
*Agent* machine (*/etc/java/Openjdk_17.0.6.0/bin/java*
*drwxr-xr-x* 10 *root    root*      131 Jan 14  2023 *Openjdk_17.0.6.0*)

SSHLauncher{host='md1npdvlnx416.dev.corp.local', port=22, 
credentialsId='taf-jenkins', jvmOptions='', javaPath='', 
prefixStartSlaveCmd='', suffixStartSlaveCmd='', 
launchTimeoutSeconds=60, maxNumRetries=10, retryWaitTime=15, 
sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy, 
tcpNoDelay=true, trackCredentials=true} [04/18/24 12:27:46] [SSH] 
Opening SSH connection to md1npdvlnx416.dev.corp.local:22. [04/18/24 
12:27:46] [SSH] WARNING: SSH Host Keys are not being verified. 
Man-in-the-middle attacks may be possible against this connection. 
[04/18/24 12:27:46] [SSH] Authentication successful. [04/18/24 
12:27:46] [SSH] The remote user's environment is: Checking Java 
version in the PATH Java is not in the PATH nor configured with the 
javaPath setting, Jenkins will try to guess where is Java, this guess 
will be removed in the future. :Launch agents via SSH [04/18/24 
12:27:46] [SSH] Checking java version of /var/lib/jenkins/jdk/bin/java 
Couldn't figure out the Java version of /var/lib/jenkins/jdk/bin/java 
[04/18/24 12:27:46] [SSH] Checking java version of java Couldn't 
figure out the Java version of java [04/18/24 12:27:46] [SSH] Checking 
java version of /usr/bin/java Couldn't figure out the Java version of 
/usr/bin/java [04/18/24 12:27:46] [SSH] Checking java version of 
/usr/java/default/bin/java Couldn't figure out the Java version of 
/usr/java/default/bin/java [04/18/24 12:27:46] [SSH] Checking java 
version of /usr/java/latest/bin/java Couldn't figure out the Java 
version of /usr/java/latest/bin/java [04/18/24 12:27:46] [SSH] 
Checking java version of /usr/local/bin/java Couldn't figure out the 
Java version of /usr/local/bin/java [04/18/24 12:27:46] [SSH] Checking 
java version of /usr/local/java/bin/java Couldn't figure out the Java 
version of /usr/local/java/bin/java java.io.IOException: Java not 
found on hudson.slaves.SlaveComputer@3242743c. Install Java 8 or Java 
11 on the Agent. at 
hudson.plugins.sshslaves.JavaVersionChecker.resolveJava(JavaVersionChecker.java:83) 
at 
hudson.plugins.sshslaves.SSHLauncher.lambda$launch$0(SSHLauncher.java:460) 
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) 
at 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) 
at 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) 
at java.base/java.lang.Thread.run(Thread.java:829) [04/18/24 12:27:46] 
Launch failed - cleaning up connection [04/18/24 12:27:46] [SSH] 
Connection closed.




--
You received this message because you are subscribed to the Google Groups "Jenkins 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7fab73df-4486-1e10-a05a-5c846ac6a89c%40mol.com.pl.


Re: email-ext - Override default - groovy-html.template

2024-04-19 Thread 'christop...@googlemail.com' via Jenkins Users
Hi,


Oh, email-ext, one of my current favorite topics
I am calling it a little differently and that's working (for me it's jelly 
instead of groovy but groovy worked before also):

def mailbody = '${JELLY_SCRIPT, template="template.jelly"}'
def mailsubject = 'Jenkins Build ' + currentBuild.fullDisplayName + ' 
finished: ' + currentBuild.currentResult
emailext attachLog: false, body: mailbody, recipientProviders: [culprits(), 
brokenTestsSuspects(), brokenBuildSuspects(), upstreamDevelopers()], 
subject: mailsubject

Anyone familiar with that problem: 
"JellyException: Could not parse Jelly script : null"?

I found several solutions to support developing the jelly script:
- the email-ext template-testing link in the job page: not working with 
scripted pipeline
- a couple lines of groovy script for the script console to trigger new 
email execution from a finished job: not working due to syntax problems and 
obviously made for a lot older API
- a lot of published jelly-script snippets to add output from the one and 
other plugin: a lot of syntax errors everywhere

What's the latest best way to develop this stuff? 
Is there any way to trigger exeuction based on an existing job? 
Any way to get that origniating parser exception to find the real issue?

BR,
Christoph
Zach Hurlburt schrieb am Donnerstag, 18. April 2024 um 19:40:18 UTC+2:

>
> I am trying to find a way to override the default groovy-html.template for 
>> email-ext.
>>
>> The main reason is because we have several declarative pipelines that use 
>> a post action for catching build failures as such:
>>
>> ```
>> emailext attachLog: true, body: '''${SCRIPT, 
>> template="groovy-html.template"}''',
>> subject: '[ITCO] Failure: ${JOB_NAME}',
>> to: 'ema...@domain.com',
>> mimeType: 'text/html'
>>
>> ```
>>
>> I tried placing the exact same name of the template 
>> *groovy-html.template* in ${JENKINS_HOME}\email-templates but it doesn't 
>> look like it gets used.
>>
>> Outside of naming this template to something else, does anyone have any 
>> ideas?
>>
>> Thanks
>>
>
> Zach
>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/f9cbbd11-4532-414a-828d-7a7da55c2694n%40googlegroups.com.