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

2024-04-18 Thread Ivan Fernandez Calvo
[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,

What happens if you enter by SSH in the agent with the same user you use to 
connect the Jenkins controller and execute java?

>ssh my-jenkins-user@my-ssh-agent
>java

I will guess

>command not found


On Thursday, April 18, 2024 at 6:40:23 PM UTC+2 sai.bh...@gmail.com wrote:

> 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 *rootroot* 
>  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.
>
>
>
>
> And also i have tried *Launch agent by connecting to controller option*
>
>
> *but i am getting below error*
> java -jar agent.jar -url http://mo1csgw2321:8080/ -secret  -name 
> "TAF-child" -workDir "/var/lib/jenkins"
> Apr 18, 2024 4:11:50 PM org.jenkinsci.remoting.engine.WorkDirManager 
> initializeWorkDir
> INFO: Using /var/lib/jenkins/remoting as a remoting work directory
> Apr 18, 2024 4:11:51 PM org.jenkinsci.remoting.engine.WorkDirManager 
> setupLogging
> INFO: Both error and output logs will be printed to 
> /var/lib/jenkins/remoting
> Apr 18, 2024 4:11:51 PM hudson.remoting.Launcher createEngine
> INFO: Setting up agent: TAF-child
> Apr 18, 2024 4:11:51 PM hudson.remoting.Engine startEngine
> INFO: Using Remoting version: 3206.vb_15dcf73f6a_9
> Apr 18, 2024 4:11:51 PM org.jenkinsci.remoting.engine.WorkDirManager 
> initializeWorkDir
> INFO: Using /var/lib/jenkins/remoting as a remoting work directory
> Apr 18, 2024 4:11:51 PM hudson.remoting.Launcher$CuiListener status
> INFO: Locating server among [http:// mo1csgw2321:8080/]
> Apr 18, 2024 4:11:51 PM hudson.remoting.Launcher$CuiListener status
> *INFO: Could not locate server among [ http:// mo1csgw2321:8080/  ]; 
> waiting 10 seconds before retry*
> *java.io.IOException: http:// mo1csgw2321:8080/tcpSlaveAgentListener/ is 
> invalid: 404 Not Found*
> at 
> 

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

2024-04-15 Thread Ivan Fernandez Calvo
>Jenkins not able to launch the slave due to unrecognizable JAVA_HOME

Stop using Slave and use Agent as a name for the Build Agents attached to 
the Jenkins Controller (no longer master)

>so could anyone please help as it is urgent

This is a User group, so NOTHING here is urgent. If someone can help, I 
will do it, but it is not mandatory, and NOBODY can request urgency here.

And now we can continue with your question. 

As Mark said Java 12 was never supported and is not a LTS. 
It is recommended that the Jenkins Controller and the Build Agent process 
be run in the same Java version to avoid compatibility issues.
As the message said, the plugin tried to find the `java` binary in the 
PATH, which was impossible, so it tried to use some hardcoded paths. The 
correct way is to configure your build agent to have a Java binary in the 
PATH. How to do it depends on your distribution and the shell you use for 
the user who connects through SSH. There is plenty of documentation about 
how to set up the environment of a system/user in Linux/Unix.

Tools location is not used to locate the Java version to run the build 
agent process, it is used on jobs, so no matter the configuration you put 
there is not used.



On Monday, April 15, 2024 at 4:30:20 PM UTC+2 Mark Waite wrote:

> On Monday, April 15, 2024 at 7:09:03 AM UTC-7 Sai wrote:
>
> Hi,
>
> I have the below machine config
>
> *(Master Jenkins)*
> OS RedHat Enterprise Linux 7.6
> openjdk version "11.0.22" 2024-01-16 LTS
> path: /usr/lib/jvm/java-11-openjdk-11.0.22.0.7-1.el7_9.x86_64/bin/java
>
>
> The Jenkins project stopped supporting RHEL 7 in Nov 2023.  RHEL 7.9 is 
> the most recent release of RHEL 7.  You're running RHEL 7.6, an outdated 
> version of an unsupported operating system.  It might work, but the Jenkins 
> project no longer tests or verifies that operating system 
>  
>
>
> * (Slave Jenkins)*
> RHEL VERSION=7.9 (Maipo)
> openjdk version "12.0.2" 2019-07-16
> path: /etc/java/jdk-12.0.2+10/bin/java
>
>
> Jenkins has never supported Java 12.  I don't recall anyone ever doing any 
> Jenkins testing or Jenkins development with Java 12.  Java 12 is also not 
> supported by the OpenJDK project.
>
> Jenkins currently supports Java 11, Java 17, and Java 21.  
>
> The installation location that you are listing for Java 12 is unexpected.  
> Applications (like Java) are not intended to be installed in the "/etc" 
> directory.  If you install Java 11 on the agent operating system using 
> either Eclipse Temurin packages or operating system packages, it will not 
> place Java in "/etc".
>
> Your options include:
>
>- Install Java 11 on the agent and plan for future operating system 
>upgrades to replace RHEL 7 with something that is supported
>- Continue attempts with Java 12 on the agent after assuring that Java 
>12 is actually installed.  You'll be running an unsupported, untested 
>Jenkins configuration with an unsupported Java version
>- Install Java 17 on the controller and on the agent  and plan for 
>future operating system upgrades to replace RHEL 7 with something that is 
>supported
>- Install Java  21 on the controller and on the agent  and plan for 
>future operating system upgrades to replace RHEL 7 with something that is 
>supported
>
>
> but still jenkins not recognizing JAVA path
>
> so could anyone please help as it is urgent
>
>

-- 
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/77c5824d-4885-41f8-8d7e-03951a001144n%40googlegroups.com.


Re: k8smaster server works like a worker

2023-11-29 Thread Ivan Fernandez Calvo
The Jenkins Controller is always shown in Build Agents. You can set 
executors to 0 to avoid using it for build, but it will still appear in 
Build Agents. It is how it works.

El martes, 28 de noviembre de 2023 a las 16:50:34 UTC+1, 
zorogl...@gmail.com escribió:

> Sorry to bother you. i have a problem and I couldn't solve it, can I ask a 
> question about this somehow?
> I had to ask because I couldn't find the problem somehow. Where am I 
> making a mistake?
>
>
> https://serverfault.com/questions/1148505/k8smaster-server-works-like-a-worker
>

-- 
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/570ee68d-5b53-4d8d-8349-1fa0f1f6a15fn%40googlegroups.com.


Re: Nested parallel dynamically

2023-05-17 Thread Ivan Fernandez Calvo
We resolved the dynamic matrix support by implementing a matrix step in a 
shared library,
the matrix axis are arrays that can come from files if you want 

pipeline {
  agent any

  stages {
stage('Matrix sample') {
  steps {

matrix(
  agent: 'linux',
  axes:[
axis('VAR_NAME_00', [ 1, 2 ]),
axis('VAR_NAME_01', [ 'a', 'b', 'c', 'd', 'e' ])
  ],
  excludes: [
axis('VAR_NAME_00', [ 1 ]),
axis('VAR_NAME_01', [ 'd', 'e' ]),
  ]
  ) {
echo "${VAR_NAME_00} - ${VAR_NAME_01}"
  }

}
  }
}
  }

https://github.com/elastic/apm-pipeline-library/blob/main/vars/matrix.groovy
https://github.com/elastic/apm-pipeline-library/blob/main/vars/matrix.txt

El miércoles, 17 de mayo de 2023 a las 12:29:14 UTC+2, fcenedese escribió:

> Hi
>
> I'm trying to create a pipeline which should have nested parallel
> blocks. In detail, I have a number of stages which should run on
> a number of agents. However the information where each stage
> should run is dynamic as it comes from another job (upstream).
> So declarative pipeline is not possible and doesn't support
> nested parallels anyway, I believe.
> To prevent all stages running on separate executors (and so
> blocking the execution of other jobs) I'd like to combine the
> stages for one agent into a parallel pipeline and then run all
> those agent pipelines in parallel again. It should be the same
> as if I had all stages in a single pipeline running on one agent,
> using one executor except that now multiple agents are used,
> each one running its own parallel pipeline. It's important that
> they are really parallel because the job should use as little
> time as possible. That's also the reason to use multiple agents
> instead of just one.
>
> I looked on the net and found examples for scripted pipelines
> or nested parallel stages, but I couldn't find an example that
> I could make work. I only used declarative pipelines before so
> I'm not that versed in scripted pipelines.
>
> Can someone point me to an example that goes in my direction?
>
> Thanks a lot
>
> bye Fabi
>
>

-- 
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/375c6e72-9ed6-4f45-a779-f01ca5592542n%40googlegroups.com.


Re: Send file path as a link in email body after Jenkins Scripted pipe line run

2023-02-06 Thread Ivan Fernandez Calvo
Two things here, one the whole body must be and HTML page to be sent as 
HTML, and you need the email ext plugin installed, check the documentation 
of the plugin for more details

https://plugins.jenkins.io/email-ext/
El lunes, 6 de febrero de 2023 a las 15:50:22 UTC+1, 
sunil.does...@gmail.com escribió:

> Can anyone tell me how to add a link to a file location in the email body?
> I have the below email body and I want to send the highlighted/bold 
> bit( ) as a link in  the email body after every run, 
> so, that users can click on the link from email to be take to the location, 
> but it doesn't work. .:-
>
> emailext attachLog: true, attachmentsPattern: 'target',
> subject: "Jenkins Build Report 
>  ${currentBuild.currentResult}: Job ${env.JOB_NAME} build 
> ${env.BUILD_NUMBER}",
> body: "${currentBuild.currentResult}: Job ${env.JOB_NAME} 
> \n Link: ${env.BUILD_URL} \n Drop folders can be found at
> **",
>   mimeType: 'text/html',
> to: testEmailGroup
>

-- 
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/9df81503-fa0b-4fff-a9bb-9f9d09cfe0b8n%40googlegroups.com.


Re: org.pac4j.saml.exceptions.SAMLSignatureValidationException: Signature is not trusted

2023-01-06 Thread Ivan Fernandez Calvo
Try to disable all signature options at encryption options, it that works, 
your issue is related to the public Key you use locally in your SP that is 
not configured in your IdP or the public key on the IdP metadata is not 
valid

El jueves, 5 de enero de 2023 a las 17:06:25 UTC+1, zllxll...@gmail.com 
escribió:

>
> hI..
>
> Currently, I am integrating Company IDP with Jenkins.
>
> in Saml Plugin,
>
> "signature is not trusted"
>
> Can you help me solve the Error?
>
>
> *[System Log]*
> *org.pac4j.saml.exceptions.SAMLSignatureValidationException: Signature is 
> not trustedat 
> *org.pac4j.saml.profile.impl.AbstractSAML2ResponseValidator.validateSignature(AbstractSAML2ResponseValidator.java:147)
>  
>at 
> org.pac4j.saml.sso.impl.SAML2AuthnResponseValidator.validateAssertionSignature(SAML2AuthnResponseValidator.java:669)
>  
>at 
> org.pac4j.saml.sso.impl.SAML2AuthnResponseValidator.validateAssertion(SAML2AuthnResponseValidator.java:392)
>  
>at 
> org.pac4j.saml.sso.impl.SAML2AuthnResponseValidator.validateSamlSSOResponse(SAML2AuthnResponseValidator.java:303)
>  
>at 
> org.pac4j.saml.sso.impl.SAML2AuthnResponseValidator.validate(SAML2AuthnResponseValidator.java:97)
>
>
> *[package Log]*
> 1월 05, 2023 3:58:16 
> 오후 미세 org.opensaml.xmlsec.signature.support.impl.BaseSignatureTrustEngine 
> validateSuccessfully verified signature using KeyInfo-derived credential 1월 
> 05, 2023 3:58:16 
> 오후 미세 org.opensaml.xmlsec.signature.support.impl.BaseSignatureTrustEngine 
> validateAttempting to establish trust of KeyInfo-derived credential 1월 05, 
> 2023 3:58:16 
> 오후 미세 org.opensaml.xmlsec.signature.support.impl.BaseSignatureTrustEngine 
> validateFailed to establish trust of KeyInfo-derived credential 1월 05, 2023 
> 3:58:16 
> 오후 미세 org.opensaml.xmlsec.signature.support.impl.BaseSignatureTrustEngine 
> validateFailed to verify signature and/or establish trust using any 
> KeyInfo-derived credentials 1월 05, 2023 3:58:16 
> 오후 미세 
> org.opensaml.xmlsec.signature.support.impl.ExplicitKeySignatureTrustEngine 
> doValidateAttempting to verify signature using trusted credentials 1월 05, 
> 2023 3:58:16 
> 오후 미세 
> org.opensaml.xmlsec.signature.support.impl.ExplicitKeySignatureTrustEngine 
> doValidateFailed to verify signature using either KeyInfo-derived or 
> directly trusted credentials
>
>
> *[IDP_metadata.xml]*
> 
>
>  protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol" 
> validUntil="2022-12-29T05:08:17.196Z">
> 
> http://www.w3.org/2000/09/xmldsig#;>
> 
>  Security 
> 
> 
> 
>
>  Binding="urn:oasis:names:tc:SAML:2.0:bindings:SOAP" Location="
> https://dev.idp.com:443/samlartresolve; index="1"/>
>
>  Location="
> https://dev.idp.com:443/samlsso?tenantDomain=display.company
> " ResponseLocation="
> https://dev.idp.com:443/samlsso?tenantDomain=display.company"/>
>
>  Location="
> https://dev.idp.com:443/samlsso?tenantDomain=display.company
> " ResponseLocation="
> https://dev.idp.com:443/samlsso?tenantDomain=display.company"/>
>
>  Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="
> https://dev.idp.com:443/samlsso?tenantDomain=display.company
> " ResponseLocation="
> https://dev.idp.com:443/samlsso?tenantDomain=display.company"/>
>
>  Location="
> https://dev.idp.com:443/samlsso?tenantDomain=display.company"/>
>
>  Binding="urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect" Location="
> https://dev.idp.com:443/samlsso?tenantDomain=display.company"/>
> 
> 
>
>
> *[SP_metadata.xml]*
>  xmlns:md="urn:oasis:names:tc:SAML:2.0:metadata" 
> ID="_41c554a5919e46f7a861e48142ce7828f6eb6b3" entityID="
> http://sp/securityRealm/finishLogin; 
> validUntil="2043-01-05T06:58:16.644Z">
> 
> http://www.w3.org/2001/04/xmldsig-more#rsa-sha256"/>
> http://www.w3.org/2001/04/xmldsig-more#rsa-sha384"/>
> http://www.w3.org/2001/04/xmldsig-more#rsa-sha512"/>
> http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
> http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha256"/>
> http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha384"/>
> http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha512"/>
> http://www.w3.org/2001/04/xmldsig-more#ecdsa-sha1"/>
> http://www.w3.org/2000/09/xmldsig#dsa-sha1"/>
> http://www.w3.org/2001/04/xmldsig-more#hmac-sha256"/>
> http://www.w3.org/2001/04/xmldsig-more#hmac-sha384"/>
> http://www.w3.org/2001/04/xmldsig-more#hmac-sha512"/>
> http://www.w3.org/2000/09/xmldsig#hmac-sha1"/>
> http://www.w3.org/2001/04/xmlenc#sha256"/>
> http://www.w3.org/2001/04/xmldsig-more#sha384"/>
> http://www.w3.org/2000/09/xmldsig#sha1"/>
> 
>  WantAssertionsSigned="false" 
> protocolSupportEnumeration="urn:oasis:names:tc:SAML:2.0:protocol 
> urn:oasis:names:tc:SAML:1.0:protocol urn:oasis:names:tc:SAML:1.1:protocol">
>  xmlns:init="urn:oasis:names:tc:SAML:profiles:SSO:request-init">
>  

Re: *** buffer overflow detected ***: java terminated

2022-12-03 Thread Ivan Fernandez Calvo

You do it provide any information about Jenkins version, OS version of JDK 
version so it is difficult to know the cause. Checking the stack trace your 
JDK has about two years so I guess all the rest of your system is as old as 
the JDK so update it at leas to the lates JDK 11 and  update your system 
libraries to the lates security updates that probably resolv yourissue
El viernes, 2 de diciembre de 2022 a las 22:41:06 UTC+1, Madhu Muchukota 
escribió:

> Hi Team - I am seeing frequently my Jenkins controller going down with 
> below error message
>
> *** buffer overflow detected ***: /opt/apps/java/current_java/bin/java 
> terminated
> === Backtrace: =
> /lib64/libc.so.6(__fortify_fail+0x37)[0x7f3a41b6a7a7]
> /lib64/libc.so.6(+0x116922)[0x7f3a41b68922]
> /lib64/libc.so.6(+0x118707)[0x7f3a41b6a707]
> /lib64/libglib-2.0.so.0(g_spawn_sync+0x230)[0x7f39bc703130]
> /lib64/libglib-2.0.so.0(g_spawn_command_line_sync+0x75)[0x7f39bc703805]
> /lib64/libgio-2.0.so.0(+0xb2100)[0x7f39bd095100]
>
> /lib64/libgio-2.0.so.0(g_dbus_address_get_for_bus_sync+0x340)[0x7f39bd096ad0]
> /lib64/libgio-2.0.so.0(+0xbf2fe)[0x7f39bd0a22fe]
> /lib64/libgio-2.0.so.0(g_bus_get_sync+0x56)[0x7f39bd0a7c46]
> /usr/lib64/gio/modules/libdconfsettings.so(+0x7b00)[0x7f39bb529b00]
> /usr/lib64/gio/modules/libdconfsettings.so(+0x7bed)[0x7f39bb529bed]
> /lib64/libglib-2.0.so.0(+0x48d47)[0x7f39bc6b8d47]
> /lib64/libglib-2.0.so.0(g_main_context_dispatch+0x159)[0x7f39bc6bc119]
> /lib64/libglib-2.0.so.0(+0x4c478)[0x7f39bc6bc478]
> /lib64/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7f39bc6bc52c]
> /usr/lib64/gio/modules/libdconfsettings.so(+0x7d6d)[0x7f39bb529d6d]
> /lib64/libglib-2.0.so.0(+0x735b0)[0x7f39bc6e35b0]
> /lib64/libpthread.so.0(+0x7ea5)[0x7f3a4223cea5]
> /lib64/libc.so.6(clone+0x6d)[0x7f3a41b50b0d]
> === Memory map: 
> 68000-80161f000 rw-p  00:00 0
> 80161f000-84000 ---p  00:00 0
> 5568a8c67000-5568a8c68000 r-xp  fd:04 17591637   
> /opt/apps/java/jdk-11.0.16+8/bin/java
> 5568a8e68000-5568a8e69000 r--p 1000 fd:04 17591637   
> /opt/apps/java/jdk-11.0.16+8/bin/java
>
> I am not sure what is causing Jenkins to get crashed. 
>
> Any help on this is highly appreciated please.
>
> Regards,
> Madhu M
>

-- 
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/6952b998-c7fa-4f28-b1d9-a966f7d88898n%40googlegroups.com.


Re: Warning: The new version of this plugin is marked as incompatible with the installed version.

2022-11-22 Thread Ivan Fernandez Calvo

Yes, the warning is because the change to stop supporting Java 8, the only 
way to warning you about breaking changes is to mark the plugin as 
incompatible with previous versions, this should force you to read the 
release notes and check what are the changes about, if you are in Jenkins 
2.361 and your agents have Java 11 in the path it is safe to update
El martes, 22 de noviembre de 2022 a las 15:24:40 UTC, pib...@gmail.com 
escribió:

> Going through the release notes, starting from the version you have to the 
> latest, there is one breaking change documented:[image: Screenshot 
> 2022-11-22 at 16.22.07.png]
>
> Le mar. 22 nov. 2022 à 16:10, A, Ramkumar  a écrit :
>
>> Hi,
>>
>>  
>>
>> Can you advise which documentation to refer to get the exact 
>> parameter/setting that got changed with the new version  of plugin ? I have 
>> gone throw the release notes and don’t find the info..
>>
>>  
>>
>> SSH Build Agents
>>
>> How to install
>>
>>- Documentation 
>>- Releases 
>>- Issues 
>>- Dependencies 
>>
>> [image: Jenkins Plugin]  [image: 
>> GitHub release] 
>>  [image: 
>> Jenkins Plugin Installs] 
>>
>> Provides a means to launch agents via SSH.
>>
>> Documentation
>>
>>- Configure guide 
>>
>> 
>>- Troubleshooting guide 
>>
>> 
>>- Using the plugin with Cygwin on Windows 
>>
>>
>> Changelog
>>
>>- For 1.30.0 and newer versions, see GitHub Releases 
>>
>>- For previous versions, see this file 
>>
>>
>> Notes
>>
>> This plugin is formerly known as "SSH Slaves Plugin". It was renamed in 
>> 1.31.0 
>> ,
>>  
>> but the plugin ID was retained as ssh-slaves to retain compatibility for 
>> the plugin users.
>>
>>  
>>
>>  
>>
>> *From:* 'Daniel Beck' via Jenkins Users  
>> *Sent:* 22 November 2022 20:31
>> *To:* jenkins...@googlegroups.com
>> *Subject:* Re: Warning: The new version of this plugin is marked as 
>> incompatible with the installed version.
>>
>>  
>>
>>  
>>
>>  
>>
>> On Tue, Nov 22, 2022 at 3:03 PM A, Ramkumar  wrote:
>>
>>  
>>
>> We do not want to upgrade the plugin below thinking it may break the 
>> existing Linux executor configured on Jenkins. Is that true ?
>>
>>  
>>
>> I recommend you try looking at the plugin documentation. If you have done 
>> so already, what did you find?
>>
>> -- 
>> 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-use...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/CAMo7PtJsT%2BfdCYak6g8k6aoNM%2Bq2YU%3DyC%3DdSfWekVFu6R2QERg%40mail.gmail.com
>>  
>> 
>> .
>>
>> DXC Technology India Private Limited - 9th Floor, Block-D Littlewood 
>> Tower, TRIL Info Park Ramanujan IT City, Rajiv Gandhi Salai, Taramani, 
>> Chennai - 600113. CIN: U72900TN2015FTC102489. 
>> DXC Technology Company -- This message is transmitted to you by or on 
>> behalf of DXC Technology Company or one of its affiliates. It is intended 
>> exclusively for the addressee. The substance of this message, along with 
>> any attachments, may contain proprietary, confidential or privileged 
>> information or information that is otherwise legally exempt from 
>> disclosure. Any unauthorized review, use, disclosure or distribution is 
>> prohibited. If you are not the intended recipient of this message, you are 
>> not authorized to read, print, retain, copy or disseminate any part of this 
>> message. If you have received this message in error, please destroy and 
>> delete all copies and notify the sender by return e-mail. Regardless of 
>> content, this e-mail shall not operate to bind DXC Technology Company or 
>> any of its affiliates to any order or other contract unless pursuant to 
>> explicit written agreement or government initiative expressly permitting 
>> the use of e-mail for 

Re: is there any way avoids redeclared so much "withCredentials" in scripted pipeline

2022-10-21 Thread Ivan Fernandez Calvo

Your script is doing more than o thing, your are exposing your credentials 
to more than one process, so your have a security issue in progress, but 
you do not know it yet. It is absurd to pass that amount of credential to 
one script.
El viernes, 21 de octubre de 2022 a las 8:45:26 UTC+2, kakam...@gmail.com 
escribió:

> hi my friends:
>
>
> i develop one job to do auto installation,and this job need so much 
> user/password,i refer these credentials in my scripted pipeline like below:
>
> // code placeholder
>
> withCredentials([usernamePassword(credentialsId: 'CDNativePassInfo', 
> usernameVariable: 'CDNATIVE_USER', passwordVariable: 'CDNATIVE_PASSWORD'), 
> usernamePassword(credentialsId: 'ABC_NODE_INFO', usernameVariable: 
> 'ABC_NODE_USER', passwordVariable: 'ABC_NODE_PASSWORD'), 
> usernamePassword(credentialsId: 'BOAPP_TENANT_PWD', usernameVariable: 
> 'BOAPP_TENANT_USER', passwordVariable: 'BOAPP_TENANT_PASSWORD'), 
> usernamePassword(credentialsId: 'CCE_LOGIN_INFO', usernameVariable: 
> 'CCE_LOGIN_USER', passwordVariable: 'CCE_LOGIN_PASSWORD'), 
> usernamePassword(credentialsId: 'CDTEMPLATEBO_JWTKEY', usernameVariable: 
> 'CDTEMPLATEBO_JWTKEY_NAME', passwordVariable: 'CDTEMPLATEBO_JWTKEY_VALUE'), 
> usernamePassword(credentialsId: 'CDBATCHFILEPROCESSBO_JWTKEY', 
> usernameVariable: 'CDBATCHFILEPROCESSBO_JWTKEY_NAME', passwordVariable: 
> 'CDBATCHFILEPROCESSBO_JWTKEY_VALUE'), usernamePassword(credentialsId: 
> 'CDCODEMACHINE_factor', usernameVariable: 'CDCODEMACHINE_factor_NAME', 
> passwordVariable: 'CDCODEMACHINE_factor_VALUE'), 
> usernamePassword(credentialsId: 'CDENERGYPREDICTION_clientsecret', 
> usernameVariable: 'CDENERGYPREDICTION_clientsecret_NAME', passwordVariable: 
> 'CDENERGYPREDICTION_clientsecret_VALUE'), usernamePassword(credentialsId: 
> 'CDENERGYPREDICTION_factor', usernameVariable: 
> 'CDENERGYPREDICTION_factor_NAME', passwordVariable: 
> 'CDENERGYPREDICTION_factor_VALUE'), usernamePassword(credentialsId: 
> 'CDAIRFLOW_factor', usernameVariable: 'CDAIRFLOW_factor_NAME', 
> passwordVariable: 'CDAIRFLOW_factor_VALUE'), 
> usernamePassword(credentialsId: 'CDAIRFLOW_fernet_key', usernameVariable: 
> 'CDAIRFLOW_fernet_key_NAME', passwordVariable: 
> 'CDAIRFLOW_fernet_key_VALUE'), usernamePassword(credentialsId: 
> 'ABC_MYSQL_INFO', usernameVariable: 'ABC_MYSQL_USER', passwordVariable: 
> 'ABC_MYSQL_PASSWORD'), usernamePassword(credentialsId: 'COLDMACHINE_OAUTH', 
> usernameVariable: 'COLDMACHINE_OAUTH_NAME', passwordVariable: 
> 'COLDMACHINE_OAUTH_PWD'), usernamePassword(credentialsId: 
> 'ENERGYPREDICTION_OAUTH', usernameVariable: 'ENERGYPREDICTION_OAUTH_NAME', 
> passwordVariable: 'ENERGYPREDICTION_OAUTH_PWD'), 
> usernamePassword(credentialsId: 'SECURITYVOICE_OAUTH', usernameVariable: 
> 'SECURITYVOICE_OAUTH_NAME', passwordVariable: 'SECURITYVOICE_OAUTH_PWD'), 
> usernamePassword(credentialsId: 'NATIVEBO_DB_PWD', usernameVariable: 
> 'NATIVEBO_DB_NOTCARE', passwordVariable: 'NATIVEBO_DB_PWD'), 
> usernamePassword(credentialsId: 'MYSQL_LOGIN_INFO', usernameVariable: 
> 'MYSQL_UserName', passwordVariable: 'MYSQL_PassWord'), 
> usernamePassword(credentialsId: 'OPENGAUSS_ADMIN_INFO', usernameVariable: 
> 'OPENGAUSS_ADMIN_USER', passwordVariable: 'OPENGAUSS_ADMIN_PWD') ])
> { //to do something }
>
> i think this code style is not clean code,is there any clean way to refer 
> many credentials in groovy? more clean and beautiful way
>

-- 
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/8a7885a6-483e-42f0-9f72-45ee1c4ddad2n%40googlegroups.com.


Re: jenkins issue

2022-10-11 Thread Ivan Fernandez Calvo
one more thing to pass the Git credentials to your script you could check 
this articles

https://www.jenkins.io/blog/2021/07/27/git-credentials-binding-phase-1/
https://www.youtube.com/watch?v=HSA_mZoADSw

El martes, 11 de octubre de 2022 a las 18:28:26 UTC+2, Ivan Fernandez Calvo 
escribió:

> The error is related to something your script is doing, it is not related 
> to Jenkins at all. Try to review the code you are executing and figure out 
> which line is and what is wrong. Googling the error seems related to 
> configuring the git user and git email and the git authentication when you 
> access GitHub using HTTPS URLs. It seems to be an error message from Ruby 
> code. The solution seems to add the authentication to the URL or use an 
> authentication store proper for your environment (I preferer to use gh see 
> https://cli.github.com/manual/gh_auth_setup-git), but I am not sure 
> depends on your script.
>
>
> https://stackoverflow.com/questions/54454853/fatal-could-not-read-username-for-https-github-com-no-such-device-or-addr
>
> https://stackoverflow.com/questions/69995273/access-organization-repo-on-github-using-personal-access-token-inside-bash-scrip
>
> https://itecnote.com/tecnote/ruby-on-rails-fatal-could-not-read-username-for-https-github-com-no-such-device-or-address/
> https://github.com/github/hub/issues/1644
>
> El martes, 11 de octubre de 2022 a las 13:37:53 UTC+2, pooja...@gmail.com 
> escribió:
>
>> Hi mark and Mithun,
>>
>> am getting error in jenkins 
>> [image: image.png]
>>
>> On Tue, Oct 11, 2022 at 9:59 AM pooja pooja  wrote:
>>
>>> this is my exact issue
>>>
>>> [image: image.png]
>>>
>>> On Mon, Oct 10, 2022 at 7:15 PM Mithun Raj  wrote:
>>>
>>>> 1. Update your OS,
>>>>
>>>> 2. Check if the Git credentials are injected correctly,
>>>> If running from bastion host or jump box make sure your git hub or 
>>>> enterprise hostnames and IP are updated (ask git admin) in the hosts file 
>>>> under /etc/hosts
>>>>
>>>> 3. Update—env is the Git global env for git
>>>> You can either set or unset those in your Linux machine it’s your Git 
>>>> ID and pass which you can set as global access. not recommended if you 
>>>> have 
>>>> set it under Jenkins credentials.
>>>>
>>>>
>>>> On Mon, 10 Oct 2022 at 5:49 PM, pooja pooja  wrote:
>>>>
>>>>> in jenkins am getting below error
>>>>> New release '22.04.1 LTS' available. Run 'do-release-upgrade' to 
>>>>> upgrade to it.
>>>>>  fatal: could not read Username for 'https://github.com': No such 
>>>>> device or address
>>>>>  Use --update-env to update environment variables
>>>>>
>>>>> -- 
>>>>> 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-use...@googlegroups.com.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/jenkinsci-users/cec7b2ee-88ba-417d-be66-95d4954dbbfen%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/jenkinsci-users/cec7b2ee-88ba-417d-be66-95d4954dbbfen%40googlegroups.com?utm_medium=email_source=footer>
>>>>> .
>>>>>
>>>> -- 
>>>> 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-use...@googlegroups.com.
>>>> To view this discussion on the web visit 
>>>> https://groups.google.com/d/msgid/jenkinsci-users/CANwMLksgv3L6S%2BGdZmXxq0fw8eOCJ_HW-3sbRqpDhnqsB6X71A%40mail.gmail.com
>>>>  
>>>> <https://groups.google.com/d/msgid/jenkinsci-users/CANwMLksgv3L6S%2BGdZmXxq0fw8eOCJ_HW-3sbRqpDhnqsB6X71A%40mail.gmail.com?utm_medium=email_source=footer>
>>>> .
>>>>
>>>

-- 
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/9bed72a1-5419-42fe-ae55-775f0793aa10n%40googlegroups.com.


Re: jenkins issue

2022-10-11 Thread Ivan Fernandez Calvo
The error is related to something your script is doing, it is not related 
to Jenkins at all. Try to review the code you are executing and figure out 
which line is and what is wrong. Googling the error seems related to 
configuring the git user and git email and the git authentication when you 
access GitHub using HTTPS URLs. It seems to be an error message from Ruby 
code. The solution seems to add the authentication to the URL or use an 
authentication store proper for your environment (I preferer to use gh see 
https://cli.github.com/manual/gh_auth_setup-git), but I am not sure depends 
on your script.

https://stackoverflow.com/questions/54454853/fatal-could-not-read-username-for-https-github-com-no-such-device-or-addr
https://stackoverflow.com/questions/69995273/access-organization-repo-on-github-using-personal-access-token-inside-bash-scrip
https://itecnote.com/tecnote/ruby-on-rails-fatal-could-not-read-username-for-https-github-com-no-such-device-or-address/
https://github.com/github/hub/issues/1644

El martes, 11 de octubre de 2022 a las 13:37:53 UTC+2, pooja...@gmail.com 
escribió:

> Hi mark and Mithun,
>
> am getting error in jenkins 
> [image: image.png]
>
> On Tue, Oct 11, 2022 at 9:59 AM pooja pooja  wrote:
>
>> this is my exact issue
>>
>> [image: image.png]
>>
>> On Mon, Oct 10, 2022 at 7:15 PM Mithun Raj  wrote:
>>
>>> 1. Update your OS,
>>>
>>> 2. Check if the Git credentials are injected correctly,
>>> If running from bastion host or jump box make sure your git hub or 
>>> enterprise hostnames and IP are updated (ask git admin) in the hosts file 
>>> under /etc/hosts
>>>
>>> 3. Update—env is the Git global env for git
>>> You can either set or unset those in your Linux machine it’s your Git ID 
>>> and pass which you can set as global access. not recommended if you have 
>>> set it under Jenkins credentials.
>>>
>>>
>>> On Mon, 10 Oct 2022 at 5:49 PM, pooja pooja  wrote:
>>>
 in jenkins am getting below error
 New release '22.04.1 LTS' available. Run 'do-release-upgrade' to 
 upgrade to it.
  fatal: could not read Username for 'https://github.com': No such 
 device or address
  Use --update-env to update environment variables

 -- 
 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-use...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-users/cec7b2ee-88ba-417d-be66-95d4954dbbfen%40googlegroups.com
  
 
 .

>>> -- 
>>> 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-use...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/CANwMLksgv3L6S%2BGdZmXxq0fw8eOCJ_HW-3sbRqpDhnqsB6X71A%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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/35f000ba-871c-4fb8-97b4-0df516b19028n%40googlegroups.com.


Re: Jenkins job error

2022-09-06 Thread Ivan Fernandez Calvo
Check all your plugins are loaded correctly, it looks like you have changes 
in the filesystem that were not applied, and when you restarted you applied 
those changes, I bet that one or more of your plugins are not loaded, you 
should have a big red number in the top-rigth corner of your Jenkins 
Controller UI.

El martes, 6 de septiembre de 2022 a las 14:59:39 UTC+2, Madhu Muchukota 
escribió:

> Hi Team, All of a sudden we are seeing below errors as soon as I run a job 
> in Jenkins.
>
> java.lang.NullPointerExceptionat 
> java.base/java.util.Objects.requireNonNull(Objects.java:221)at 
> jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:191)at 
> jenkins.scm.api.SCMFileSystem.of(SCMFileSystem.java:173)at 
> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:118)
>  
>at 
> org.jenkinsci.plugins.workflow.cps.CpsScmFlowDefinition.create(CpsScmFlowDefinition.java:70)
>  
>at 
> org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:310)   
>  at hudson.model.ResourceController.execute(ResourceController.java:99)   
>  at hudson.model.Executor.run(Executor.java:431) Finished: FAILURE
>
> Does anyone have any idea on this error?
>
> All we did is, just rebooted a VM over the weekend and from then it is not 
> working.
>
> Regards,
> Madhu M
>

-- 
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/5d260f62-6812-40b6-8923-4bf75abe4f15n%40googlegroups.com.


Re: Multiple Instances on one server with Java 11

2022-07-11 Thread Ivan Fernandez Calvo
If there are three different Apache Tomcat instances running three 
different services on Java 11, the only explanation to make one crash that 
comes to my mind is the resources of the machine, memory in particular.
The recommendation is to not use more than 75% of the memory of the host to 
the JVM, in your case you have 3 JVM running so each should not use more 
than 25% of the memory of the host, if you use more than that the JVM will 
fight for the host resources and one will lose crashing. Check the values 
on your `xms` and `xmx` Apache Tomcat parameters.

El lunes, 11 de julio de 2022 a las 16:40:08 UTC+2, slide escribió:

> Is there any crash log in either the apache or jenkins logs? I would look 
> for exception dumps in the logs, it might help narrow down where the issue 
> is occurring.
>
> On Mon, Jul 11, 2022 at 5:35 AM Matt Wilson  wrote:
>
>> For a few years I've been running multiple (independent) Jenkins 
>> instances on one server.  Each server runs under its own apache instance.
>> SiteA
>> SiteB
>> SiteC
>> This has worked perfectly fine for a few years with no problems.
>> Last week I upgraded all three servers to 2.346.1.  two of the three 
>> servers had been updated regularly so this wasn't a huge jump, that third 
>> server has a year and a bit behind so it was a bigger jump (siteB).
>> All three sites upgraded fine.  
>> All three sites got upgraded to Java 11.  That went fine.
>> All three sites run independently with no problems.
>> When I start all three sites, I have one site that crashes.  The crash 
>> seems to be triggered in particular when you access the management page on 
>> one particular server.
>> so like this
>> Site A is fine no matter what
>> Site B crashes when site C accesses its manage Jenkins page
>>
>> I've double checked my settings, I can't find any port conflicts or 
>> Jenkins home conflicts.
>> I've tried running all three sites on separate Java installs.  Still 
>> crashes
>> The only thing that seems to stop the crash so far is if I run site C 
>> back on Java 8.
>>
>> Any thoughts on what I could be missing here config wise?
>>
>> -- 
>> 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-use...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/de1049d2-cbe0-462e-9bce-1f9656ba6018n%40googlegroups.com
>>  
>> 
>> .
>>
>
>
> -- 
> Website: http://earl-of-code.com
>

-- 
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/aa0cf712-0388-486a-8542-77d8efd10998n%40googlegroups.com.


Re: Jenkins pod provisioning takes too long

2022-06-27 Thread Ivan Fernandez Calvo
Did you try to provision the same pod definition manually in the K8s 
cluster to check how much time takes k8s to create the pod? Which k8s 
provider do you use? I have a similar setup on GKE and it takes less than 
30 seconds to provision an agent the fisrt time, when the Docker image is 
in the k8s cluster it takes lesst than 20 seconds.

El lunes, 27 de junio de 2022 a las 10:54:20 UTC+2, mone...@gmail.com 
escribió:

> Hello everyone.
> At my company we have been using Jenkins for our CI infrastructure and 
> recently we decided to start using k8s in order to provisions agents there.
> So i have installed the kubernetes-plugin configured the access to our 
> autopilot k8s cluster and created a pipeline job that builds a maven based 
> project.
> I am pasting the pipeline script below:
>
> podTemplate(cloud: 'autopilot',
> yaml: '''
> apiVersion: v1
> kind: Pod
> metadata:
>   labels:
> type: maven
> spec:
>   volumes:
> - name: deps
>   persistentVolumeClaim:
> claimName: maven-repo
>   serviceAccount: jenkins-admin
>   containers:
>   - name: maven
> image: maven:3.8.1-jdk-8
> command:
> - sleep
> args:
> - 99d
> tty: true
> resources:
> limits:
>   cpu: 2000m
>   memory: 4096Mi
> requests:
>   cpu: 100m
>   memory: 512Mi
> volumeMounts:
> - name: deps
>   mountPath: /root/.m2/repository
> ''') {
> timestamps {
> node(POD_LABEL) {
>   stage('Build a Maven project') {
>   sh "env"
> checkout(scm: [$class: 'GitSCM',
> branches: [[name: "master"]],
> doGenerateSubmoduleConfigurations: false,
> extensions: [[$class: 'CleanBeforeCheckout']],
> submoduleCfg: [],
> userRemoteConfigs: [
> [credentialsId: 'git-checkout-cred', name: 'origin', 
> url: 'g...@github.com.git']]
> ]
> )
> container('maven') {
>   sh "ls -la"
>   sh "pwd"
>   sh(script: 'mvn clean package -DskipTests')
> }
>   }
> }
> }
> }
>
> Note the i have pre-created the maven-repo pvc before invoking the 
> pipeline.
> The pipeline runs fine, it downloads the dependencies and build the 
> project but the time it takes is high in proportion to the tasks it is 
> executing.
> For instance it the build itself takes a less than a minute (dependencies 
> are cached) but the provisioning of the pod takes almost 3 minutes.
>
> I am attaching some images that demonstrate the above statements
> I am also attaching a build log.
>
> What can i do in order to speedup the provisioning of the pods?
>
> PS Jenkins control plane is on a VM outside of K8s.
>

-- 
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/e6d6feeb-8cf0-4bfc-9739-f45612b45e50n%40googlegroups.com.


Re: Call parallel stages from a loaded file

2022-05-24 Thread Ivan Fernandez Calvo
We call parallel from a function, it should work, we have similar 
implementation in a step that allows you to pass arrays to parallel to 
build a matrix execution in parallel. The arrays can be static, loaded from 
files, or anything you can convert to an array

https://github.com/elastic/apm-pipeline-library/tree/main/vars#matrix
https://github.com/elastic/apm-pipeline-library/blob/main/vars/matrix.groovy
https://github.com/elastic/apm-pipeline-library/blob/main/vars/axis.groovy


El lunes, 23 de mayo de 2022 a las 22:27:07 UTC+2, chen...@gmail.com 
escribió:

> Hi all, 
>
> I have this piece of code
>
> def s
> def workspace
> pipeline {
>   agent { label 'build_1804' }
>
>   stages {
> stage('load functions') {
>   steps {
> script{
>   workspace = env.WORKSPACE
>   node('build_1804') {
> s = load "${workspace}/regress/Jenkins_extension.groovy"   
>   }
> }
>   }
> }
>
> stage('Build and Test 1') {
> steps{
>   script{
> s.buildandtest1(this)
>   }
> }
>  }
>   }
> }
>
> And other file with:
> def buildandtest1(Object s) {
>   parallel {
> echo "Building test"
> echo "Calling test script..."
> sh """
>   cd regress
>   echo \"./do_standalone_wo_resnet50_2_58.sh\"
> """
>   }
> }
>
> }
> }
>
> Dont put too much attention in {} or other syntax errors, i have modified 
> the code to do it more readable. 
>
> The main problem is that seems that jenkins is not able to start 
> "parallel" stages when it is called from a method. I am getting this error. 
>
> java.lang.IllegalArgumentException: Expected named arguments but got 
> org.jenkinsci.plugins.workflow.cps.CpsClosure2@6a6de064at 
> org.jenkinsci.plugins.workflow.cps.DSL.singleParam(DSL.java:718)at 
> org.jenkinsci.plugins.workflow.cps.DSL.parseArgs(DSL.java:706)at 
> org.jenkinsci.plugins.workflow.cps.DSL.parseArgs(DSL.java:640)at 
> org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:234)
>
>
> I have googled, but i dont find any solution or clue to fix it.
>
> What am i missing ?
>

-- 
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/0501f3ad-2a94-4ea3-96e7-be76fc6bee2an%40googlegroups.com.


Re: Kubernetes plugin for Jenkins after dockershim runtime is deprecated

2022-04-13 Thread Ivan Fernandez Calvo
Another solution that does not impact your pipelines, is to use a DinD 
container and export DOCKER_HOST in all the containers of the pod, this 
allows access to Docker to all containers using the docker CLI

pipeline {
  agent {
  kubernetes {
defaultContainer 'docker-cli'
yaml '''
  apiVersion: v1
  kind: Pod
  spec:
imagePullSecrets:
  - name: 'repo.example.com'
  - name: 'repo1.example.com'
containers:
  - name: dind
image: docker:20.10.12-dind
securityContext:
  privileged: true
env:
  - name: DOCKER_TLS_CERTDIR
value: ""
command:
  - dockerd
args:
  - -H tcp://localhost:2375
  --H unix:///var/run/docker.sock
ports:
  - containerPort: 2375
hostIP: 127.0.0.1
volumeMounts:
  - name: docker-cache
mountPath: /var/lib/docker
  - name: docker-cli
image: my-docker-cli-container:latest
command:
  - sleep
args:
  - infinity
env:
  - name: DOCKER_HOST
value: tcp://localhost:2375
volumes:
  - name: docker-cache
emptyDir: {}
'''
}
}


El miércoles, 13 de abril de 2022 a las 1:21:17 UTC+2, janmont...@gmail.com 
escribió:

> For builds that need docker, we have used docker:dind in the past. So we 
> have a maven build running in a maven container in a pod, and that build 
> uses dind to run testcontainers. 
>
> I wonder if something like that would work for your use case?
>
> Here’s more info on dind: 
>
> http://blog.teracy.com/2017/09/11/how-to-use-docker-in-docker-dind-and-docker-outside-of-docker-dood-for-local-ci-testing/
>
> On Wed, Sep 29, 2021 at 19:05 'Mario Rodriguez' via Jenkins Users <
> jenkins...@googlegroups.com> wrote:
>
>> Hello, Kubernetes project is planning to deprecate support for dockershim 
>> runtime is version 1.20 and fully drop it in version 1.24 as indicated 
>> here: https://kubernetes.io/blog/2020/12/02/dockershim-faq/
>>
>>  
>>
>> Reading about the impacts of dockershim removal here:  
>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/check-if-dockershim-deprecation-affects-you/
>>   and 
>> here 
>> https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrating-telemetry-and-security-agents/
>>  ,  any 
>> apps that depend on the docker daemon by exposing /var/run/docker.sock will 
>> be impacted.  We use the Kubernetes plugin for Jenkins 
>>  using this docker daemon 
>> exposure technique.
>>
>>
>> Assuming a transition from docker to containerd, any idea what changes 
>> will be needed by Kubernetes plugin users to continue working properly ?
>>
>>
>> thanks
>>
>> -- 
>>
> 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-use...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/3b883835-c0bd-49ac-9017-30163ad04a79n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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/0d79c6f8-a868-41d7-854f-0350edf67db8n%40googlegroups.com.


Re: How to create/update Jenkins job via REST API in Java?

2022-04-04 Thread Ivan Fernandez Calvo
if you want to manage your jobs using the API are some tools that make that 
work Jenkin Job Builder 
, also you can 
manage your Jobs and configuration using Jenkins configuration as Code 

 
and JobDSL plugin 

El lunes, 4 de abril de 2022 a las 11:13:34 UTC+2, jonbr...@gmail.com 
escribió:

> Hi everyone,
>
>  
>
> I’m trying to create/update a Jenkins job via the REST API. I can 
> successfully retrieve a crumb, so I know that my username/password 
> combination works.
>
> Whenever I try to POST a job, using a Basic Authentication with the 
> “username:password” base64 encoded, I get a 403.
>
> Whenever I try to POST a job, using a Basic Authentication with the 
> “username:apitoken” base64 encoded, I get a 500. The apitoken has been 
> handmade just for this test.
>
>  
>
> I have tried to use the example posted in Cloudbees Support (
> https://support.cloudbees.com/hc/en-us/articles/226835367-How-to-update-job-config-files-using-the-REST-API-and-Java-
> )
>
> The project source files are located here: 
> https://github.com/Topdanmark/jenkins-job-rest-api
>
>  
>
> The username, password, and server have been redacted for obvious reasons.
>
>  
>
> Any pointers are appreciated. A quick heads up. The project must be able 
> to run on Java8 on Windows, due to legacy requirements.
>
>
> Regards,
>
> Jon Brohauge
>

-- 
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/afe9afac-37ee-41dc-b854-11d3cc4e31f1n%40googlegroups.com.


Re: IOException: Cannot read more than 2Gib at a time

2022-04-01 Thread Ivan Fernandez Calvo
Is caused by a Pipeline step that runs some kind of script and generates 
more than 2GB of output? if so, maybe you should reduce the verbose of that 
script (whatever you are running) or generate a logs file and archive it, 
have a 2GB output in the Jenkins console does not have much sense, you will 
not work with that huge logs in the Jenkins UI and you are Killing the 
Jenkins instance requesting 2GB files.

El viernes, 1 de abril de 2022 a las 15:56:22 UTC+2, Yiannis K escribió:

> Hi Team,
>
> I am getting the following error message while running a job consistently 
> after 6-8 hours.
> BRs 
> John
>
> Machine : Linux 
> Jenkins Version : 2.222.3
>
> java.io.IOException: Cannot read more than 2Gib at a timeat 
> org.jenkinsci.plugins.workflow.log.FileLogStorage.stepLog(FileLogStorage.java:290)
>  
>at 
> org.jenkinsci.plugins.workflow.support.actions.LogStorageAction.getLogText(LogStorageAction.java:62)
>  
>at 
> org.jenkinsci.plugins.workflow.support.actions.LogStorageAction.writeLogTo(LogStorageAction.java:73)
>  
>at sun.reflect.GeneratedMethodAccessor3413.invoke(Unknown Source)at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
>  
>at java.lang.reflect.Method.invoke(Method.java:498)at 
> org.apache.commons.jexl.util.introspection.UberspectImpl$VelMethodImpl.invoke(UberspectImpl.java:258)
>  
>at org.apache.commons.jexl.parser.ASTMethod.execute(ASTMethod.java:104) 
>at 
> org.apache.commons.jexl.parser.ASTReference.execute(ASTReference.java:83)   
>  at org.apache.commons.jexl.parser.ASTReference.value(ASTReference.java:57) 
>at 
> org.apache.commons.jexl.parser.ASTReferenceExpression.value(ASTReferenceExpression.java:51)
>  
>at 
> org.apache.commons.jexl.ExpressionImpl.evaluate(ExpressionImpl.java:80)   
>  at 
> hudson.ExpressionFactory2$JexlExpression.evaluate(ExpressionFactory2.java:74) 
>at 
> org.apache.commons.jelly.parser.EscapingExpression.evaluate(EscapingExpression.java:24)
>  
>at 
> org.apache.commons.jelly.impl.ExpressionScript.run(ExpressionScript.java:66) 
>at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)   
>  at 
> org.apache.commons.jelly.tags.core.WhitespaceTag.doTag(WhitespaceTag.java:48) 
>at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)at 
> org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)at 
> org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
>  
>at org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)   
>  at 
> org.apache.commons.jelly.tags.core.OtherwiseTag.doTag(OtherwiseTag.java:41) 
>at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)at 
> org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)at 
> org.apache.commons.jelly.TagSupport.invokeBody(TagSupport.java:161)at 
> org.apache.commons.jelly.tags.core.ChooseTag.doTag(ChooseTag.java:38)at 
> org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)at 
> org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)at 
> org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99) 
>at 
> org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
>  
>at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)at 
> org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)at 
> org.apache.commons.jelly.tags.core.CoreTagLibrary$1.run(CoreTagLibrary.java:98)
>  
>at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)   
>  at 
> org.apache.commons.jelly.tags.core.CoreTagLibrary$2.run(CoreTagLibrary.java:105)
>  
>at 
> org.kohsuke.stapler.jelly.CallTagLibScript.run(CallTagLibScript.java:120)   
>  at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)   
>  at 
> org.kohsuke.stapler.jelly.CallTagLibScript$1.run(CallTagLibScript.java:99) 
>at 
> org.apache.commons.jelly.tags.define.InvokeBodyTag.doTag(InvokeBodyTag.java:91)
>  
>at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:269)at 
> org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)at 
> org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
>  
>at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)   
>  at 
> org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
>  
>at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)   
>  at 
> org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
>  
>at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)   
>  at 
> org.kohsuke.stapler.jelly.ReallyStaticTagLibrary$1.run(ReallyStaticTagLibrary.java:99)
>  
>at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:95)   
>  at 
> 

Re: Unable to Launch Node

2022-03-30 Thread Ivan Fernandez Calvo
I do not really have too much data to know what exactly is going on, which 
version of the SSH build Agents and the trilead-api plugins are you using? 
Are you using the latest versions? Do the issue happen only in that agent? 
Which SSH server do you use and what version? Do you have any kind of 
transfer limit on that agent? my theory is that the sftp read operation 
fail because something cut it.

El miércoles, 30 de marzo de 2022 a las 21:50:52 UTC+2, eric@gmail.com 
escribió:

> Just did it again on me.  Deleting the file again to fix it but would be 
> great if I could fix it.  Any advise?
>
> On Friday, March 18, 2022 at 11:17:56 AM UTC-6 kuisat...@gmail.com wrote:
>
>> The SSH Build Agents plugin make an sftp or scp (if one fail try the 
>> other) with the user configured in the Jenkins Agent to copy a file in the 
>> "Remote root directory" folder configured in the Agent config, nothing 
>> special, if the user configured in the Agent can make scp/sftp to copy a 
>> file in that folder it should not fail. 
>>
>> The point where the Agent fails to copy the file is interesting, it 
>> checks the value of the read bytes and fails if is <0 or >32768, I will 
>> bet the value is `-1` and it is related to read the remoting.jar from the 
>> Agent to check the md5, for some reason is returning an EOF
>>
>>
>> https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/SFTPv3Client.java#L1231
>>
>> https://github.com/jenkinsci/ssh-slaves-plugin/blob/main/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java#L706
>> El viernes, 18 de marzo de 2022 a las 16:10:56 UTC+1, eric@gmail.com 
>> escribió:
>>
>>> Hmmm, I deleted the remoting.jar file and was able to restart Jenkins 
>>> and the node came up.  Wonder if this is going to happen every we patch and 
>>> boot this machine?
>>>
>>> On Friday, March 18, 2022 at 8:43:55 AM UTC-6 eric@gmail.com wrote:
>>>
 Hi!  I have a node that is unable to launch.  On the log it shows:

 [03/18/22 09:39:01] [SSH] Copying latest remoting.jar... 
 java.io.IOException: Could not copy remoting.jar into 
 '/home/myuser/checkout' on agent at 
 hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:715) at 
 hudson.plugins.sshslaves.SSHLauncher.access$300(SSHLauncher.java:112) at 
 hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:455) at 
 hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:422) at 
 java.util.concurrent.FutureTask.run(FutureTask.java:266) at 
 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
  
 at 
 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
  
 at java.lang.Thread.run(Thread.java:750) Caused by: 
 java.lang.IllegalArgumentException: invalid len argument at 
 com.trilead.ssh2.SFTPv3Client.read(SFTPv3Client.java:1232) at 
 com.trilead.ssh2.jenkins.SFTPClient$SFTPInputStream.read(SFTPClient.java:172)
  
 at 
 com.google.common.io.ByteStreams.toByteArrayInternal(ByteStreams.java:184) 
 at com.google.common.io.ByteStreams.toByteArray(ByteStreams.java:224) at 
 hudson.plugins.sshslaves.SSHLauncher.readInputStreamIntoByteArrayAndClose(SSHLauncher.java:773)
  
 at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:684) 
 ... 7 more

 I've set my perms on the checkout dir to 777, so it's not that it 
 doesn't have permission to write over the current remoting.jar that lives 
 there. Anyone have any clues or further trouble shooting advise? 
 Running Jenkins 2.232.1 on RHEL 7.9.

 Thanks - Eric 

>>>

-- 
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/9a5d39af-9f6d-4881-a0de-7d00c0dfff64n%40googlegroups.com.


Re: Unable to Launch Node

2022-03-18 Thread Ivan Fernandez Calvo
The SSH Build Agents plugin make an sftp or scp (if one fail try the other) 
with the user configured in the Jenkins Agent to copy a file in the "Remote 
root directory" folder configured in the Agent config, nothing special, if 
the user configured in the Agent can make scp/sftp to copy a file in that 
folder it should not fail. 

The point where the Agent fails to copy the file is interesting, it checks 
the value of the read bytes and fails if is <0 or >32768, I will bet the 
value is `-1` and it is related to read the remoting.jar from the Agent to 
check the md5, for some reason is returning an EOF

https://github.com/jenkinsci/trilead-ssh2/blob/master/src/com/trilead/ssh2/SFTPv3Client.java#L1231
https://github.com/jenkinsci/ssh-slaves-plugin/blob/main/src/main/java/hudson/plugins/sshslaves/SSHLauncher.java#L706
El viernes, 18 de marzo de 2022 a las 16:10:56 UTC+1, eric@gmail.com 
escribió:

> Hmmm, I deleted the remoting.jar file and was able to restart Jenkins and 
> the node came up.  Wonder if this is going to happen every we patch and 
> boot this machine?
>
> On Friday, March 18, 2022 at 8:43:55 AM UTC-6 eric@gmail.com wrote:
>
>> Hi!  I have a node that is unable to launch.  On the log it shows:
>>
>> [03/18/22 09:39:01] [SSH] Copying latest remoting.jar... 
>> java.io.IOException: Could not copy remoting.jar into 
>> '/home/myuser/checkout' on agent at 
>> hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:715) at 
>> hudson.plugins.sshslaves.SSHLauncher.access$300(SSHLauncher.java:112) at 
>> hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:455) at 
>> hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:422) at 
>> java.util.concurrent.FutureTask.run(FutureTask.java:266) at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>>  
>> at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>>  
>> at java.lang.Thread.run(Thread.java:750) Caused by: 
>> java.lang.IllegalArgumentException: invalid len argument at 
>> com.trilead.ssh2.SFTPv3Client.read(SFTPv3Client.java:1232) at 
>> com.trilead.ssh2.jenkins.SFTPClient$SFTPInputStream.read(SFTPClient.java:172)
>>  
>> at 
>> com.google.common.io.ByteStreams.toByteArrayInternal(ByteStreams.java:184) 
>> at com.google.common.io.ByteStreams.toByteArray(ByteStreams.java:224) at 
>> hudson.plugins.sshslaves.SSHLauncher.readInputStreamIntoByteArrayAndClose(SSHLauncher.java:773)
>>  
>> at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:684) 
>> ... 7 more
>>
>> I've set my perms on the checkout dir to 777, so it's not that it doesn't 
>> have permission to write over the current remoting.jar that lives there. 
>> Anyone have any clues or further trouble shooting advise? 
>> Running Jenkins 2.232.1 on RHEL 7.9.
>>
>> Thanks - Eric 
>>
>

-- 
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/e6dcc877-6b1d-405b-a1c5-b0baefa75a95n%40googlegroups.com.


Re: Trigger jenkins job for all actions of pull request in github.

2022-02-14 Thread Ivan Fernandez Calvo
Hi,

We use the Generic Webhook trigger plugin 
 to trigger jobs on 
any kind of event from GitHub, it allows you to convert the payload of the 
message in variables and implements ways to filter the payload. We use to 
implement only one or two events per pipeline because the configuration 
tent to increase complexity with each new event to catch and filter, so we 
have a job to catch and filter the event and this one trigger the real job, 
in that way we can capture several events to trigger the same job and both 
part the event catcher and the pipeline are as simpers as posible. 

El lunes, 14 de febrero de 2022 a las 13:29:56 UTC+1, adharsh...@gmail.com 
escribió:

> Thanks for the reply, is this plugin triggers the job when reviewers added 
> in pull request in github.
>
> On Mon, 14 Feb 2022, 5:00 pm Baptiste Mathus,  wrote:
>
>> Hi,
>>
>> You want to use the GitHub branch source plugin. 
>>
>> I don't think anyone should really use the "GitHub pull request builder 
>> plugin" anymore nowadays in 2022.
>>
>> Cheers
>>
>> Le lun. 14 févr. 2022 à 10:52, Adharsha sri  a 
>> écrit :
>>
>>> Hi Team,
>>>
>>> I am trying to trigger the jenkins job which will send slack 
>>> notification to developers when there is a pull request in github.
>>>
>>> I am using github pull request builder plugin in jenkins to achieve this 
>>> and created a webhook in github and selected pull requests(pull request 
>>> opened, closed, reopened, edited, assigned,review requested,  review 
>>> request removed, labeled, unlabeled, synchronized, ready fir review, 
>>> convertted to draft, locked or unlocked) in events.
>>>
>>> I am able to trigger the jenkins job for only pullrequest open and 
>>> reopened actions but not for remaining actions.
>>>
>>> And also tried with poll scm, github hook trigger for gitscm polling and 
>>> generic webhook trigger but not succeeded in achieving this.
>>>
>>> Can anyone please help with this?
>>>
>>> Thanks,
>>> Adharsha.
>>>
>>> -- 
>>> 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-use...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/CAJWGB6p6teEKQrm0SERJwMK1QZESjuvPNHGhtpN8rKCew%3DSvgA%40mail.gmail.com
>>>  
>>> 
>>> .
>>>
>> -- 
>> 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-use...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/CANWgJS7eqzOJDvXNxwBRGZcseUf%3D%2Bqp5GFY6gH%2BS4e8aCf0A1A%40mail.gmail.com
>>  
>> 
>> .
>>
>

-- 
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/c7b7c6a4-6be0-4207-9534-4b856fed5577n%40googlegroups.com.


Re: nested each

2022-02-05 Thread Ivan Fernandez Calvo
a return in a each is like a break in a loop exit from the current context 
with a return value but only one each context, you have two each context 
levels. 

El sábado, 5 de febrero de 2022 a las 18:33:24 UTC+1, Martin Schmude 
escribió:

> In the past I ran into issues with pipeline scripts that did not behave as 
> expected due to CPS transformation.
> See https://www.jenkins.io/doc/book/pipeline/cps-method-mismatches/
>
> https://www.jenkins.io/doc/book/pipeline/pipeline-best-practices/#using-noncps
> Try to annotate interesting_commit_check() with @NonCPS.
>
> jeremy@dzsi.com schrieb am Freitag, 4. Februar 2022 um 21:18:46 UTC+1:
>
>> what's wrong with this code? The output from it was 
>>
>> [Pipeline] echo 
>> [modules/core/rwvx,
>>  modules/automation/core, modules/tools/scripts, modules/toolchain, 
>> modules/tools/CI, modules/core/util, modules/im/platform][Pipeline] echo 
>> (modules/core/rwvx|modules/automation/core|modules/tools/scripts|modules/toolchain|modules/tools/CI|modules/core/util|modules/im/platform).*[Pipeline]
>>  echo 
>> file:
>>  "modules/im/platform"[Pipeline] echo 
>> interesting
>>  submodule change: modules/im/platform[Pipeline] echo 
>> no
>>  interesting commits found.
>>
>>
>> which implies that the "return true" was ignored 
>>
>>
>>
>> def interesting_commit_check(topmodule) { 
>> // returns true if any interesting commits are found
>> modules=get_dependency_list(topmodule)
>> modules_re = "(" + modules.join('|') + ").*"
>> println("${modules_re}")
>> currentBuild.changeSets.each {
>> it.items.each {
>> it.affectedFiles.each {
>> pth = it.getPath()
>> println("file: \"${pth}\"")
>> if (it.getPath().matches('^modules.*')) {
>> // in a submodule ... is it an important one?
>> if (pth.matches(modules_re)) {
>> print("interesting submodule change: ${pth}")
>> return true
>> } else {
>> print("ignoring submodule change in ${pth}") 
>> 
>>  
>> }
>> } else {
>> if ( pth == "RELEASE" ) {
>> println("ignoring release change")
>> } else {
>> print("ignoring supermod change: ${pth}")
>> }
>> }
>> }
>> }
>> }
>> print("no interesting commits found.")
>> return false
>> }
>>
>> *Jeremy Mordkoff*
>> Director, Engineering Services
>> 
>>
>> *Headquarters: 5700 Tennyson Parkway, Plano, Texas, USA *
>> *Mobile*: +1 978.257.2183 <(978)%20257-2183>
>> *Email: *jeremy@dzsi.com
>>
>> 
>>
>>  
>>  
>> 
>>
>>
>> *Disclaimer*
>>
>> The information contained in this communication from the sender is 
>> confidential. It is intended solely for use by the recipient and others 
>> authorized to receive it. If you are not the recipient, you are hereby 
>> notified that any disclosure, copying, distribution or taking action in 
>> relation of the contents of this information is strictly prohibited and may 
>> be unlawful.
>>
>>

-- 
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/032587b3-daf2-4e56-9ea8-be2835d63375n%40googlegroups.com.


Re: Endless redirects

2022-01-28 Thread Ivan Fernandez Calvo
It looks like a reverse proxy wrong redirection rules to me (I hit it in 
the past), you can check with `curl` the redirections and who make them, 
something like

curl -Lv -u user:${PASSWORD} ${JENKINS_URL}/iconSize?16x16

El jueves, 27 de enero de 2022 a las 16:17:49 UTC+1, Stefan Möbius escribió:

> Hi,
>
> One of our Jenkins deployments recently started acting up. When you
> access it, you get prompted for your credentials (no surprise there), it
> apparently accepts them, but then fails to load any further page.
> Looking at a network trace shows, that requests to /iconSize?16x16 and
> /j_spring_security_check are answered with a redirect to /
>
> Anybody able to suggest what’s wrong?
>
> Yes, I am aware of the various questions to similar issues, but I’m not
> using OpenID, nor a proxy.
>
> Jenkins security is configured to Active Directory, which appears to
> work. The setting “Require TLS” doesn’t make a difference.
>
> This is Jenkins 2.319.2. All installed plugins are up-to-date.
>
> I’ve tried to play around with extended logging, but since I don’t know
> what I’m looking for, I’ve had little luck.
>
> What could I look for?
>
> Regards,
> Stefan
>

-- 
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/a70ee3ec-01bf-4b2c-94f0-9d8c36614277n%40googlegroups.com.


Re: java.io.IOException: Could not copy remoting.jar into ‘/export/build’ on agent

2021-12-23 Thread Ivan Fernandez Calvo
you set the workspace of the agent to  '/export/build' the user you use to 
connect to the Agent must have write permissions on that folder
El jueves, 23 de diciembre de 2021 a las 16:56:04 UTC+1, 
jeremy@dzsi.com escribió:

> what are the perms on /export/build and /export/build/remoting.jar? One of 
> them is not writable by user jenkins 
>
>
> On Thursday, December 23, 2021 at 3:28:15 AM UTC-5 Harri wrote:
>
>> Hi folks,
>>
>> using Jenkins 2.326 (the Debian package) the agent cannot be redeployed. 
>> It
>> fails with
>>
>> [12/13/21 17:53:49] [SSH] Checking java version of 
>> /usr/lib/jvm/java-openjdk/bin/java
>> [12/13/21 17:53:49] [SSH] /usr/lib/jvm/java-openjdk/bin/java -version 
>> returned 1.8.0_302.
>> [12/13/21 17:53:49] [SSH] Starting sftp client.
>> [12/13/21 17:53:49] [SSH] Copying latest remoting.jar...
>> java.io.IOException: Could not copy remoting.jar into '/export/build' on 
>> agent
>> at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:739)
>> at hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:112)
>> at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:457)
>> at hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:422)
>> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>> at 
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>> at 
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>> at java.lang.Thread.run(Thread.java:748)
>> Caused by: java.lang.IllegalArgumentException: invalid len argument
>> at com.trilead.ssh2.SFTPv3Client.read(SFTPv3Client.java:1232)
>> at 
>> com.trilead.ssh2.jenkins.SFTPClient$SFTPInputStream.read(SFTPClient.java:172)
>> at 
>> com.google.common.io.ByteStreams.toByteArrayInternal(ByteStreams.java:184)
>> at com.google.common.io.ByteStreams.toByteArray(ByteStreams.java:224)
>> at 
>> hudson.plugins.sshslaves.SSHLauncher.readInputStreamIntoByteArrayAndClose(SSHLauncher.java:797)
>> at hudson.plugins.sshslaves.SSHLauncher.copyAgentJar(SSHLauncher.java:708)
>> ... 7 more
>> [12/13/21 17:53:49] Launch failed - cleaning up connection
>> [12/13/21 17:53:49] [SSH] Connection closed.
>>
>> If I remove the remoting.jar manually on the node it works for a short 
>> time,
>> but then the error comes back. Java on the node is openjdk 8u302 (CentOS) 
>> or
>> AdoptOpenJDK 8u292 (Debian).
>>
>> Seems to be related to JENKINS-67258 (currently unassigned).
>>
>> Every helpful comment is highly appreciated.
>>
>>
>> Regards
>> Harri
>>
>

-- 
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/4f55f035-ff36-422d-8d14-e7c76d807729n%40googlegroups.com.


Re: ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.

2021-12-23 Thread Ivan Fernandez Calvo
if it is a relatively new repository on GitHub the default branch is ‘main’ 
not ‘master’ so you have to check you are passing that branch in the SCM 
configuration

El miércoles, 22 de diciembre de 2021 a las 23:04:38 UTC+1, Melo Vi 
escribió:

> Have you verified that the commit hash you are trying to build exists in 
> your git repository?
>
> On Thursday, December 23, 2021 at 1:04:00 AM UTC+13 shivp...@gmail.com 
> wrote:
>
>> Started by user admin [Pipeline] Start of Pipeline [Pipeline] node 
>> Running on Jenkins in 
>> C:\ProgramData\Jenkins\.jenkins\workspace\terraformCICD [Pipeline] { 
>> [Pipeline] stage [Pipeline] { (fetch_latest_code) [Pipeline] git Selected 
>> Git installation does not exist. Using Default The recommended git tool is: 
>> NONE using credential e7d2502e-6621-49c6-a934-813269c16141 > C:\Program 
>> Files\Git\bin\git.exe rev-parse --resolve-git-dir 
>> C:\ProgramData\Jenkins\.jenkins\workspace\terraformCICD\.git # timeout=10 
>> Fetching changes from the remote Git repository > C:\Program 
>> Files\Git\bin\git.exe config remote.origin.url 
>> https://github.com//test # timeout=10 Fetching upstream changes from 
>> https://github.com/*/test > C:\Program Files\Git\bin\git.exe 
>> --version # timeout=10 > git --version # 'git version 2.21.0.windows.1' 
>> using GIT_ASKPASS to set credentials > C:\Program Files\Git\bin\git.exe 
>> fetch --tags --force --progress -- https://github.com//test 
>> +refs/heads/*:refs/remotes/origin/* # timeout=10 > C:\Program 
>> Files\Git\bin\git.exe rev-parse "refs/remotes/origin/master^{commit}" # 
>> timeout=10 > C:\Program Files\Git\bin\git.exe rev-parse 
>> "origin/master^{commit}" # timeout=10 [Pipeline] } [Pipeline] // stage 
>> [Pipeline] stage [Pipeline] { (TF Init) Stage "TF Init" skipped 
>> due to earlier failure(s) [Pipeline] } [Pipeline] // stage [Pipeline] stage 
>> [Pipeline] { (Approval) Stage "Approval" skipped due to earlier failure(s) 
>> [Pipeline] } [Pipeline] // stage [Pipeline] stage [Pipeline] { (TF Apply) 
>> Stage "TF Apply" skipped due to earlier failure(s) [Pipeline] } [Pipeline] 
>> // stage [Pipeline] } [Pipeline] // node [Pipeline] End of Pipeline ERROR: 
>> Couldn't find any revision to build. Verify the repository and branch 
>> configuration for this job. Finished: FAILURE
>>
>

-- 
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/e59c9708-aa0b-4df3-b90e-e7d79d2184acn%40googlegroups.com.


Re: Generic webhook trigger is not working. Please help

2021-12-06 Thread Ivan Fernandez Calvo
IIRC if you pass a regexp in the variable declaration those values will be 
removed, so you have to remove this line

https://github.com/tomasbjerre/bitbucket-server-jenkins-release-tags/blob/master/Jenkinsfile#L9


El lunes, 6 de diciembre de 2021 a las 11:24:11 UTC+1, manishs...@gmail.com 
escribió:

> I am trying to trigger a job when a new tag is push from the Bitbucket 
> repo. . The webhook from the Bitbucket side seems to be working fine, but 
> the job is not triggered. I know this because the HTTP status is 200.
>
> This is the result when i try to ping the webhook url
>
> body : 
> {"jobs":{"test":{"regexpFilterExpression":"^refs/tags/.*","triggered":false,"resolvedVariables":{"clone_url":"","commit":"","committer_email":"","committer_name":"","project_key":"MYP","ref":"","repo_slug":"","tag":""},"regexpFilterText":"","id":0,"url":""}},"message":"Triggered
>  
> jobs."}
>
>
> Pipeline Script
>
>
> https://github.com/tomasbjerre/bitbucket-server-jenkins-release-tags/blob/master/Jenkinsfile
>

-- 
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/54ce3f58-4e60-44a1-bb03-9cb00bab9d77n%40googlegroups.com.


Re: Unable to Run jenkins job on zos slave

2021-11-01 Thread Ivan Fernandez Calvo
This is an Error of zOS I dunno which file is trying to open, I doubt that 
you can even run the script in an SSH session with something like this

Try the following in a machine with access by SSH to the zOS Agent, 
create a hello.sh file locally with the script

pwd
echo foo
date

Execute an ssh command like this (you have to change the access method, 
user, and host)

ssh AGENT_USER@LINUX_IP 'sh -s' < hello.sh

ssh AGENT_USER@LINUX_IP 'bash -s' < hello.sh

I am not wrong you will see the same error 

this is a similar issue I have found in a IBM 
forum https://ibmmainframes.com/about67532.html
El lunes, 1 de noviembre de 2021 a las 5:57:33 UTC+1, adharsh...@gmail.com 
escribió:

> Yes, please find the below output.
>
> FSUM7343 cannot open □?EC□?¤IA for output : no such file or directory.
>
> On Fri, 29 Oct 2021, 1:00 pm kuisathaverat,  wrote:
>
>> Did you test other commands in the Freestyle job? try this
>>
>> #!/bin/bash
>> pwd
>> echo foo
>> date
>>
>>
>>
>> El vie, 29 oct 2021 a las 7:21, Adharsha sri () 
>> escribió:
>>
>>> Hi,
>>>
>>> In /etc/profile added the below bash environment variables
>>> export _CEE_RUNOPTS=“FILETAG(AUTOCVT,AUTOTAG) POSIX(ON)”
>>> export _BPXK_AUTOCVT=ON
>>> export _TAG_REDIR_ERR=txt
>>> export _TAG_REDIR_IN=txt
>>> export _TAG_REDIR_OUT=txt
>>>
>>>
>>> And then able to run the below pipeline job 
>>>
>>> node('hostname')
>>> {
>>> stage('test')
>>> {
>>> sh "pwd"
>>> sh " hostname"
>>> sh "date"
>>> }}
>>>
>>> But when running the below freestyle job , gettingerror
>>>
>>> Execute shell:
>>> date
>>>
>>> Error:
>>>
>>> +□?A/EA
>>> /tmp/jenkjns123456789.sh 1: FSUM7351 not found 
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> On Thu, 28 Oct 2021, 9:51 pm Ivan Fernandez Calvo,  
>>> wrote:
>>>
>>>> should not, the FreeStyle "Execute shell" step and the Pipeline sh step 
>>>> work more or less in the same way, I never see a fail one when the other 
>>>> works. In any case, it is difficult to help you if you do not provide more 
>>>> info about what you did, what does not work exactly, Why does not work, 
>>>> what error you see in the Jenkins logs (if any), what error you see in the 
>>>> build logs(if any), What did you change in the Agents, and so on. 
>>>>
>>>> El jueves, 28 de octubre de 2021 a las 13:38:06 UTC+2, 
>>>> adharsh...@gmail.com escribió:
>>>>
>>>>> Now I am able run shell commands using pipeline job but unable to run 
>>>>> using freestyle job. Will there be any difference 
>>>>>
>>>>> On Wed, 27 Oct 2021, 10:10 pm Adharsha sri,  
>>>>> wrote:
>>>>>
>>>>>> Thank you , will check on that part.
>>>>>>
>>>>>> On Wed, 27 Oct 2021, 6:45 pm Ivan Fernandez Calvo, <
>>>>>> kuisat...@gmail.com> wrote:
>>>>>>
>>>>>>> the echo step is pure Groovy, however, the sh step uses bash, so 
>>>>>>> probably you do not have bash in the PATH of that user, check that bash 
>>>>>>> is 
>>>>>>> installed and that user can use it.
>>>>>>>
>>>>>>> El miércoles, 27 de octubre de 2021 a las 15:01:08 UTC+2, 
>>>>>>> adharsh...@gmail.com escribió:
>>>>>>>
>>>>>>>> Able to run the echo commands but not able to run the shell commands
>>>>>>>>
>>>>>>>> On Wed, 27 Oct 2021, 4:12 pm Adharsha sri,  
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Can anyone help on this error
>>>>>>>>>
>>>>>>>>> On Wed, 27 Oct 2021, 2:38 pm Adharsha sri,  
>>>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>>> Thanks for the sample pipeline but getting error like " process 
>>>>>>>>>> apparently  never started in path
>>>>>>>>>> ( running jenkins temporarily  with 
>>>>>>>>>> -Dorg.jenkinsci.plugins.durabletask.BourneshellScript.LAUNCH_DIAGNOSTICS=true
>>>>>>>>>>  
>>>>>>>&g

Re: thread safety of scripted pipeline parallel and usage of nested parallel

2021-10-31 Thread Ivan Fernandez Calvo
The following example should work (I did not test it), I my case I have 
used maps like the “result” variable, that it is a simple map not 
synchronized and stores data from all task but it is not read from the 
different tasks. The other two cases “data” and “mapSync” uses concurrent 
classes, they are thread safe and synchronized so you can share data across 
tasks, I dunno is they are in the allow list for pipeline, if not you have 
to approve it use in pipelines in the Jenkins config. Finally, the last 
part of the pipeline uses nested parallel task, from my experience is not a 
good idea, the parallel explosion of task is a little incontrolable and 
there are other solution like launch a job from those task and inside that 
job launch parallel task, in this way you only have 1 parallel level that 
is easy to control and understand when something goes wrong.

import groovy.transform.Field
import java.util.concurrent.atomic.AtomicInteger
import java.util.concurrent.ConcurrentHashMap

@Field def results = [:]
@Field AtomicInteger data = new AtomicInteger()
@Filed ConcurrentHashMap mapSync = new ConcurrentHashMap()

pipeline{
agent any
stages
{
stage(‘Parallel BuiLd’) {
steps {
script {
def i = 0
def builds = [:]
mapSync[“odd”] = 0
mapSync[“even”] = 0
stash name: ‘src’, include: ‘src/**’
//generate 1000 parallel block
for (i = 0; i<1000; i++) {
// make the Map of Closure
builds[“$i”] = {
results[“$i”] = 1
data++
if(i%2==0){
  mapSync[“odd”] = mapSync[“odd”]++ 
} else {
  mapSync[“even”] = mapSync[“even”]++ 
}
}
}
parallel builds
println results.toString()
println data
println mapSync
}
}
}
}
}
El sábado, 30 de octubre de 2021 a las 18:44:57 UTC+2, abstrakta escribió:

> Thanks for your reply.
> So parallel directive is like spawning some Java threads?Do you have any 
> pipeline code can demo this thread safety issue and how to fix it 
> using Java types that are thread safe ?
> I guess that some directive "stash unstash archive" should be thread 
> safety internally.Because I find some articles use parallel unstash in 
> different slave node without thread protection.Is my guess correct?I can't 
> find any other articles that discuss this parallel thread safety issue.
> ---Original---
> *From:* "Ivan Fernandez Calvo"
> *Date:* Sun, Oct 31, 2021 00:03 AM
> *To:* "Jenkins Users";
> *Subject:* Re: thread safety of scripted pipeline parallel and usage of 
> nested parallel
>
> No, if you plan to use shared variables across parallel steps you should 
> use Java types that are thread safe, if not you will have random/weird 
> results. I have several pipelines that uses a map to store results in 
> parallel steps 
>
> El sábado, 30 de octubre de 2021 a las 14:18:29 UTC+2, abstrakta escribió:
>
>> Hi, Jenkins friends.I wish that I'm in the right place that post these 
>> Jenkins usage question.
>>
>> I find that the Scriped Pipeline parallel works like threads.Unlike the 
>> Declarative Pipeline parallel,the Scriped Pipeline parallel just use one 
>> executor.Closure in parallel parameters works like a thread.
>> My question is:
>>
>> 1.Does Jenkins garantee the data thread safety of parallel closure 
>> internally?
>>
>> 2.Does I need to care about the thread safety of the commands that 
>> executes in scriped parallel closure?
>>
>> 3.Is there any limit of usage in the commands that executes in 
>> parallel?Can I use nested scripted parallel? Why the documentation of 
>> Declarative Pipeline parallel in Pipeline Syntax reference says that "Note 
>> that a stage must have one and only one of steps, stages, parallel, or 
>> matrix. It is not possible to nest a parallel or matrix block within a 
>> stage directive if that stage directive is nested within a parallel or 
>> matrix block itself."
>>
>> I test some nested Pipeline code that might cause thread race condition 
>> many times.Jekins always give the right answer that shared data is modified 
>> correctly.Is this thread safety garanteed in the design of Jenkins parallel 
>> directive?
>>
>> Pipeline code like this:
>>
>> pipeline{
>> agent any
>> stages
>>

Re: thread safety of scripted pipeline parallel and usage of nested parallel

2021-10-30 Thread Ivan Fernandez Calvo
No, if you plan to use shared variables across parallel steps you should 
use Java types that are thread safe, if not you will have random/weird 
results. I have several pipelines that uses a map to store results in 
parallel steps 

El sábado, 30 de octubre de 2021 a las 14:18:29 UTC+2, abstrakta escribió:

> Hi, Jenkins friends.I wish that I'm in the right place that post these 
> Jenkins usage question.
>
> I find that the Scriped Pipeline parallel works like threads.Unlike the 
> Declarative Pipeline parallel,the Scriped Pipeline parallel just use one 
> executor.Closure in parallel parameters works like a thread.
> My question is:
>
> 1.Does Jenkins garantee the data thread safety of parallel closure 
> internally?
>
> 2.Does I need to care about the thread safety of the commands that 
> executes in scriped parallel closure?
>
> 3.Is there any limit of usage in the commands that executes in 
> parallel?Can I use nested scripted parallel? Why the documentation of 
> Declarative Pipeline parallel in Pipeline Syntax reference says that "Note 
> that a stage must have one and only one of steps, stages, parallel, or 
> matrix. It is not possible to nest a parallel or matrix block within a 
> stage directive if that stage directive is nested within a parallel or 
> matrix block itself."
>
> I test some nested Pipeline code that might cause thread race condition 
> many times.Jekins always give the right answer that shared data is modified 
> correctly.Is this thread safety garanteed in the design of Jenkins parallel 
> directive?
>
> Pipeline code like this:
>
> pipeline{
> agent any
> stages
> {
> stage('Parallel BuiLd') {
> steps {
> script {
> def i = 0
> def data = 0
> def builds = [:]
> stash name: 'src', include: 'src/**'
> //generate 1000 parallel block
> for (i = 0; i<1000; i++) {
> // make the Map of Closure
> builds["$i"] = {
> //modify shared data, need thread mutex lock?
> data++
> //unstash or other command, need thread mutex 
> lock?
> unstah name: 'src'
> def tests = [:]
> // ... generate tests Map
> // Can I use nested parallel?
> parallel tests
> }
> }
> parallel builds
> println data //It does always print 1000
> }
> }
> }
> }
> }
>
> The variable data is always modified to 1000. So Jenkins garantee the 
> thread safety of parallel?
>

-- 
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/0712b8c5-42dc-439f-a017-2a5ca45ad1e9n%40googlegroups.com.


Re: Unable to Run jenkins job on zos slave

2021-10-28 Thread Ivan Fernandez Calvo
should not, the FreeStyle "Execute shell" step and the Pipeline sh step 
work more or less in the same way, I never see a fail one when the other 
works. In any case, it is difficult to help you if you do not provide more 
info about what you did, what does not work exactly, Why does not work, 
what error you see in the Jenkins logs (if any), what error you see in the 
build logs(if any), What did you change in the Agents, and so on. 

El jueves, 28 de octubre de 2021 a las 13:38:06 UTC+2, adharsh...@gmail.com 
escribió:

> Now I am able run shell commands using pipeline job but unable to run 
> using freestyle job. Will there be any difference 
>
> On Wed, 27 Oct 2021, 10:10 pm Adharsha sri,  wrote:
>
>> Thank you , will check on that part.
>>
>> On Wed, 27 Oct 2021, 6:45 pm Ivan Fernandez Calvo,  
>> wrote:
>>
>>> the echo step is pure Groovy, however, the sh step uses bash, so 
>>> probably you do not have bash in the PATH of that user, check that bash is 
>>> installed and that user can use it.
>>>
>>> El miércoles, 27 de octubre de 2021 a las 15:01:08 UTC+2, 
>>> adharsh...@gmail.com escribió:
>>>
>>>> Able to run the echo commands but not able to run the shell commands
>>>>
>>>> On Wed, 27 Oct 2021, 4:12 pm Adharsha sri,  
>>>> wrote:
>>>>
>>>>> Can anyone help on this error
>>>>>
>>>>> On Wed, 27 Oct 2021, 2:38 pm Adharsha sri,  
>>>>> wrote:
>>>>>
>>>>>> Thanks for the sample pipeline but getting error like " process 
>>>>>> apparently  never started in path
>>>>>> ( running jenkins temporarily  with 
>>>>>> -Dorg.jenkinsci.plugins.durabletask.BourneshellScript.LAUNCH_DIAGNOSTICS=true
>>>>>>  
>>>>>> might make the problem clearer).
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> On Wed, 27 Oct 2021, 1:18 pm Ivan Fernandez Calvo, <
>>>>>> kuisat...@gmail.com> wrote:
>>>>>>
>>>>>>> This is a pretty simple pipeline to expose your environment settings
>>>>>>>
>>>>>>> pipeline {
>>>>>>> agent { label 'YOUR_AGENT_LABELS' }
>>>>>>> stages {
>>>>>>> stage('test') {
>>>>>>> steps {
>>>>>>>   sh 'export'
>>>>>>>   sh 'set'
>>>>>>> }
>>>>>>> }
>>>>>>> }
>>>>>>> }
>>>>>>>
>>>>>>> El miércoles, 27 de octubre de 2021 a las 9:13:59 UTC+2, 
>>>>>>> adharsh...@gmail.com escribió:
>>>>>>>
>>>>>>>> The Configuration  from agent is fine right, but it will be useful 
>>>>>>>> only when we run the jave script. So for shell commands we need to 
>>>>>>>> check 
>>>>>>>> .bashrc file in the agent server. Can you please provide the 
>>>>>>>> screenshot of 
>>>>>>>> the .bashrc file and please provide the script  you are using and 
>>>>>>>> examples 
>>>>>>>> of export and set. This will be very helpful for us.
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>> On Wed, 27 Oct 2021, 8:04 am Adharsha sri,  
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Can you please provide an example.
>>>>>>>>>
>>>>>>>>> On Tue, 26 Oct 2021, 11:52 pm Ivan Fernandez Calvo, <
>>>>>>>>> kuisat...@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> This is the output you see in the browser, isn't it? Did you try 
>>>>>>>>>> to download the "view as plain text" button output in a file and 
>>>>>>>>>> with an 
>>>>>>>>>> editor trying to find the correct encoding? the encoding you set in 
>>>>>>>>>> the 
>>>>>>>>>> Agent is only from Java process launched from the remoting thread, I 
>>>>>>>>>> mean 
>>>>>>>>>> is you launch a script in a job this scr

Re: Unable to Run jenkins job on zos slave

2021-10-27 Thread Ivan Fernandez Calvo
the echo step is pure Groovy, however, the sh step uses bash, so probably 
you do not have bash in the PATH of that user, check that bash is installed 
and that user can use it.

El miércoles, 27 de octubre de 2021 a las 15:01:08 UTC+2, 
adharsh...@gmail.com escribió:

> Able to run the echo commands but not able to run the shell commands
>
> On Wed, 27 Oct 2021, 4:12 pm Adharsha sri,  wrote:
>
>> Can anyone help on this error
>>
>> On Wed, 27 Oct 2021, 2:38 pm Adharsha sri,  wrote:
>>
>>> Thanks for the sample pipeline but getting error like " process 
>>> apparently  never started in path
>>> ( running jenkins temporarily  with 
>>> -Dorg.jenkinsci.plugins.durabletask.BourneshellScript.LAUNCH_DIAGNOSTICS=true
>>>  
>>> might make the problem clearer).
>>>
>>> Thanks.
>>>
>>> On Wed, 27 Oct 2021, 1:18 pm Ivan Fernandez Calvo,  
>>> wrote:
>>>
>>>> This is a pretty simple pipeline to expose your environment settings
>>>>
>>>> pipeline {
>>>> agent { label 'YOUR_AGENT_LABELS' }
>>>> stages {
>>>> stage('test') {
>>>> steps {
>>>>   sh 'export'
>>>>   sh 'set'
>>>> }
>>>> }
>>>> }
>>>> }
>>>>
>>>> El miércoles, 27 de octubre de 2021 a las 9:13:59 UTC+2, 
>>>> adharsh...@gmail.com escribió:
>>>>
>>>>> The Configuration  from agent is fine right, but it will be useful 
>>>>> only when we run the jave script. So for shell commands we need to check 
>>>>> .bashrc file in the agent server. Can you please provide the screenshot 
>>>>> of 
>>>>> the .bashrc file and please provide the script  you are using and 
>>>>> examples 
>>>>> of export and set. This will be very helpful for us.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> On Wed, 27 Oct 2021, 8:04 am Adharsha sri,  
>>>>> wrote:
>>>>>
>>>>>> Can you please provide an example.
>>>>>>
>>>>>> On Tue, 26 Oct 2021, 11:52 pm Ivan Fernandez Calvo, <
>>>>>> kuisat...@gmail.com> wrote:
>>>>>>
>>>>>>> This is the output you see in the browser, isn't it? Did you try to 
>>>>>>> download the "view as plain text" button output in a file and with an 
>>>>>>> editor trying to find the correct encoding? the encoding you set in the 
>>>>>>> Agent is only from Java process launched from the remoting thread, I 
>>>>>>> mean 
>>>>>>> is you launch a script in a job this script will use the encodings 
>>>>>>> setting 
>>>>>>> you have configured in the user you use to connect if in your .bashrc 
>>>>>>> (or 
>>>>>>> other shell configuration) you choose other encodings different than 
>>>>>>> UTF-8 
>>>>>>> you will have issues showing the build logs. In these cases I use to 
>>>>>>> try to 
>>>>>>> run a job that shows me the effective environment I am running the job 
>>>>>>> by 
>>>>>>> using the command `export`, `set`, or both, then I check the TERM, LC_* 
>>>>>>> and 
>>>>>>> LANG setting in that user.
>>>>>>>
>>>>>>> El martes, 26 de octubre de 2021 a las 8:34:50 UTC+2, 
>>>>>>> adharsh...@gmail.com escribió:
>>>>>>>
>>>>>>>> Number of executors: 1
>>>>>>>> Launch method: launch agents via SSH
>>>>>>>> Host: host name
>>>>>>>> Host key verification strategy: Non verifying verification strategy 
>>>>>>>>
>>>>>>>> Port : 22
>>>>>>>>
>>>>>>>> Java path: /usr/lpp/java/J8.0/bin/Java
>>>>>>>>
>>>>>>>> JVM Options: -Dfile.encoding=ISO8859-1 
>>>>>>>> -Djava.io.tmpdir=/usr/lpp/test
>>>>>>>>
>>>>>>>> Prefix start Agent command:
>>>>>>>> export JAVA_HOME =/usr/lpp/java/J8.0/ && export  
>>>>>>>> IBM_JAVA_ENABLE_ASCII_FILETAG=ON && _BPXK_AUTOCVT=ON &&am

Re: Unable to Run jenkins job on zos slave

2021-10-27 Thread Ivan Fernandez Calvo
This is a pretty simple pipeline to expose your environment settings

pipeline {
agent { label 'YOUR_AGENT_LABELS' }
stages {
stage('test') {
steps {
  sh 'export'
  sh 'set'
}
}
}
}

El miércoles, 27 de octubre de 2021 a las 9:13:59 UTC+2, 
adharsh...@gmail.com escribió:

> The Configuration  from agent is fine right, but it will be useful only 
> when we run the jave script. So for shell commands we need to check .bashrc 
> file in the agent server. Can you please provide the screenshot of the 
> .bashrc file and please provide the script  you are using and examples of 
> export and set. This will be very helpful for us.
>
> Thanks.
>
> On Wed, 27 Oct 2021, 8:04 am Adharsha sri,  wrote:
>
>> Can you please provide an example.
>>
>> On Tue, 26 Oct 2021, 11:52 pm Ivan Fernandez Calvo,  
>> wrote:
>>
>>> This is the output you see in the browser, isn't it? Did you try to 
>>> download the "view as plain text" button output in a file and with an 
>>> editor trying to find the correct encoding? the encoding you set in the 
>>> Agent is only from Java process launched from the remoting thread, I mean 
>>> is you launch a script in a job this script will use the encodings setting 
>>> you have configured in the user you use to connect if in your .bashrc (or 
>>> other shell configuration) you choose other encodings different than UTF-8 
>>> you will have issues showing the build logs. In these cases I use to try to 
>>> run a job that shows me the effective environment I am running the job by 
>>> using the command `export`, `set`, or both, then I check the TERM, LC_* and 
>>> LANG setting in that user.
>>>
>>> El martes, 26 de octubre de 2021 a las 8:34:50 UTC+2, 
>>> adharsh...@gmail.com escribió:
>>>
>>>> Number of executors: 1
>>>> Launch method: launch agents via SSH
>>>> Host: host name
>>>> Host key verification strategy: Non verifying verification strategy 
>>>>
>>>> Port : 22
>>>>
>>>> Java path: /usr/lpp/java/J8.0/bin/Java
>>>>
>>>> JVM Options: -Dfile.encoding=ISO8859-1 -Djava.io.tmpdir=/usr/lpp/test
>>>>
>>>> Prefix start Agent command:
>>>> export JAVA_HOME =/usr/lpp/java/J8.0/ && export  
>>>> IBM_JAVA_ENABLE_ASCII_FILETAG=ON && _BPXK_AUTOCVT=ON &&
>>>>
>>>> Suffix start Agent command:
>>>>  -text
>>>>
>>>> Connection timeout  in seconds:210
>>>>
>>>>
>>>> On Tue, 26 Oct 2021, 11:20 am geoffroy...@gmail.com, <
>>>> geoffroy...@gmail.com> wrote:
>>>>
>>>>> can you please show a screenshot of the zos agent configuration (all 
>>>>> fields)?
>>>>>
>>>>> On Tuesday, 26 October 2021 at 04:27:21 UTC+2 adharsh...@gmail.com 
>>>>> wrote:
>>>>>
>>>>>> Yes , based on that page , we have configured the slave. But still 
>>>>>> facing the same issue.
>>>>>>
>>>>>> On Mon, 25 Oct 2021, 11:30 pm geoffroy...@gmail.com, <
>>>>>> geoffroy...@gmail.com> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>> have you checked this page (first results in google): 
>>>>>>> https://gdams.medium.com/adding-zos-to-our-jenkins-build-farm-27ab5171fb35
>>>>>>> Seems you might need to tune the JVM options, using  
>>>>>>> -Dfile.encoding=ISO8859-1
>>>>>>>
>>>>>>>
>>>>>>> On Monday, 25 October 2021 at 13:49:52 UTC+2 adharsh...@gmail.com 
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Can you please consider this as priority. Actually  it is critical 
>>>>>>>> issue for us.
>>>>>>>> Whether z/ os platform is supported for jenkins or not . If it is 
>>>>>>>> supported, where we are missing and why we are not getting the output. 
>>>>>>>> Please help on this issue. 
>>>>>>>>
>>>>>>>> On Mon, 25 Oct 2021, 17:12 Adharsha sri,  
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> We are running just date command or simple echo command  through 
>>>>>>>>> execute shell but not getting the actual output
>>>>>&g

Re: Unable to Run jenkins job on zos slave

2021-10-26 Thread Ivan Fernandez Calvo
This is the output you see in the browser, isn't it? Did you try to 
download the "view as plain text" button output in a file and with an 
editor trying to find the correct encoding? the encoding you set in the 
Agent is only from Java process launched from the remoting thread, I mean 
is you launch a script in a job this script will use the encodings setting 
you have configured in the user you use to connect if in your .bashrc (or 
other shell configuration) you choose other encodings different than UTF-8 
you will have issues showing the build logs. In these cases I use to try to 
run a job that shows me the effective environment I am running the job by 
using the command `export`, `set`, or both, then I check the TERM, LC_* and 
LANG setting in that user.

El martes, 26 de octubre de 2021 a las 8:34:50 UTC+2, adharsh...@gmail.com 
escribió:

> Number of executors: 1
> Launch method: launch agents via SSH
> Host: host name
> Host key verification strategy: Non verifying verification strategy 
>
> Port : 22
>
> Java path: /usr/lpp/java/J8.0/bin/Java
>
> JVM Options: -Dfile.encoding=ISO8859-1 -Djava.io.tmpdir=/usr/lpp/test
>
> Prefix start Agent command:
> export JAVA_HOME =/usr/lpp/java/J8.0/ && export  
> IBM_JAVA_ENABLE_ASCII_FILETAG=ON && _BPXK_AUTOCVT=ON &&
>
> Suffix start Agent command:
>  -text
>
> Connection timeout  in seconds:210
>
>
> On Tue, 26 Oct 2021, 11:20 am geoffroy...@gmail.com, <
> geoffroy...@gmail.com> wrote:
>
>> can you please show a screenshot of the zos agent configuration (all 
>> fields)?
>>
>> On Tuesday, 26 October 2021 at 04:27:21 UTC+2 adharsh...@gmail.com wrote:
>>
>>> Yes , based on that page , we have configured the slave. But still 
>>> facing the same issue.
>>>
>>> On Mon, 25 Oct 2021, 11:30 pm geoffroy...@gmail.com, <
>>> geoffroy...@gmail.com> wrote:
>>>
 Hi
 have you checked this page (first results in google): 
 https://gdams.medium.com/adding-zos-to-our-jenkins-build-farm-27ab5171fb35
 Seems you might need to tune the JVM options, using  
 -Dfile.encoding=ISO8859-1


 On Monday, 25 October 2021 at 13:49:52 UTC+2 adharsh...@gmail.com 
 wrote:

> Can you please consider this as priority. Actually  it is critical 
> issue for us.
> Whether z/ os platform is supported for jenkins or not . If it is 
> supported, where we are missing and why we are not getting the output. 
> Please help on this issue. 
>
> On Mon, 25 Oct 2021, 17:12 Adharsha sri,  wrote:
>
>> We are running just date command or simple echo command  through 
>> execute shell but not getting the actual output
>>
>> On Mon, 25 Oct 2021, 17:09 Adharsha sri,  
>> wrote:
>>
>>> +□?EA/¤
>>> Some thing like above 
>>>
>>> On Mon, 25 Oct 2021, 15:56 Fabian Cenedese,  
>>> wrote:
>>>
 At 14:21 21.10.2021, you wrote:

 >Can you please help me for this issue
 >
 >On Wed, 20 Oct 2021, 18:53 Adharsha sri, <>>> adharsh...@gmail.com>adharsh...@gmail.com> wrote:
 >Hi Team,
 >
 >I am unable to run a jenkins job ( shell command : date) on zos 
 slave . The slave is active and online but getting some gibberish 
 values in 
 console output. Please help.

 Please post the "gibberish".

 bye  Fabi

 -- 
 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-use...@googlegroups.com.
 To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-users/20211025102601.192AF48935CC%40macserver.private
 .

>>> -- 
 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-use...@googlegroups.com.

>>> To view this discussion on the web visit 
 https://groups.google.com/d/msgid/jenkinsci-users/61ef6928-d20b-4e57-b30c-658c5e176474n%40googlegroups.com
  
 
 .

>>> -- 
>> 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-use...@googlegroups.com.
>>
> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/926ab580-3b04-418c-be05-7dc8742c5205n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
You received this message 

Re: Help! I am trying to upgrade from 2.263.1 to 2.303.1

2021-10-03 Thread Ivan Fernandez Calvo
It is not clear what it is the current issue you want to resolve, so my 
suggestion is to start again the first case you expose.

>On my first try, I thought I had upgraded, but I did not realize that the 
version of WAR file was the same (2.263.1) I upgraded the plugins, then 
realized that it had not been upgraded to 2.303.1, so then I put the new 
WAR file in place.  I was able to log in just fine, but one of the most 
important pipelines I have did not work.  I makes a call out to Gitlab and 
I update Gitlab at the same time.

Before upgrading the production environment try to upgrade the same system 
but in another machine:

* In a new machine
* Copy the JENKINS_HOME folder to the new server in the same place
* Remove the folder JENKINS_HOME/nodes/* (we do not want to use the 
production Agents)
* Start Jenkins in the new machine 
* Upgrade the plugins
* Stop Jenkins
* Update the war
* Start Jenkins
* Create a new Agent that fit the requirements of your important pipeline
* Test the pipeline

At this point you'd have the same issue you face at the beginning, to try 
to troubleshoot it you need to check
* Check the Jenkins logs from the start to the execution of the pipeline, 
we are looking for exceptions 
* Check the console log of the pipeline to see which error is causing the 
pipeline to not work
* check the logs of the Agent in case we are error there
* Check the manage Jenkins and check there is no warning or error at the 
top of the page

If you provide the exceptions you found we could help you to point to a 
specific fix. 
My guess is that you have a problem with a plugin version, it could be that 
it conflicts with another, 
or your pipeline needs a specific version of a plugin.

El viernes, 1 de octubre de 2021 a las 19:51:26 UTC+2, 
daniel...@vistracorp.com escribió:

> I put a new WAR in place and restart and normally, no issues at all.
>
> I have RedHat 6 running on an AWS EC2.  
>
> On my first try, I thought I had upgraded, but I did not realize that the 
> version of WAR file was the same (2.263.1) I upgraded the plugins, then 
> realized that it had not been upgraded to 2.303.1, so then I put the new 
> WAR file in place.  I was able to log in just fine, but one of the most 
> important pipelines I have did not work.  I makes a call out to Gitlab and 
> I update Gitlab at the same time.
>
> I went backwards to snapshots I made of the two servers before I 
> upgraded.  Validated that the pipeline works, then upgraded Gitlab fully 
> tested and the pipeline worked.  So I narrowed the issue to Jenkins.  I 
> tried the upgrade again, without updating the plugins first.  This time, I 
> got an error on login page, If I clicked on Login, it gives me a prompt to 
> put my ID and password, upon hitting enter it gives me a 403 crumb error.  
> We use A/D to validate credentials.
>
> I have tried several times, even trying to go down to the LTS right after 
> the 2.263 release same issue.  At this point I am assuming I have a plugin 
> problem.
>
> I tried to look at the log and even created the logging.properties file 
> but I don't see anything glaringly obvious there either.
>
> Can someone assist, suggest something?
>
> Thank you
> Daniel 
>

-- 
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/dd832571-e507-4c97-8ec3-88096dfa5cbbn%40googlegroups.com.


Re: User management

2021-09-06 Thread Ivan Fernandez Calvo
Hi,

you have a few possibilities depending on the authorization plugin you use, 
but the configuration of the access of the project is more or less the same,
 you have to add the authorization at folder or job level after configuring 
your authorization plugin. Here is the documentation related.

Access management documentation
https://www.jenkins.io/doc/book/security/access-control/
https://www.jenkins.io/doc/book/security/managing-security/

Authorization plugins
https://plugins.jenkins.io/matrix-auth/
https://plugins.jenkins.io/role-strategy/
https://plugins.jenkins.io/authorize-project/
El domingo, 5 de septiembre de 2021 a las 17:20:57 UTC+2, cnav...@gmail.com 
escribió:

> HI all,
> How do we make sure job created by user, only that person can modify/delete
>
> We are using Azure Active Directory. As of now we have
> Admin : who can do everything
> developer : build, create, delete jobs
> other : who can just view only jobs.
>
> Can one user in developer modify/delete other user jobs??
>
> Best Regards,
> Naveen
>

-- 
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/206fbada-d7f5-4745-8cd9-b469c485b2d8n%40googlegroups.com.


Re: SAML plugin 2.0.8

2021-09-01 Thread Ivan Fernandez Calvo
I just created the 3 new releases.

El martes, 31 de agosto de 2021 a las 19:39:54 UTC+2, alan.l...@gmail.com 
escribió:

> Sounds good, and the security warning did clear.  Thanks for the rapid 
> response!
> -Alan
>
> On Tuesday, August 31, 2021 at 10:53:27 AM UTC-6 db...@cloudbees.com 
> wrote:
>
>> On Tue, Aug 31, 2021 at 5:29 PM Alan Sparks  
>> wrote:
>>
>>> I went to upgrade this, and the after-installed one shows the same 
>>> security notice in my Jenkins 2.289.3 master.  The GitHub Releases shows 
>>> 2.0.7 as the current.  Was the 2.0.8 release pulled back?
>>>
>>> -Alan
>>>
>>
>> The release has not been pulled. Two separate issues here:
>>
>> - Release drafter / GH releases do not play well with how we prepare and 
>> publish security updates. A maintainer will need to manually create the 
>> release on GH.
>> - I published wrong security warnings at first and fixed them ~15 minutes 
>> ago. If 2.0.8 is installed, they should disappear once you refresh 
>> update center metadata.
>>
>>

-- 
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/d13b9a6e-faac-4462-907e-05a5c2048bd9n%40googlegroups.com.


Re: SAML Single Sign On (SSO) Into Jenkins

2021-07-29 Thread Ivan Fernandez Calvo
check the ADFS documentation 
https://github.com/jenkinsci/saml-plugin/blob/master/doc/ADFS_CONFIG.md

El jueves, 29 de julio de 2021 a las 14:42:06 UTC+2, shli...@gmail.com 
escribió:

> Hi
> I installed the Saml Single Sign On (sso) plugin 
> Configured the plugin with the idp information 
> Then I sent to my system administrator the files that jenkins created:
> sp_metadata.xml
> sp-certificate.crt
> After he configured the sp information he asked for jenkins Claims
> Where can I find this information?
>
>
>
>

-- 
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/42c1211d-5e45-4e23-9ea3-5c4d471cfc00n%40googlegroups.com.


Re: Node provisioning with SimpleScheduledRetentionStrategy

2021-07-20 Thread Ivan Fernandez Calvo
The Availability is a little tricky, I think you have to make it the other 
way around. Instead of building the agent in the "Launch Agent using 
Command on Controller" build the agent on a scheduled job then you will 
have the agent only available when you launched the job. You probably need 
another scheduled job to unprovision the agent. The agent configuration 
would be a regular agent (JNLP, SSH, ...) with the type of connection you 
need and the Availability scheduled as you want.

El lunes, 19 de julio de 2021 a las 23:50:04 UTC+2, 12s...@gmail.com 
escribió:

> We provision nodes using the "Launch Agent using Command on Controller" 
> option in the node settings. This will call a script which creates a node 
> in our internal cloud and starts the agent. The script takes 30 minutes to 
> an hour to get a node, set it up and start the agent. 
>
> We also use the "Bring this agent online according to a schedule" in the 
> "Availability" option. When we use this option, Jenkins keep checking if 
> the node is online every couple of minutes and triggers another execution 
> of the script without waiting for the first execution to complete (i.e. 
> agent startup). This ends up creating multiple executions and overwhelms 
> our cluster. Attached screenshot to give an idea. 
>
> From the log: 
> /var/log/jenkins/jenkins.log.1:2021-07-13 03:50:32.709+ [id=45]
> INFOh.s.SimpleScheduledRetentionStrategy#check: Trying to launch 
> computer S1 as schedule says it should be on-line at this point in time
> /var/log/jenkins/jenkins.log.1:2021-07-13 03:52:32.707+ [id=46]
> INFOh.s.SimpleScheduledRetentionStrategy#check: Trying to launch 
> computer S2 as schedule says it should be on-line at this point in time
>
> How can I stop Jenkins from not triggering the same script multiple times 
> over and wait for the first execution to complete?
>

-- 
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/deec7517-2afa-4f66-b06b-8386a302a914n%40googlegroups.com.


Re: DSL parallel stage from dynamic list using pure DSL instead of scripted

2021-07-16 Thread Ivan Fernandez Calvo
There is an implementation on the declarative 
pipeline https://www.jenkins.io/doc/book/pipeline/syntax/#declarative-matrix 
it has some limitations like the amount of generated code that sometimes 
you have to extract the code to functions, and it does not allow to grab 
axis from variables.
To avoid those limitation we implemented something similar in our shared 
pipeline library

https://github.com/elastic/apm-pipeline-library/blob/master/vars/matrix.txt
https://github.com/elastic/apm-pipeline-library/blob/master/vars/matrix.groovy
https://github.com/elastic/apm-pipeline-library/blob/master/vars/axis.groovy

El viernes, 16 de julio de 2021 a las 12:17:39 UTC+2, vineeth...@gmail.com 
escribió:

> Hi,
>
> I am trying to create a jenkins pipeline that can run parallel stages 
> based on a dynamic list. Went through doc 
> https://www.jenkins.io/doc/book/pipeline/syntax/#parallel but could not 
> find a way to do the parallel stages based on a dynamic list. I found ways 
> to achieve the same by using scripted pipelines (
> https://www.jenkins.io/doc/pipeline/examples/#parallel-from-list), but 
> was wondering if there is a way to do that with pure DSL. 
>
> Thanks
>
> Vineeth
>

-- 
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/622c4165-2e26-46d9-84b9-f2118b8b3c73n%40googlegroups.com.


Re: Git repo url

2021-07-14 Thread Ivan Fernandez Calvo
In the following repos you can find the pieces to build the script you want

https://github.com/jenkinsci/jenkins-scripts/tree/master/scriptler
https://github.com/cloudbees/jenkins-scripts

El miércoles, 14 de julio de 2021 a las 17:12:32 UTC+2, arun...@gmail.com 
escribió:

> Hi ,
>
> I'm trying to generate the report with jenkins jobs and its git repo url 
> details.
>
> Any easy way to generate it from the script console.? Please assist.
>
> Thanks in advance.
>
> Arun
>

-- 
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/f8ceedcb-ef51-4a4c-876f-81039314a186n%40googlegroups.com.


Re: Jenkins Shared Library

2021-07-14 Thread Ivan Fernandez Calvo
one more thing if you want to have those scripts shared across pipelines 
you can use the shared library.
You can define those scripts as resources in the shared library and invoke 
them directly

def stdout = bat(returnStdout: true, script: "*groovy -e 
'${libraryResource('my-script.groovy'))}'* ")

see https://www.jenkins.io/doc/book/pipeline/shared-libraries/#loading-resources
El miércoles, 14 de julio de 2021 a las 20:15:38 UTC+2, Ivan Fernandez 
Calvo escribió:

> no, it is not possible, the groovy code is executed in the Jenkins 
> controller by design, it is designed to execute simple logic of 
> orchestration logic, if you want to execute heavy logic you should do it on 
> the agents by using steps that run scripts or processes on the agent. 
>
> pipeline {
>agent { label 'scdc-generic-w10x64' }
>options {
>   timestamps()
>}
>stages {
>   stage('Log ip') {
> steps {
> script {
>bat "ipconfig -all"   // *** Gets executed on Jenkins Agent 
> ***
>def stdout = bat(returnStdout: true, script: "*groovy 
> *my-script.groovy" 
> // *** Gets executed on Jenkins Agent ***
>echo "stdout"
> }
>  }
>   }
>}
>post {
>   always {
>  cleanWs()
>   }
>}
> }
>
> the script can be whatever you want groovy, python, PowerShell, or a 
> simple binary, the only that you have to have is the script interpreter 
> installed in your Jenkins agent 
> take a look at this fantastic Jesse Glick presentation to know why 
> https://www.youtube.com/watch?v=Zeqc6--0eQw
> El martes, 13 de julio de 2021 a las 22:49:57 UTC+2, raviraj...@gmail.com 
> escribió:
>
>> I have a question regarding the execution of JSL scripts on the Jenkins 
>> Agent node. I noticed JSL scripts get executed only on Jenkins Master, is 
>> it possible to run the JSL script on Jenkins Agents?
>>
>> I have multiple stages in my Pipeline and I wish to run those stages on 
>> different Jenkins Agent nodes. 
>>
>> My primary motivation for using JSL is end-to-end Pipeline testability 
>> during development using “replay”, where I can modify Jenkinsfile as well 
>> as scripts from JSL.
>>
>> This is a snippet of my Pipeline --
>>
>> pipeline {
>>agent { label 'scdc-generic-w10x64' }
>>options {
>>   timestamps()
>>}
>>stages {
>>   stage('Log ip') {
>> steps {
>> script {
>>bat "ipconfig -all"   // *** Gets executed on Jenkins 
>> Agent ***
>>foo = jsl.foo.new(this) // foo is a Groovy class in JSL
>>foo.logIpAddress()   // *** Gets executed on Jenkins 
>> Master ***
>> }
>>  }
>>   }
>>}
>>post {
>>   always {
>>  cleanWs()
>>   }
>>}
>> }
>>
>>

-- 
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/04713271-b830-4982-a20d-478e5a857724n%40googlegroups.com.


Re: Jenkins Shared Library

2021-07-14 Thread Ivan Fernandez Calvo
no, it is not possible, the groovy code is executed in the Jenkins 
controller by design, it is designed to execute simple logic of 
orchestration logic, if you want to execute heavy logic you should do it on 
the agents by using steps that run scripts or processes on the agent. 

pipeline {
   agent { label 'scdc-generic-w10x64' }
   options {
  timestamps()
   }
   stages {
  stage('Log ip') {
steps {
script {
   bat "ipconfig -all"   // *** Gets executed on Jenkins Agent 
***
   def stdout = bat(returnStdout: true, script: "*groovy 
*my-script.groovy" 
// *** Gets executed on Jenkins Agent ***
   echo "stdout"
}
 }
  }
   }
   post {
  always {
 cleanWs()
  }
   }
}

the script can be whatever you want groovy, python, PowerShell, or a simple 
binary, the only that you have to have is the script interpreter installed 
in your Jenkins agent 
take a look at this fantastic Jesse Glick presentation to know why 
https://www.youtube.com/watch?v=Zeqc6--0eQw
El martes, 13 de julio de 2021 a las 22:49:57 UTC+2, raviraj...@gmail.com 
escribió:

> I have a question regarding the execution of JSL scripts on the Jenkins 
> Agent node. I noticed JSL scripts get executed only on Jenkins Master, is 
> it possible to run the JSL script on Jenkins Agents?
>
> I have multiple stages in my Pipeline and I wish to run those stages on 
> different Jenkins Agent nodes. 
>
> My primary motivation for using JSL is end-to-end Pipeline testability 
> during development using “replay”, where I can modify Jenkinsfile as well 
> as scripts from JSL.
>
> This is a snippet of my Pipeline --
>
> pipeline {
>agent { label 'scdc-generic-w10x64' }
>options {
>   timestamps()
>}
>stages {
>   stage('Log ip') {
> steps {
> script {
>bat "ipconfig -all"   // *** Gets executed on Jenkins Agent 
> ***
>foo = jsl.foo.new(this) // foo is a Groovy class in JSL
>foo.logIpAddress()   // *** Gets executed on Jenkins Master 
> ***
> }
>  }
>   }
>}
>post {
>   always {
>  cleanWs()
>   }
>}
> }
>
>

-- 
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/d1113336-ac16-4137-b30a-754e3005df76n%40googlegroups.com.


Re: Loop over a list of environment variables inside the environment directive at start of pipeline

2021-07-14 Thread Ivan Fernandez Calvo
the environment is a declarative block, what you are trying to make is to 
define a bunch of variables with a scriptlet block, this is far away from 
declarative.
The following code make what you want to do

pipeline {
agent any

stages {
stage('test') {
steps {
   script {
   [A:1,B:2].each { k, v ->
   env."${k}" = "${v}"
   }
   echo """
   A = ${env.A}
   B = ${env.B}
   """
   }
}
}
}
}

El miércoles, 14 de julio de 2021 a las 17:15:29 UTC+2, 
fakemai...@gmail.com escribió:

> I haven't found any examples of how to do this
>
> instead of this:
>
> pipeline {
>
> agent { label 'docker' }
>
> environment {
>
> ENV1 = 'default'
>
> ENV2 = 'default'
>
> }
>
>
> I want to do this:
>
> pipeline {
>
> agent { label 'docker' }
>
> environment {
>
> for (env in envs) {
>
>env.name = env.value
>
> }
>
> }
>
>
> maybe I can generate a map before the `pipeline{}` directive and pass it 
> to `environment{}` somehow? I dont want to do this inside of a stage I want 
> this at the top level environment directive for all stages
>

-- 
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/731604df-3a72-4c54-ba63-d5626a9e437bn%40googlegroups.com.


Re: "configure" fails with major.minor version issue

2021-07-12 Thread Ivan Fernandez Calvo
I guess you update some plugins one of those plugins is the script security 
plugin, which in the version you update works on Jenkins 1.609 but does not 
support Java 6. I will tell you that the faster solution is to restore the 
plugins folder from a backup that you have before the changes on the 
plugins, if you do not have that backup you have to review all hpi files in 
the plugins folder, and check the file MANIFEST.MF inside the hip file, it 
is a zip, in that manifest, you have to check the value in 
"Minimum-Java-Version:", all the plugins that require 1.8 are not valid for 
your installation. But again you have a security clock boom on that 
instance a Java version from 2013 and a Jenkins core from 2015.

El lunes, 12 de julio de 2021 a las 20:21:51 UTC+2, bob...@gmail.com 
escribió:

> On our current production server we run 1.609 with Java 1.6. It is very 
> very old but it's not my decision to upgrade it, it's the Dev Team's. This 
> version and this Java are indeed compatible, Jenkins runs fine on our 
> current server.
>
> I therefore need to revert to 1.6 anything that has, inadvertently, gone 
> to 1.8. Please help me with that.  To start with, am I running into 1.8 
> plugins, or 1.8 artifacts? 
>
> Some sites suggest that this is a browser/Javascript issue. I'm at a loss.
>
> On Monday, July 12, 2021 at 7:25:52 PM UTC+3 kuisat...@gmail.com wrote:
>
>> "Unsupported major.minor version 52.0" means that you need to run on Java 
>> 8 (see 
>> https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi/
>> )
>>
>> the Java 6 version you are using is EOL since 2013 (see 
>> https://en.wikipedia.org/wiki/Java_version_history) and your Jenkins 
>> version was released in 2015 (see 
>> https://www.jenkins.io/changelog-stable/#v1.609.3) so I don't know if 
>> that version can run on Java 6, I dunno why you are trying to use something 
>> old and with tons of issues resolved in the latest version on an outdated 
>> and without support Java version, but sounds like a no-good idea.
>>
>> El lunes, 12 de julio de 2021 a las 16:33:20 UTC+2, bob...@gmail.com 
>> escribió:
>>
>>> Let me add that the system property java.class.version  on both servers 
>>> new (source and copy) has the value 50.0
>>>
>>> So it seems I need to get rid of all 52.0 stuff.
>>>
>>>
>>>
>>> On Monday, July 12, 2021 at 4:30:53 PM UTC+3 GI D wrote:
>>>
 On a copied installation of Jenkins 1.609 to a new server, I notice 
 that when I select a build and click "configure", I get a greyed-out 
 config 
 page with "LOADING" as a watermark that never goes away. At the same time 
 I 
 see in catalina.out lots of errors such as this:

 Jul 12, 2021 4:15:20 PM hudson.ExpressionFactory2$JexlExpression 
 evaluate
 WARNING: Caught exception evaluating: d.helpFile in 
 /jenkins/job/platform%20set%20branch%20name/configure. Reason: jav
 a.lang.reflect.InvocationTargetException
 
 
 Caused by: java.lang.UnsupportedClassVersionError: 
 org/jenkinsci/plugins/scriptsecurity/sandbox/RejectedAccessException : 
 Unsupported major.minor version 52.0

 I think the reason is that, for a few days, I was running the new 
 Jenkins with a slightly newer Java version (1.6.0_41 rather than 
 1.6.0_30). 
 Now I have made sure I run it with _30. During this short period this 
 particular build has been executed a few times. However I do get the same 
 problem on other builds that have not executed on this new server.

 Almost all errors (or warnings if you will) are about the 
 script-security plugin. 

 Please advise.

 - George



-- 
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/f90a43f2-7c29-4ceb-b4a3-4de70591f3aan%40googlegroups.com.


Re: "configure" fails with major.minor version issue

2021-07-12 Thread Ivan Fernandez Calvo
"Unsupported major.minor version 52.0" means that you need to run on Java 8 
(see 
https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi/
)

the Java 6 version you are using is EOL since 2013 (see 
https://en.wikipedia.org/wiki/Java_version_history) and your Jenkins 
version was released in 2015 (see 
https://www.jenkins.io/changelog-stable/#v1.609.3) so I don't know if that 
version can run on Java 6, I dunno why you are trying to use something old 
and with tons of issues resolved in the latest version on an outdated and 
without support Java version, but sounds like a no-good idea.

El lunes, 12 de julio de 2021 a las 16:33:20 UTC+2, bob...@gmail.com 
escribió:

> Let me add that the system property java.class.version  on both servers 
> new (source and copy) has the value 50.0
>
> So it seems I need to get rid of all 52.0 stuff.
>
>
>
> On Monday, July 12, 2021 at 4:30:53 PM UTC+3 GI D wrote:
>
>> On a copied installation of Jenkins 1.609 to a new server, I notice that 
>> when I select a build and click "configure", I get a greyed-out config page 
>> with "LOADING" as a watermark that never goes away. At the same time I see 
>> in catalina.out lots of errors such as this:
>>
>> Jul 12, 2021 4:15:20 PM hudson.ExpressionFactory2$JexlExpression evaluate
>> WARNING: Caught exception evaluating: d.helpFile in 
>> /jenkins/job/platform%20set%20branch%20name/configure. Reason: jav
>> a.lang.reflect.InvocationTargetException
>> 
>> 
>> Caused by: java.lang.UnsupportedClassVersionError: 
>> org/jenkinsci/plugins/scriptsecurity/sandbox/RejectedAccessException : 
>> Unsupported major.minor version 52.0
>>
>> I think the reason is that, for a few days, I was running the new Jenkins 
>> with a slightly newer Java version (1.6.0_41 rather than 1.6.0_30). Now I 
>> have made sure I run it with _30. During this short period this particular 
>> build has been executed a few times. However I do get the same problem on 
>> other builds that have not executed on this new server.
>>
>> Almost all errors (or warnings if you will) are about the script-security 
>> plugin. 
>>
>> Please advise.
>>
>> - George
>>
>>

-- 
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/71de-8fbb-4176-a45c-cc2782ec000en%40googlegroups.com.


Re: "configure" fails with major.minor version issue

2021-07-12 Thread Ivan Fernandez Calvo
"Unsupported major.minor version 52.0" means that you need to run on Java 8 
(see 
https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi/)

the Java 6 version you are using is EOL since 2013 (see 
https://en.wikipedia.org/wiki/Java_version_history) and your Jenkins 
version was released in 2015 (see 
https://www.jenkins.io/changelog-stable/#v1.609.3) so I don't that this 
version can run on Java 6. I dunno why you are trying to use something old 
and with tons of issues resolved in the latest version on an outdated and 
without support Java version, but sounds like a no-good idea.

El lunes, 12 de julio de 2021 a las 16:33:20 UTC+2, bob...@gmail.com 
escribió:

> Let me add that the system property java.class.version  on both servers 
> new (source and copy) has the value 50.0
>
> So it seems I need to get rid of all 52.0 stuff.
>
>
>
> On Monday, July 12, 2021 at 4:30:53 PM UTC+3 GI D wrote:
>
>> On a copied installation of Jenkins 1.609 to a new server, I notice that 
>> when I select a build and click "configure", I get a greyed-out config page 
>> with "LOADING" as a watermark that never goes away. At the same time I see 
>> in catalina.out lots of errors such as this:
>>
>> Jul 12, 2021 4:15:20 PM hudson.ExpressionFactory2$JexlExpression evaluate
>> WARNING: Caught exception evaluating: d.helpFile in 
>> /jenkins/job/platform%20set%20branch%20name/configure. Reason: jav
>> a.lang.reflect.InvocationTargetException
>> 
>> 
>> Caused by: java.lang.UnsupportedClassVersionError: 
>> org/jenkinsci/plugins/scriptsecurity/sandbox/RejectedAccessException : 
>> Unsupported major.minor version 52.0
>>
>> I think the reason is that, for a few days, I was running the new Jenkins 
>> with a slightly newer Java version (1.6.0_41 rather than 1.6.0_30). Now I 
>> have made sure I run it with _30. During this short period this particular 
>> build has been executed a few times. However I do get the same problem on 
>> other builds that have not executed on this new server.
>>
>> Almost all errors (or warnings if you will) are about the script-security 
>> plugin. 
>>
>> Please advise.
>>
>> - George
>>
>>

-- 
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/5ad0b2e8-e7d9-4a09-8475-8de696b315fcn%40googlegroups.com.


Re: Jenkins master to slave connection is giving key verification error.

2021-07-06 Thread Ivan Fernandez Calvo
>We have  set up a Master slave configuration it is giving Error as  Host 
Key Verification Strategy failed

Could you provide the error and exception stack trace you show in the logs 
of the AGENT? 

>and we had the  strategy i.e Non Verifying Verification Strategy , but 
even after that the host are offline.

I do not understand what it is the initial configuration of the Agent and 
what you are changing. Again, the error and stack trace can help here.

>Please suggest what need to be done, once we Comment the KexAlgorithms 
and MACs these two lines in the  SSHD_Config File , the nodes are online, 
Please give a permanent solution for these ? 

Which settings did you comment exactly? Can you provide the line you have 
commented?

It looks like is related to the kex process but, you do not provide info 
about the length and algorithm of your keys, also you do not provide the 
kex algorithms you have configured, so it is really difficult to help you 
in any way.

Check this documentation to see if you are configuring correctly the Host 
Key Verification and if your key is supported
https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/CONFIGURE.md#host-key-verification-strategy

these are the Kex algorithm supported
https://github.com/jenkinsci/trilead-ssh2/blob/f6cf3b4230a3350cfa9670c44c991d351ee184f0/src/com/trilead/ssh2/transport/KexManager.java#L374-L375


El martes, 6 de julio de 2021 a las 9:41:24 UTC+2, subrat...@gmail.com 
escribió:

> Hi Team,
>
> We have  set up a Master slave configuration it is giving Error as  Host 
> Key Verification Strategy failed  and we had the  strategy i.e Non 
> Verifying Verification Strategy , but even after that the host are offline. 
> Please suggest what need to be done, once we Comment the KexAlgorithms 
> and MACs these two lines in the  SSHD_Config File , the nodes are online, 
> Please give a permanent solution for these ? 
>

-- 
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/58733346-ee10-48f0-8110-d232e3d55a20n%40googlegroups.com.


Re: Trouble using JenkinsRule with PluginManager

2021-06-30 Thread Ivan Fernandez Calvo
We do not use Spock, but we have a process to test jobDSL definitions 
before applying changes 
see https://github.com/elastic/apm-pipeline-library/tree/master/.ci/jobDSL 
it test that the syntax is correct and test that you can create the job.
Probably the class that helps you 
is 
https://github.com/elastic/apm-pipeline-library/blob/master/.ci/jobDSL/src/test/groovy/JobScriptsSpec.groovy
 
, also it is really tricky to configure the plugins you need 
on 
https://github.com/elastic/apm-pipeline-library/blob/master/.ci/jobDSL/build.gradle#L29-L68

El miércoles, 30 de junio de 2021 a las 16:33:56 UTC+2, 
matthi...@outlook.com escribió:

> Hi, I'm trying to use a different set of plugins for different Spock 
> Specifications. I've posted a more detail question here: 
> https://stackoverflow.com/questions/68196423/trouble-using-a-base-spock-specification-and-jenkinsrule-with-pluginmanager
>  
> I'm hoping that someone might be able to provide some insight. Thank you. 

-- 
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/402a9608-e467-4f21-b66c-634d3e8894dcn%40googlegroups.com.


Re: java.io.IOException: error=2, No such file or directory - Error

2021-06-22 Thread Ivan Fernandez Calvo
IIRC this is because you do not have Docker CLI installed on the Jenkins 
controller.

El martes, 22 de junio de 2021 a las 16:38:16 UTC+2, gangaia...@gmail.com 
escribió:

> Hi All,
>
> Hope everyone are doing fine.
>
> We are migrating from bamboo to Jenkins and finding some hurdles during 
> this process.
>
> We are trying to create agent which uses docker image and start building 
> our job inside the container. PFB code snippet we used
>
> agent {
> docker {
> image 'maven:3.8.1-adoptopenjdk-11'
> }
> }
>
> In the above scenario we faced "docker command not found" error and 
> changed to below snippet.
>
> agent {
> docker {
> image 'myregistry.com/node'
> registryUrl 'https://myregistry.com/'
> registryCredentialsId 'myPredefinedCredentialsInJenkins'
> }
> }
>
> While when the above snippet is executed we are getting below error.
>
> [2021-06-22T10:43:46.706Z] Running on main-0mzqv in 
> /home/jenkins/agent/workspace/abcd/custom_image
> [2021-06-22T10:43:46.711Z] [Pipeline] {
> [2021-06-22T10:43:47.164Z] [Pipeline] withEnv
> [2021-06-22T10:43:47.169Z] [Pipeline] {
> [2021-06-22T10:43:47.204Z] [Pipeline] withDockerRegistry
> [2021-06-22T10:43:47.636Z] $ docker login -u abcd -p  
> https://docker-url
> [2021-06-22T10:43:47.707Z] [Pipeline] // withDockerRegistry
> [2021-06-22T10:43:47.739Z] [Pipeline] }
> [2021-06-22T10:43:47.783Z] [Pipeline] // withEnv
> [2021-06-22T10:43:47.800Z] [Pipeline] }
> [2021-06-22T10:43:47.830Z] [Pipeline] // node
> [2021-06-22T10:43:47.866Z] [Pipeline] End of Pipeline
> [2021-06-22T10:43:55.117Z] java.io.IOException: error=2, No such file or 
> directory
> [2021-06-22T10:43:55.117Z] at java.lang.UNIXProcess.forkAndExec(Native 
> Method)
> [2021-06-22T10:43:55.117Z] at 
> java.lang.UNIXProcess.(UNIXProcess.java:247)
> [2021-06-22T10:43:55.117Z] at 
> java.lang.ProcessImpl.start(ProcessImpl.java:134)
> [2021-06-22T10:43:55.117Z] at 
> java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
> [2021-06-22T10:43:55.117Z] Also:   
> hudson.remoting.Channel$CallSiteStackTrace: Remote call to JNLP4-connect 
> connection from.X.X.X:X
> [2021-06-22T10:43:55.117Z] at 
> hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1800)
> [2021-06-22T10:43:55.117Z] at 
> hudson.remoting.UserRequest$ExceptionResponse.retrieve(UserRequest.java:356)
> [2021-06-22T10:43:55.118Z] at 
> hudson.remoting.Channel.call(Channel.java:1001)
> [2021-06-22T10:43:55.118Z] at 
> hudson.Launcher$RemoteLauncher.launch(Launcher.java:1121)
> [2021-06-22T10:43:55.118Z] at 
> hudson.Launcher$ProcStarter.start(Launcher.java:508)
> [2021-06-22T10:43:55.118Z] at 
> hudson.Launcher$ProcStarter.join(Launcher.java:519)
> [2021-06-22T10:43:55.118Z] at 
> org.jenkinsci.plugins.docker.commons.impl.RegistryKeyMaterialFactory.materialize(RegistryKeyMaterialFactory.java:101)
> [2021-06-22T10:43:55.118Z] at 
> org.jenkinsci.plugins.docker.workflow.AbstractEndpointStepExecution2.doStart(AbstractEndpointStepExecution2.java:53)
> [2021-06-22T10:43:55.118Z] at 
> org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)
> [2021-06-22T10:43:55.118Z] at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> [2021-06-22T10:43:55.118Z] at 
> java.util.concurrent.FutureTask.run(FutureTask.java:266)
> [2021-06-22T10:43:55.118Z] at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [2021-06-22T10:43:55.118Z] at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> [2021-06-22T10:43:55.118Z] Caused: java.io.IOException: Cannot run program 
> "docker": error=2, No such file or directory
> [2021-06-22T10:43:55.118Z] at 
> java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
> [2021-06-22T10:43:55.118Z] at hudson.Proc$LocalProc.(Proc.java:252)
> [2021-06-22T10:43:55.118Z] at hudson.Proc$LocalProc.(Proc.java:221)
> [2021-06-22T10:43:55.118Z] at 
> hudson.Launcher$LocalLauncher.launch(Launcher.java:996)
> [2021-06-22T10:43:55.118Z] at 
> hudson.Launcher$ProcStarter.start(Launcher.java:508)
> [2021-06-22T10:43:55.118Z] at 
> hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1390)
> [2021-06-22T10:43:55.118Z] at 
> hudson.Launcher$RemoteLaunchCallable.call(Launcher.java:1333)
> [2021-06-22T10:43:55.118Z] at 
> hudson.remoting.UserRequest.perform(UserRequest.java:211)
> [2021-06-22T10:43:55.118Z] at 
> hudson.remoting.UserRequest.perform(UserRequest.java:54)
> [2021-06-22T10:43:55.118Z] at 
> hudson.remoting.Request$2.run(Request.java:376)
> [2021-06-22T10:43:55.118Z] at 
> hudson.remoting.InterceptingExecutorService.lambda$wrap$0(InterceptingExecutorService.java:78)
> [2021-06-22T10:43:55.118Z] at 
> java.util.concurrent.FutureTask.run(FutureTask.java:266)
> [2021-06-22T10:43:55.118Z] at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> [2021-06-22T10:43:55.118Z] at 
> 

Re: XML Job to DSL Job Plugin for Multibranch Pipeline

2021-03-22 Thread Ivan Fernandez Calvo
I have tested that plugin a couple of months ago, it works for simple jobs 
(freestyle, pipelines, ...) but I did not find a way to make it work with 
multibranch pipelines. Also, the support of JobDSL for multibranch 
pipelines is limited after 1.74, it is not possible to use configure blocks 
to configure the pull request discovery (see 
https://issues.jenkins.io/browse/JENKINS-63788)

El lunes, 22 de marzo de 2021 a las 10:29:37 UTC+1, sverr...@gmail.com 
escribió:

> I have tried out the XML Job to DSL Job Plugin.
>
> It lists all single Pipeline jobs under a Multibranch Pipeline job.
> It does not seem to be able to export the Multibranch Pipeline Job.
>
> The DSL Job Plugin does seem to support Multibranch Pipeline jobs.
>
> There is no open issues to suggest this is a bug, or missing feature.
>
> https://issues.jenkins.io/issues/?jql=project%20=%20JENKINS%20AND%20component%20=%20xml-job-to-job-dsl-plugin
>

-- 
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/5c28a42f-80b6-433f-85b8-a657b9661016n%40googlegroups.com.


Re: Automatically create initial admin user

2021-03-12 Thread Ivan Fernandez Calvo
you can use Jenkins Configuration as Code plugin 
(https://github.com/jenkinsci/configuration-as-code-plugin) to configure 
your security see the Matrix Authentication example  at 
https://github.com/jenkinsci/configuration-as-code-plugin/tree/master/demos/matrix-auth

El jueves, 11 de marzo de 2021 a las 16:21:19 UTC+1, jochen@gmail.com 
escribió:

>
> Hi,
>
> I am trying to set up a docker image, which should be ready to use. In 
> particular, I wouldn't want the image user to read the contents of the 
> initial_admin_password file from the Docker log or from the running 
> container. Instead, I would want something like "Read the initial admin 
> details from a file, which I specify be setting an environment variable." 
> Or, whatever works.
>
> How would you do that?
>
> Thanks,
>
> Jochen
>
>

-- 
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/9f2807a9-83c0-4d4e-8da9-bf392a28da14n%40googlegroups.com.


Re: jenkins and bash

2021-03-07 Thread Ivan Fernandez Calvo
A common issue is that you are not using the same shell, for example on 
Ubuntu by default is common to have installed *dash* as the default shell, 
this causes troubles when you use *bash only features*. A good practice is 
to set the first line to *"#!/bin/bash" *or *"#!/usr/bin/env bash"* and *set 
-exuo pipefail *(see 
https://vaneyckt.io/posts/safer_bash_scripts_with_set_euxo_pipefail/) as 
Amedee said. I am a fan of use pre-commit 
(https://pre-commit.com/index.html) to validate everything before 
committing to the repo; pre-commit has a hook to check scripts 
with shellcheck it is really helpful to avoid stupid mistakes and normalize 
the way all scripts are made.


El sábado, 6 de marzo de 2021 a las 20:30:10 UTC+1, amedee@gmail.com 
escribió:

> Put this as the first line in your shell scripts:
>
> #!/bin/bash -ex
>
> -e exits the script immediately if a command exits with a non-zero status.
> -x echos the current line in the script when it's executed.
>
> My best guess is that an error occurs in your script, which is silently 
> ignored by Bash, but at the end of the script you still have a non-zero 
> status.
> Jenkins checks for that non-zero status and fails.
>
>
> Secondly, verify your scripts with https://www.shellcheck.net/
> You can use ShellCheck online, install it on your local machine, and even 
> integrate it with most major editors.
> Make sure that ShellCheck says "No issues detected!"
>
>
> Without actually seeing the code of your shell scripts, it's at this point 
> not possible to give you any further debugging tips.
>
> Hope this helps!
>
> -- 
> Amedee
> On Friday, March 5, 2021 at 6:12:03 PM UTC+1 gil.j...@gmail.com wrote:
>
>> I have set up several jenkins jobs that do nothing more than execute bas 
>> scripts, howevwe The bash scripts run fine and complete with no errors in 
>> the but jenkins runs and gets errors is there a right way to debug this?
>
>

-- 
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/f11f6914-a806-4db3-a7f6-ce6fae4d49b8n%40googlegroups.com.


Re: Multibranch Pipeline git events on PR

2021-02-15 Thread Ivan Fernandez Calvo
Check if you have set git references on the job, IIRC the git plugin always 
make a `git fetch —all`

El lunes, 15 de febrero de 2021 a las 10:49:21 UTC+1, Rishi Gautam escribió:

> anyone has any idea please
>
> On Wed, Feb 10, 2021 at 4:16 PM Gautam, Rishi  
> wrote:
>
>> I was trying to carry out git operations on *any other branch *than the 
>> PR source/destination branch in a jenkins multibranch pipeline.
>> When I scanned the branches inside the PR build job, I didn't see any 
>> other branches. I only got below branches on* git branch -a *command on 
>> pipeline:
>>
>> * PR-2
>>   remotes/origin/PR-2
>>   remotes/upstream/stage
>>
>>
>> There are other branches like test,master. Are there any workarounds to this?
>>
>>

-- 
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/691d1a51-5ae2-4004-8e56-7c3fa3f6a17an%40googlegroups.com.


Re: Jenkins Upgrade 2.235.1 to 2.263.3 All Nodes Can't Connect

2021-02-15 Thread Ivan Fernandez Calvo
Remember that JNLP agents do not update the remoting jar if are not 
configured to do that, on Jenkins Core 2.248 there is a change on the 
remoting version, I bet you can bump the version to 2.247 without issues. 
To upgrade to 2.248+ you would need to upgrade the remoting jar on the JNLP 
agents.

El lunes, 15 de febrero de 2021 a las 18:21:04 UTC+1, mj1414...@gmail.com 
escribió:

> Hello,
>
> although I found nothing in the LTS upgrade guide... Did you get the 
> current slave.jar from the new master ?
> Otherwise you might have a compatibility issue between new master and old 
> slaves,
>
> Regards
>
> Martin
>
> Minimos schrieb am Montag, 15. Februar 2021 um 14:30:53 UTC+1:
>
>> So I rolled the version back and the issue has gone away.
>>
>> I will need to do a incremental upgrade of the WAR to find out which 
>> version breaks the functionality
>>
>> On Friday, 12 February 2021 at 15:13:30 UTC Minimos wrote:
>>
>>>
>>> Thanks I'll take a look at the information.
>>>
>>> I am using .Net 4.5 so should not be an issue, but there is an 
>>> interesting point re JNLP.
>>>
>>> I'll go through the document and double check everything.
>>>
>>> In the meantime do others have any other pointers?
>>> On Friday, 12 February 2021 at 14:55:58 UTC Mark Waite wrote:
>>>
 The Jenkins 2.249.1 upgrade guide notes that Microsot.NET 2.0 support 
 has been removed.  See 
 https://www.jenkins.io/doc/upgrade-guide/2.249/#upgrading-to-jenkins-lts-2-249-1
  
 in case that affects your installation.

 On Fri, Feb 12, 2021 at 7:49 AM 'Minimos' via Jenkins Users <
 jenkins...@googlegroups.com> wrote:

> Hi,
>
> We recently updated Jenkins as per the subject line on our Windows 
> boxes
>
> All plugins were updated at the same time, however we can no longer 
> get our nods to communicate with the master.
>
> A Java Io exception of Connection time Out is displayed.  There have 
> been no changes to our firewall or network.
>
> I can see that a connecting is established via NetStat with a port 
> being opened on both boxes.
>
> Has any one else experienced this problem?
>
> Thanks
>
>
> -- 
> 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-use...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/3f02999b-fbb4-4c82-92a8-e96bc9a05967n%40googlegroups.com
>  
> 
> .
>


-- 
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/518c8893-c3e8-4d79-ba87-67c888ff7002n%40googlegroups.com.


Re: Issue with master-agent communication over ssh

2021-02-02 Thread Ivan Fernandez Calvo
>I have 2 different kind of jenkins agents.
>1. java web start
>2. ssh
>If the memory was issue then wouldn't it fail on both cases?

Not necessarily, starting by the point that are different ways to establish 
the connection, the JNLP agents could not update the remoting jar file 
(depends on your configurations), so you can be running different versions 
of remoting. I agree with Jeff looks like an OOM issue, review my comments 
at https://groups.google.com/g/jenkinsci-users/c/nD3s06hSUXE/m/BQKk5GSYBwAJ 
my recommendation is to fix the mem for the remoting process to 1024M 
(-Xmx1024m -Xms1024m) see if the issue disappear or change, if disappear, 
you would have to adjust the remoting process memory to the right one 
between 256M-1024M, to use 512M usually is safe a not too much (but depends 
on your agents' memory we do not know how much they have)

El lunes, 1 de febrero de 2021 a las 23:52:19 UTC+1, jigarra...@gmail.com 
escribió:

> On Monday, January 4, 2021 at 12:37:52 PM UTC-5 jtho...@cloudbees.com 
> wrote:
>
>> When I saw something like this in the past, it was because the process 
>> was running out of resources. Specifically when running SpotBugs, I got 
>> out-of-memory errors. I had to modify the pom to allocate more memory.
>>
> I have 2 different kind of jenkins agents.
> 1. java web start
> 2. ssh
> If the memory was issue then wouldn't it fail on both cases? 
>
> I do see "Agent went offline during build Connection was broker: 
> java.io.StreamCorruptedException: invalid stream header:".
>
>> I recommend ensuring your build runs normally on the agent without the 
>> additional complexities of the Jenkins environment. This might show where 
>> additional resources are needed. If that all passes, then continue on to 
>> the additional troubleshooting steps involving the Jenkins controller and 
>> agent.
>>
>> Jeff Thompson
>> On 12/30/20 3:40 PM, jiga...@gmail.com wrote:
>>
>> Interestingly, whenever Jenkins agent is executing PMD/Findbugs task, it 
>> runs into " Resource temporarily unavailable".  
>> I have
>>
>>- verified TCP parameters 
>>i.e. tcp_keepalive_time, tcp_keepalive_intvl, tcp_keepalive_probes 
>>& tcp_fin_timeout ; All of them have higher values then what cloudbees 
>>recommended at 
>>
>> https://support.cloudbees.com/hc/en-us/articles/115001369667-dedicated-SSH-agents-formerly-slaves-get-disconnected
>>  
>>- set heap space to 2-4Gb
>>- disabled ping thread from Jenkins agent by setting 
>>"-Dhudson.remoting.Launcher.pingIntervalSec=-1"
>>
>> Please let me know if there is anything else I should consider.
>> On Friday, December 11, 2020 at 12:11:39 PM UTC-5 kuisat...@gmail.com 
>> wrote:
>>
>>> The most common issue is related to disconnections because there is no 
>>> traffic between the Jenkins instance and the agent, for that, you have to 
>>> tune the TCP stack of your OS (see 
>>> https://support.cloudbees.com/hc/en-us/articles/115001369667-dedicated-SSH-agents-formerly-slaves-get-disconnected),
>>>  
>>> or enable the keepalive option in the SSH protocol this can be configured 
>>> by setting ClientAliveInterval or TCPKeepAlive on the SSH server 
>>> (/etc/ssh/sshd_config), also by setting ServerAliveInterval or TCPKeepAlive 
>>> options for the user connection (/etc/ssh/ssh_config or ~/.ssh/ssh_config)
>>>
>>> https://www.freebsd.org/cgi/man.cgi?sshd_config(5)
>>> https://www.freebsd.org/cgi/man.cgi?ssh_config(5)
>>>
>>> Also, check you follow the best practices to configure your SSH agents 
>>> and enable SSH verbose log output in your service (see 
>>> https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/TROUBLESHOOTING.md
>>> )
>>>
>>> El miércoles, 9 de diciembre de 2020 a las 17:53:19 UTC+1, 
>>> jiga...@gmail.com escribió:
>>>
 Hello Jenkins community,  

 I have setup Jenkins agents over SSH and this agent frequently goes 
 offline with Resource temporarily unavailable error. I had to configure my 
 Jenkins agents to communicate over JNLP. Any advise on how to fix this 
 issue?

 Jenkins v2.249.1

 [12/04/20 15:23:00] [SSH] Checking java version of java
 [12/04/20 15:23:01] [SSH] java -version returned 1.8.0_202.
 [12/04/20 15:23:01] [SSH] Starting sftp client.
 [12/04/20 15:23:03] [SSH] Remote file system root $JENKINS_SSH_DATA 
 does not exist. Will try to create it...
 [12/04/20 15:23:03] [SSH] Copying latest remoting.jar...
 [12/04/20 15:23:03] [SSH] Copied 1,521,553 bytes.
 Expanded the channel window size to 4MB
 [12/04/20 15:23:03] [SSH] Starting agent process: cd 
 "$JENKINS_SSH_DATA" && java  -jar remoting.jar -workDir $JENKINS_SSH_DATA 
 -jar-cache $JENKINS_SSH_DATA/remoting/jarCache
 Dec 04, 2020 3:23:29 PM org.jenkinsci.remoting.engine.WorkDirManager 
 initializeWorkDir
 INFO: Using $JENKINS_SSH_DATA/remoting as a remoting work directory
 Dec 04, 2020 3:23:29 PM 

Re: run jenkins pipeline fails "docker": error=2, No such file or directory

2021-01-28 Thread Ivan Fernandez Calvo
If you are running Jenkins ins a Docker container with the official Docker 
container, the docker CLI command is not installed and that's your error, 
you need the docker CLI installed to access a Docker Host. One trick can be 
to mount the binary of the Docker Host where you are running that Jenkins 
and the Docker socket, but this configuration is for local testing never 
for a production environment. Something like this

docker run -it -v $(command -v docker):/usr/bin/docker -v 
/var/run/docker.sock:/var/run/docker.sock jenkins:lts


El jueves, 28 de enero de 2021 a las 11:59:06 UTC+1, anilkuma...@gmail.com 
escribió:

> Hi,
> I have Jenkins running as docker container and in my Jenkins File , in 
> initialize stage i have following which is working also , i have installed 
> docker from Docker hub latest. Not sure where is the problem . Pipeline is 
> failing with the following.
>
> ava.io.IOException: error=2, No such file or directory 
>
>
> 
>  
> at java.lang.UNIXProcess.forkAndExec(Native Method) 
>
>
> 
>  
> at java.lang.UNIXProcess.(UNIXProcess.java:247) 
>
>
> 
>  
> at java.lang.ProcessImpl.start(ProcessImpl.java:134) 
>
>
> 
>  
> at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) 
>
>
> Caused:
>  
> java.io.IOException: Cannot run program "docker": error=2, No such file or 
> directory 
>
>
> 
>  
> at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) 
>
>
> 
>  
> at hudson.Proc$LocalProc.(Proc.java:250) 
>
>
> 
>  
> at hudson.Proc$LocalProc.(Proc.java:219) 
>
>
> 
>  
> at hudson.Launcher$LocalLauncher.launch(Launcher.java:936) 
>
>
> 
>  
> at hudson.Launcher$ProcStarter.start(Launcher.java:454) 
>
>
> 
>  
> at hudson.Launcher$ProcStarter.join(Launcher.java:465) 
>
>
> 
>  
> at 
> org.jenkinsci.plugins.docker.commons.impl.RegistryKeyMaterialFactory.materialize(RegistryKeyMaterialFactory.java:101)
>  
>
>
>
> 
>  
> at 
> org.jenkinsci.plugins.docker.workflow.AbstractEndpointStepExecution2.doStart(AbstractEndpointStepExecution2.java:53)
>  
>
>
>
> 
>  
> at 
> org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)
>  
>
>
>
> 
>  
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) 
>
>
> 
>  
> at java.util.concurrent.FutureTask.run(FutureTask.java:266) 
>
>
> 
>  
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>  
>
>
>
> 
>  
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>  
>
>
>
> 
>  
> at java.lang.Thread.run(Thread.java:748)
>
>
> On Monday, 27 November 2017 at 01:21:50 UTC+5:30 lynn.x...@gmail.com 
> wrote:
>
>>
>> Oleg Nenashev 

Re: SSH connection issue with Host Key Verification Strategy

2021-01-13 Thread Ivan Fernandez Calvo
>* Is Manually trusted key Verification Strategy, without "Require manual 
verification of initial connection", more secure than Non verifying 
Verification Strategy

Any verification strategy is more secure than none

>What are the downsides of Manually trusted key Verification Strategy?

You have to manually accept the key on the UI or check the auto accept in 
the first connection

>How come Manually provided key Verification Strategy didn't work?

I do not have enough data, but this configuration should work, I you think 
that can be and issue you could open and issue in Jira and I’ll take a look 
(see 
https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/TROUBLESHOOTING.md#common-info-needed-to-troubleshooting-a-bug
)

For more info check the documentation
https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/CONFIGURE.md#host-key-verification-strategy

I will recommend you to use JCasC to inject the config, in this repo you 
have an example 
https://github.com/kuisathaverat/jenkins-issues/tree/master/kex-algorithms

El miércoles, 13 de enero de 2021 a las 3:13:58 UTC+1, amedee@gmail.com 
escribió:

> Current Host Key Verification Strategy is Non Verifying Verification 
> Strategy.
> This works, but is not secure.
>
> The agent is created using Packer, and Ansible as provisioner, and then 
> started with Terraform.
>
> This Ansible playbook uploads the files id_ed25519 and id_ed25519.pub to 
> the .ssh directory of user jenkins.
>
> ---
>
> - name: Add the user 'jenkins'
> user:
> name: jenkins
> create_home: yes
> home: /home/jenkins
>
> - name: Copy SSH keys
> copy:
> src: ./files/.ssh
> dest: /home/jenkins/
> owner: jenkins
> mode: 0600
>
> - name: Set permissions on private key
> file:
> path: /home/jenkins/.ssh/id_ed25519
> mode: 0400
>
> - name: Set authorized key taken from file
> ansible.posix.authorized_key:
> user: jenkins
> key: "{{ lookup('file', './files/.ssh/id_ed25519.pub') }}"
> state: present
> exclusive: True
>
>
> In Jenkins, Manage Jenkins, Manage Credentials I have added a "SSH 
> Username with private key". In the field Private Key I have put the content 
> of id_ed25519.
>
> In Jenkins, Manage Jenkins, Manage Nodes I have added a node:
> * Launch agents via SSH
> * Host: DNS name I get from Terraform or AWS console
> * Credentials: the SSH username + private key from the previous step
> * Host Key Verification Strategy:
> --> Non verifying: works, but is not secure
> --> Known hosts file: I have no access to files on the server, so I cannot 
> use this
> --> Manually provided key: I paste the contents of id_ed25519.pub. Results 
> in WARNING: The SSH key for this host does not match the key required in 
> the connection configuration. Connections will be denied until the host key 
> matches the configuration key. Key exchange was not finished, connection is 
> closed.
> --> Manually trusted key: works, but couldn't I theoretically have a 
> man-in-the-middle attack on the very first connection of a new node?
>
> My questions are:
> * Is Manually trusted key Verification Strategy, without "Require manual 
> verification of initial connection", more secure than Non verifying 
> Verification Strategy?
> * What are the downsides of Manually trusted key Verification Strategy?
> * How come Manually provided key Verification Strategy didn't work?
>

-- 
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/c5ccbda7-2ea3-41aa-aac3-f2391b98d287n%40googlegroups.com.


Re: Pipeline DSL using a shared lib which is a java class

2021-01-08 Thread Ivan Fernandez Calvo
If a class is in the classpath, you can use it on a Pipeline Step or in a 
groovy class (the example), then you can use that step(or groovy class) in 
your pipeline. So instead of trying to load a jar file in runtime you can 
put the jar in the classpath of your Jenkins instance and wrap the class 
ina step (or groovy class)

El viernes, 8 de enero de 2021 a las 8:04:09 UTC+1, cmou...@redhat.com 
escribió:

> Many thanks Ivan for the example which is a Groovy class and not a java 
> class. According to the documentation, I don't think that we can use some 
> java classes directly from a shared lib project excepted if thy have been 
> compiled, packaged as jar under a maven repository and that you import it 
> using "@Grab" - 
> https://www.jenkins.io/doc/book/pipeline/shared-libraries/#using-third-party-libraries
>
>
>
> On Thu, Jan 7, 2021 at 6:02 PM Ivan Fernandez Calvo  
> wrote:
>
>> you can use directly a class from the Shared library
>>
>> This is an example in our shared library (
>> https://github.com/elastic/apm-pipeline-library)
>>
>> https://github.com/elastic/apm-pipeline-library/blob/master/src/co/elastic/matrix/DefaultParallelTaskGenerator.groovy
>>
>> and a pipeline that uses that class
>>
>> https://github.com/elastic/apm-integration-testing/blob/master/.ci/integrationTestDownstream.groovy#L89
>>
>> El miércoles, 6 de enero de 2021 a las 18:23:12 UTC+1, cmou...@redhat.com 
>> escribió:
>>
>>> Hi,
>>>
>>> Can we define a pipeline DSL script importing a shared lib which is a 
>>> java class ?
>>>
>>> Script
>>> @org.jenkinsci.plugins.workflow.libs.Library('mytools')
>>>
>>> import org.mytools.Messaging // The Java class imported as shared lib 
>>> Messaging m = new Messaging();
>>>
>>> The java class has been defined under the folder 
>>> `src/main/org/mytools/Messaging.java` within the git project cloned as 
>>> shared lib
>>>
>>> Cheers
>>>
>>> Charles
>>>
>> -- 
>> 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-use...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/1216e835-5752-482f-b887-565bc4cc7194n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/1216e835-5752-482f-b887-565bc4cc7194n%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/ea644d78-cd3d-4ebc-aa68-6dd1f379ae21n%40googlegroups.com.


Re: Pipeline DSL using a shared lib which is a java class

2021-01-07 Thread Ivan Fernandez Calvo
you can use directly a class from the Shared library

This is an example in our shared library 
(https://github.com/elastic/apm-pipeline-library)
https://github.com/elastic/apm-pipeline-library/blob/master/src/co/elastic/matrix/DefaultParallelTaskGenerator.groovy

and a pipeline that uses that class
https://github.com/elastic/apm-integration-testing/blob/master/.ci/integrationTestDownstream.groovy#L89

El miércoles, 6 de enero de 2021 a las 18:23:12 UTC+1, cmou...@redhat.com 
escribió:

> Hi,
>
> Can we define a pipeline DSL script importing a shared lib which is a java 
> class ?
>
> Script
> @org.jenkinsci.plugins.workflow.libs.Library('mytools')
>
> import org.mytools.Messaging // The Java class imported as shared lib 
> Messaging m = new Messaging();
>
> The java class has been defined under the folder 
> `src/main/org/mytools/Messaging.java` within the git project cloned as 
> shared lib
>
> Cheers
>
> Charles
>

-- 
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/1216e835-5752-482f-b887-565bc4cc7194n%40googlegroups.com.


Re: All jobs disappeared from view

2021-01-02 Thread Ivan Fernandez Calvo
Did you check the logs? I bet you have an exception related to one or more 
plugins not loaded correctly

El sábado, 2 de enero de 2021 a las 4:22:33 UTC+1, dma...@gmail.com 
escribió:

> Yes, I had tried that, numerous times.  (All the jobs data is there).  I 
> even restored a backup done earlier today when everything was fine.  No 
> luck.  HOWEVER, I just downloaded a newer jenkins.war (2.263) , and 
> then restarted jenkins, and the jobs all reappeared.  *Perhaps this will 
> help someone else*.
>
> On Friday, January 1, 2021 at 10:19:55 PM UTC-5 jaychandran...@gmail.com 
> wrote:
>
>> Pls check what is there in /var/lib/jenkins/jobs folder if all jobs 
>> present in this folder just restart Jenkins service
>>
>> On Sat, 2 Jan 2021, 8:37 am David Maul,  wrote:
>>
>>> All of a sudden my jobs have all disappeared from the :8080 web page.  
>>> They are very much there on disk. I have tried reloading configuration from 
>>> disk - no luck.  I have tried restoring /var/lib/jenkins entirely from a 
>>> backup, still no luck.  Nothing seems to help.  I am only greeted with:
>>>
>>> "This view has no jobs associated with it. You can either add some 
>>> existing jobs  to this view or create a new 
>>> job  in this view." 
>>>
>>> I know all of my job data is there, but I cannot figure out why jenkins 
>>> will not show it to me.
>>>
>>> I am running 2.150.3 on Centos7.  Usually has been very good.  This is 
>>> kind of a crisis.
>>>
>>> Thanks in advance for help, and Happy New year. 
>>>
>>> -- 
>>> 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-use...@googlegroups.com.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/jenkinsci-users/c677f342-2873-4e40-aa84-22077b9262dbn%40googlegroups.com
>>>  
>>> 
>>> .
>>>
>>

-- 
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/175301f5-7dd6-448c-ad5b-1b7c3019f7c0n%40googlegroups.com.


Re: Issue with master-agent communication over ssh

2021-01-01 Thread Ivan Fernandez Calvo
If the agent is running something there is traffic, so it si not related to 
keep alive settings, I wonder if after the issue happens there is a 
remoting process running on the agent.
Did you check the SSHD service logs on your agent? 
https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/TROUBLESHOOTING.md#enable-verbose-ssh-server-log-output
Did you check the remoting logs? 
https://github.com/jenkinsci/remoting/blob/master/docs/logging.md
Did you check for hs_err_pid error files in the root fs of the agent? 
http://www.oracle.com/technetwork/java/javase/felog-138657.html#gbwcy
How much memory you set for your remoting process?
How much memory your maven build needs?

El miércoles, 30 de diciembre de 2020 a las 23:40:38 UTC+1, 
jiga...@gmail.com escribió:

> Interestingly, whenever Jenkins agent is executing PMD/Findbugs task, it 
> runs into " Resource temporarily unavailable". 
> I have
>
>- verified TCP parameters 
>i.e. tcp_keepalive_time, tcp_keepalive_intvl, tcp_keepalive_probes 
>& tcp_fin_timeout ; All of them have higher values then what cloudbees 
>recommended at 
>
> https://support.cloudbees.com/hc/en-us/articles/115001369667-dedicated-SSH-agents-formerly-slaves-get-disconnected
>- set heap space to 2-4Gb
>- disabled ping thread from Jenkins agent by setting 
>"-Dhudson.remoting.Launcher.pingIntervalSec=-1"
>
> Please let me know if there is anything else I should consider.
> On Friday, December 11, 2020 at 12:11:39 PM UTC-5 kuisat...@gmail.com 
> wrote:
>
>> The most common issue is related to disconnections because there is no 
>> traffic between the Jenkins instance and the agent, for that, you have to 
>> tune the TCP stack of your OS (see 
>> https://support.cloudbees.com/hc/en-us/articles/115001369667-dedicated-SSH-agents-formerly-slaves-get-disconnected),
>>  
>> or enable the keepalive option in the SSH protocol this can be configured 
>> by setting ClientAliveInterval or TCPKeepAlive on the SSH server 
>> (/etc/ssh/sshd_config), also by setting ServerAliveInterval or TCPKeepAlive 
>> options for the user connection (/etc/ssh/ssh_config or ~/.ssh/ssh_config)
>>
>> https://www.freebsd.org/cgi/man.cgi?sshd_config(5)
>> https://www.freebsd.org/cgi/man.cgi?ssh_config(5)
>>
>> Also, check you follow the best practices to configure your SSH agents 
>> and enable SSH verbose log output in your service (see 
>> https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/TROUBLESHOOTING.md
>> )
>>
>> El miércoles, 9 de diciembre de 2020 a las 17:53:19 UTC+1, 
>> jiga...@gmail.com escribió:
>>
>>> Hello Jenkins community, 
>>>
>>> I have setup Jenkins agents over SSH and this agent frequently goes 
>>> offline with Resource temporarily unavailable error. I had to configure my 
>>> Jenkins agents to communicate over JNLP. Any advise on how to fix this 
>>> issue?
>>>
>>> Jenkins v2.249.1
>>>
>>> [12/04/20 15:23:00] [SSH] Checking java version of java
>>> [12/04/20 15:23:01] [SSH] java -version returned 1.8.0_202.
>>> [12/04/20 15:23:01] [SSH] Starting sftp client.
>>> [12/04/20 15:23:03] [SSH] Remote file system root $JENKINS_SSH_DATA does 
>>> not exist. Will try to create it...
>>> [12/04/20 15:23:03] [SSH] Copying latest remoting.jar...
>>> [12/04/20 15:23:03] [SSH] Copied 1,521,553 bytes.
>>> Expanded the channel window size to 4MB
>>> [12/04/20 15:23:03] [SSH] Starting agent process: cd "$JENKINS_SSH_DATA" 
>>> && java  -jar remoting.jar -workDir $JENKINS_SSH_DATA -jar-cache 
>>> $JENKINS_SSH_DATA/remoting/jarCache
>>> Dec 04, 2020 3:23:29 PM org.jenkinsci.remoting.engine.WorkDirManager 
>>> initializeWorkDir
>>> INFO: Using $JENKINS_SSH_DATA/remoting as a remoting work directory
>>> Dec 04, 2020 3:23:29 PM org.jenkinsci.remoting.engine.WorkDirManager 
>>> setupLogging
>>> INFO: Both error and output logs will be printed to 
>>> $JENKINS_SSH_DATA/remoting
>>> <===[JENKINS REMOTING CAPACITY]===>channel started
>>> Remoting version: 4.5
>>> This is a Unix agent
>>> Evacuated stdout
>>> Agent successfully connected and online
>>> The Agent is connected, disconnect it before to try to connect it again.
>>> Dec 04, 2020 3:33:58 PM org.eclipse.jgit.util.FS discoverGitSystemConfig
>>> WARNING: Exception caught during execution of command '[git, config, 
>>> --system, --edit]' in '$GIT_PATH/bin', return code '128', error message 
>>> 'fatal: Invalid path '$GIT_PATH/etc': No such file or directory
>>> '
>>> Dec 04, 2020 3:33:58 PM org.eclipse.jgit.util.FS$FileStoreAttributes 
>>> saveToConfig
>>> WARNING: locking FileBasedConfig[$JENKINS_PATH/.config/jgit/config] 
>>> failed after 5 retries
>>> Dec 04, 2020 3:33:59 PM 
>>> org.jenkinsci.remoting.util.AnonymousClassWarnings warn
>>> WARNING: Attempt to (de-)serialize anonymous class 
>>> com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser$1;
>>>  
>>> see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
>>> Dec 04, 2020 3:34:24 PM 

Re: github issues

2020-12-24 Thread Ivan Fernandez Calvo
We overwrote the checkout step in our pipeline shared library to introduce 
retires and a delay between retries, this is the step

https://github.com/elastic/apm-pipeline-library/blob/master/vars/checkout.groovy

El jueves, 24 de diciembre de 2020 a las 14:55:35 UTC+1, unli...@gmail.com 
escribió:

> Hello, Jenkins community!
>
> Pipelines started to crash when trying to clone from github due to 
> networking issues. Restarting the Pipeline solves the problem. What are the 
> ways to increase the number of attempts or time to clone from github 
> (plugins, configs...) ?
>
> Error code:
> fatal: unable to access 'https://github.com/enterpr/mygit.git/': TCP 
> connection reset by peer
>
> The second problem that occurs sometimes:
> "ERROR: Maximum checkout retry attempts reached, aborting"
>
> I would be grateful for sharing experience in solving these problems with 
> github. Thank you.
>
> Happy New Year!
>

-- 
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/8f718485-3d43-4b7c-b19c-522284f1885en%40googlegroups.com.


Re: jenkins_home, docker, upgrades

2020-12-12 Thread Ivan Fernandez Calvo


El lunes, 7 de diciembre de 2020 a las 16:12:10 UTC+1, ewel...@gmail.com 
escribió:

>
> Hi!
>
> I am using Jenkins in Docker and I map a folder from local machine to the 
> container's /var/jenkins_home to preserve JENKINS_HOME.
>
> There are two things I am wondering about, and maybe you can comment:
>
> 1. Can new Jenkins corrupt existing JENKINS_HOME?
> Let's assume I have Jenkins in version X running, I want to upgrade so I 
> have built new image, with Jenkins version Y, same plugins - maybe updated 
> during the image build
>
> Is it possible that when I restart Jenkins with new image with version Y, 
> the existing JENKINS_HOME won't be compatible with new version? 
> Is it possible that after restart JENKINS_HOME will be changed in a way 
> that it won't be possible to use it again with version X - if I want to 
> rollback for whatever reason?
>
>
It depends of your plugins installed, so it is possible you screw up your 
Jenkins Home if you do not test your upgrade in a test instance, it is not 
common but it could happens, thus is recommended to clone your Jenkins home 
folder and test the upgrade before to make it on production. Also, take a 
backup before to make the upgrade is mandatory. Rollback is not supported, 
even though it could work, it is better to restore the backup form the 
previous version.
 

> 2. What happens when two instances share JENKINS_HOME?
> I want to have a simple test environment - let's not discuss now if it's a 
> good or bad approach :) - so next to a working Jenkins container I start 
> another one in a quiet mode (no job will start), with a new image I want to 
> try out
> The first idea is to copy original JENKINS_HOME and use this copy, but 
> what if the home is very big and I do not have much space - how bad would 
> running second Jenkins with JENKINS_HOME mapped to the same folder on a 
> local host would be? (I haven't considered that option, but I was asked 
> 'why')
>
> I know I can just run it and check, but I think there might be plenty of 
> different cases that I will not see in my simple test, but maybe some of 
> you have more experience or ran into issues before
>
>
Really bad idea, Jenkins keep changes in memory and write them to disk, so 
if you have two instances running in the same Jenkins home and you change a 
job in one of them the other does not know anything about his change, the 
configuration is not read from disk on runtime, most of the configuration 
is only read at start time and keep updated in memory. So two instances 
running on the same Jenkins home is a random behaviour environment.

 

> BR
> Ewelina
>

-- 
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/96f78cfb-6811-410f-ba76-0f094f875980n%40googlegroups.com.


Re: Issue with master-agent communication over ssh

2020-12-11 Thread Ivan Fernandez Calvo
The most common issue is related to disconnections because there is no 
traffic between the Jenkins instance and the agent, for that, you have to 
tune the TCP stack of your OS (see 
https://support.cloudbees.com/hc/en-us/articles/115001369667-dedicated-SSH-agents-formerly-slaves-get-disconnected),
 
or enable the keepalive option in the SSH protocol this can be configured 
by setting ClientAliveInterval or TCPKeepAlive on the SSH server 
(/etc/ssh/sshd_config), also by setting ServerAliveInterval or TCPKeepAlive 
options for the user connection (/etc/ssh/ssh_config or ~/.ssh/ssh_config)

https://www.freebsd.org/cgi/man.cgi?sshd_config(5)
https://www.freebsd.org/cgi/man.cgi?ssh_config(5)

Also, check you follow the best practices to configure your SSH agents and 
enable SSH verbose log output in your service (see 
https://github.com/jenkinsci/ssh-slaves-plugin/blob/master/doc/TROUBLESHOOTING.md)

El miércoles, 9 de diciembre de 2020 a las 17:53:19 UTC+1, 
jiga...@gmail.com escribió:

> Hello Jenkins community, 
>
> I have setup Jenkins agents over SSH and this agent frequently goes 
> offline with Resource temporarily unavailable error. I had to configure my 
> Jenkins agents to communicate over JNLP. Any advise on how to fix this 
> issue?
>
> Jenkins v2.249.1
>
> [12/04/20 15:23:00] [SSH] Checking java version of java
> [12/04/20 15:23:01] [SSH] java -version returned 1.8.0_202.
> [12/04/20 15:23:01] [SSH] Starting sftp client.
> [12/04/20 15:23:03] [SSH] Remote file system root $JENKINS_SSH_DATA does 
> not exist. Will try to create it...
> [12/04/20 15:23:03] [SSH] Copying latest remoting.jar...
> [12/04/20 15:23:03] [SSH] Copied 1,521,553 bytes.
> Expanded the channel window size to 4MB
> [12/04/20 15:23:03] [SSH] Starting agent process: cd "$JENKINS_SSH_DATA" 
> && java  -jar remoting.jar -workDir $JENKINS_SSH_DATA -jar-cache 
> $JENKINS_SSH_DATA/remoting/jarCache
> Dec 04, 2020 3:23:29 PM org.jenkinsci.remoting.engine.WorkDirManager 
> initializeWorkDir
> INFO: Using $JENKINS_SSH_DATA/remoting as a remoting work directory
> Dec 04, 2020 3:23:29 PM org.jenkinsci.remoting.engine.WorkDirManager 
> setupLogging
> INFO: Both error and output logs will be printed to 
> $JENKINS_SSH_DATA/remoting
> <===[JENKINS REMOTING CAPACITY]===>channel started
> Remoting version: 4.5
> This is a Unix agent
> Evacuated stdout
> Agent successfully connected and online
> The Agent is connected, disconnect it before to try to connect it again.
> Dec 04, 2020 3:33:58 PM org.eclipse.jgit.util.FS discoverGitSystemConfig
> WARNING: Exception caught during execution of command '[git, config, 
> --system, --edit]' in '$GIT_PATH/bin', return code '128', error message 
> 'fatal: Invalid path '$GIT_PATH/etc': No such file or directory
> '
> Dec 04, 2020 3:33:58 PM org.eclipse.jgit.util.FS$FileStoreAttributes 
> saveToConfig
> WARNING: locking FileBasedConfig[$JENKINS_PATH/.config/jgit/config] failed 
> after 5 retries
> Dec 04, 2020 3:33:59 PM org.jenkinsci.remoting.util.AnonymousClassWarnings 
> warn
> WARNING: Attempt to (de-)serialize anonymous class 
> com.sonyericsson.hudson.plugins.gerrit.trigger.hudsontrigger.GerritTriggerBuildChooser$1;
>  
> see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
> Dec 04, 2020 3:34:24 PM hudson.remoting.Request$2 run
> WARNING: Failed to send back a reply to the request 
> hudson.remoting.Request$2@493c5a4e
> java.io.IOException: Resource temporarily unavailable
> at java.io.FileOutputStream.writeBytes(Native Method)
> at java.io.FileOutputStream.write(FileOutputStream.java:313)
> at 
> hudson.remoting.StandardOutputStream.write(StandardOutputStream.java:83)
> at 
> hudson.remoting.ChunkedOutputStream.sendFrame(ChunkedOutputStream.java:89)
> at 
> hudson.remoting.ChunkedOutputStream.sendBreak(ChunkedOutputStream.java:62)
> at 
> hudson.remoting.ChunkedCommandTransport.writeBlock(ChunkedCommandTransport.java:46)
> at 
> hudson.remoting.AbstractSynchronousByteArrayCommandTransport.write(AbstractSynchronousByteArrayCommandTransport.java:46)
> at hudson.remoting.Channel.send(Channel.java:766)
> at hudson.remoting.Request$2.run(Request.java:388)
> at 
> hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:73)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
>  
> Dec 04, 2020 5:25:30 PM hudson.remoting.Request$2 run
> WARNING: Failed to send back a reply to the request 
> hudson.remoting.Request$2@2511e2d4
> java.io.IOException: Resource temporarily unavailable
> at java.io.FileOutputStream.writeBytes(Native Method)
> at java.io.FileOutputStream.write(FileOutputStream.java:326)
> at 
> 

Re: Renew expired certificate for Jenkins SAML plugin

2020-11-13 Thread Ivan Fernandez Calvo
Yes, it is correct, you have to import the certificate you see in 
the JENKINS_HOME/saml-sp-metadata.xml file(or in the URL you marked in the 
screenshot) in your IdP

El viernes, 13 de noviembre de 2020 a las 21:05:07 UTC+1, 
david...@gmail.com escribió:

> Thanks all for the replies.
>
> I have generated a new JKS via the following command (had different 
> values):
>
> $JAVA_HOME/bin/keytool -genkeypair -alias saml-key -keypass  \
>   -keystore /path/to/saml-key.jks -storepass   \
>   -keyalg RSA -keysize 2048 -validity 3650
>
> I then pointed in Jenkins UI to the newly created JKS keystore, which it 
> identified correctly.
>
> I then selected "Auth Request Signature" and clicked on the following link 
> in Jenkins Security configuration:
>
> [image: image.png]
> This has generated a new XML file which has a new X509 certificate in it, 
> and I believe this should be used with an AD provider.
>
> Would this be a correct procedure?
>
> Thanks again.
>
> Kind regards,
> Igor
>
> On Sun, Nov 8, 2020 at 7:48 PM Ivan Fernandez Calvo  
> wrote:
>
>> the result is the same you have a private key and a certificate that you 
>> have to import in the Keystore,  This Keystore is the one you have to 
>> configure in the SAML plugin
>>
>> El domingo, 8 de noviembre de 2020 a las 20:26:50 UTC+1, 
>> david...@gmail.com escribió:
>>
>>> Thank you for reply. 
>>>
>>> If we are using encryption, does it means that typically when starting 
>>> with Jenkins SAML setup (e.g. ADFS) we are first creating certificate and 
>>> keypair via keytool (which will be stored in saml-jenkins-keystore.jks) and 
>>> then uploading it to ADFS, or are we first starting from ADFS side and 
>>> configuring metadata/keys/certificates on that side and uploading those to 
>>> Jenkins afterwards ? 
>>>
>>> Thanks again. 
>>>
>>> On Tuesday, November 3, 2020 at 5:17:35 PM UTC kuisat...@gmail.com 
>>> wrote:
>>>
>>>> This Keystore is automatically created if you do not configure 
>>>> encryption, the Pac4j needs a key to work even though you do not use 
>>>> encryption. So in general if you do not use sign or encryption in the SAML 
>>>> messages (not related to TLS) you do need to configure anything this file 
>>>> will be used only to make the library work, but your IdP will not request 
>>>> your certificate. If you use encryption, you should configure your own 
>>>> Keystore and manage the keys in there. 
>>>>
>>>> In the Documentation of the plugin you can found how to configure 
>>>> encryption and how this Keystore works.
>>>>
>>>> https://github.com/jenkinsci/saml-plugin/blob/master/doc/CONFIGURE.md
>>>>
>>>> *Encryption* - If your provider requires encryption or signing, you 
>>>> can specify the keystore details here that should be used. If you do not 
>>>> specify a keystore, the plugin would create one with a key that is valid 
>>>> for a year, this key would be recreate when it expires, by default the key 
>>>> is not exposed in the SP metadata if you do not enable signing.
>>>>
>>>>- *Keystore path* - The path to the keystore file created with the 
>>>>keygen command.
>>>>- *Key Alias* - The alias used in the -alias argument of the 
>>>>keytool< command.
>>>>- *Keystore password* - The password used in the -storepass 
>>>>argument of the keytool command.
>>>>- *Private Key password* - The password used in the -keypass 
>>>>argument of keytool.
>>>>- *Auth Request Signature* - Enable signature of the Redirect 
>>>>Binding Auth Request, If you enable it the encryption and signing key 
>>>> would 
>>>>available in the SP metadata file and URL 
>>>>(JENKINS_URL/securityRealm/metadata). The disable of signing auth 
>>>> request 
>>>>does not work with HTTP redirection binging, it only works for POST 
>>>> binding.
>>>>
>>>>
>>>> El martes, 3 de noviembre de 2020 a las 16:48:28 UTC+1, Igor David 
>>>> escribió:
>>>>
>>>>> Hello,
>>>>>
>>>>> What is the correct way to renew an expired certificate 
>>>>> (JENKINS_HOME/saml-jenkins-keystore.jks) which is used for SAML Plugin 
>>>>> please?
>>>>>
>>>>> https://github.com/jenkinsci/saml-plugin
>&g

Re: Renew expired certificate for Jenkins SAML plugin

2020-11-08 Thread Ivan Fernandez Calvo
the result is the same you have a private key and a certificate that you 
have to import in the Keystore,  This Keystore is the one you have to 
configure in the SAML plugin

El domingo, 8 de noviembre de 2020 a las 20:26:50 UTC+1, david...@gmail.com 
escribió:

> Thank you for reply. 
>
> If we are using encryption, does it means that typically when starting 
> with Jenkins SAML setup (e.g. ADFS) we are first creating certificate and 
> keypair via keytool (which will be stored in saml-jenkins-keystore.jks) and 
> then uploading it to ADFS, or are we first starting from ADFS side and 
> configuring metadata/keys/certificates on that side and uploading those to 
> Jenkins afterwards ? 
>
> Thanks again. 
>
> On Tuesday, November 3, 2020 at 5:17:35 PM UTC kuisat...@gmail.com wrote:
>
>> This Keystore is automatically created if you do not configure 
>> encryption, the Pac4j needs a key to work even though you do not use 
>> encryption. So in general if you do not use sign or encryption in the SAML 
>> messages (not related to TLS) you do need to configure anything this file 
>> will be used only to make the library work, but your IdP will not request 
>> your certificate. If you use encryption, you should configure your own 
>> Keystore and manage the keys in there. 
>>
>> In the Documentation of the plugin you can found how to configure 
>> encryption and how this Keystore works.
>>
>> https://github.com/jenkinsci/saml-plugin/blob/master/doc/CONFIGURE.md
>>
>> *Encryption* - If your provider requires encryption or signing, you can 
>> specify the keystore details here that should be used. If you do not 
>> specify a keystore, the plugin would create one with a key that is valid 
>> for a year, this key would be recreate when it expires, by default the key 
>> is not exposed in the SP metadata if you do not enable signing.
>>
>>- *Keystore path* - The path to the keystore file created with the 
>>keygen command.
>>- *Key Alias* - The alias used in the -alias argument of the keytool< 
>>command.
>>- *Keystore password* - The password used in the -storepass argument 
>>of the keytool command.
>>- *Private Key password* - The password used in the -keypass argument 
>>of keytool.
>>- *Auth Request Signature* - Enable signature of the Redirect Binding 
>>Auth Request, If you enable it the encryption and signing key would 
>>available in the SP metadata file and URL 
>>(JENKINS_URL/securityRealm/metadata). The disable of signing auth request 
>>does not work with HTTP redirection binging, it only works for POST 
>> binding.
>>
>>
>> El martes, 3 de noviembre de 2020 a las 16:48:28 UTC+1, Igor David 
>> escribió:
>>
>>> Hello,
>>>
>>> What is the correct way to renew an expired certificate 
>>> (JENKINS_HOME/saml-jenkins-keystore.jks) which is used for SAML Plugin 
>>> please?
>>>
>>> https://github.com/jenkinsci/saml-plugin
>>>
>>> In that process, what is the purpose of saml-jenkins-keystore.xml (e.g. 
>>> is it generated every time a new certificate is renewed or)?
>>>
>>> I have tried removing  JENKINS_HOME/saml-jenkins-keystore.jk, disabling 
>>> SAML plugin and re-enabling it again and I do see that it has generated new 
>>> certificate, but I am not sure if this is the correct way and what happens 
>>> with JENKINS_HOME/saml-jenkins-keystore.xml in that case? 
>>>
>>> Thanks in advance.
>>>
>>> Kind regards,
>>> Igor
>>>
>>

-- 
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/8498a077-3cbf-4e02-ba08-85d66a4036een%40googlegroups.com.


Re: Can HTML submit button trigger a Jenkins job ?

2020-11-03 Thread Ivan Fernandez Calvo
also, if your authentication is SAML, you will have to use an API Token to 
call the API. SAML delegate the authentication in your IdP so Jenkins does 
not process your User and Password only the TOKEN generated by your IdP. 

El lunes, 2 de noviembre de 2020 a las 18:17:00 UTC+1, 
jeremy@riftio.com escribió:

> simple answer is no. an href cannot include a headers directive or 
> anything else)
>
> It can be done using ajax -- 
> https://stackoverflow.com/questions/374885/can-i-change-the-headers-of-the-http-request-sent-by-the-browser
>  
>
> or you could build a proxy that did nothing but add that header. But if 
> you do that, you might as well allow anonymous users to start jobs and then 
> the header becomes superfluous (I think). 
>
> On Sunday, November 1, 2020 at 1:49:16 PM UTC-5 shif...@gmail.com wrote:
>
>> My HTML code is like below where i pass the crumb and try to trigger a 
>> Jenkins DSL job along with passing parameters:
>>
>> > action='https://localhost:8080/job/myjob1/buildWithParameters?paramone=myhost1-stop-myfolder
>>  -H Jenkins-Crumb:d863847724897hghjtg37684yh4j3y9847dsfhkuhd' 
>> method=POST>> value='START'/>
>>
>> On the browser i see the URL as:
>>
>> https://localhost:8080/job/myjob1/buildWithParameters?paramone=myhost1-stop-myfolder%20-H%20Jenkins-Crumb:d863847724897hghjtg37684yh4j3y9847dsfhkuhdI
>>
>> I frankly have no idea how can I pass the crumb using HTML submit button.
>>
>>
>> I had obtained my crumb from https://localhost:8080/crumbIssuer/api/xml
>>
>>
>> When i click on START button i get 
>>
>>
>> HTTP ERROR 403 No valid crumb was included in the request
>>
>>
>> My Jenkins has SAML based SSO for login and I would like the user 
>> triggering the START button to login with his credentials hence, I do 
>> not pass the credentials in the URL.
>>
>>
>> The job myjob1 is configured to be triggered remotely.
>>
>>
>> Also, I'm able to trigger the job using curl utility but not sure how-to 
>> using HTML button.
>>
>>
>> Can you please suggest how to get this to work?
>>
>

-- 
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/0bc457fd-4299-4fb7-8a0f-fb53a80175ebn%40googlegroups.com.


Re: Renew expired certificate for Jenkins SAML plugin

2020-11-03 Thread Ivan Fernandez Calvo
This Keystore is automatically created if you do not configure encryption, 
the Pac4j needs a key to work even though you do not use encryption. So in 
general if you do not use sign or encryption in the SAML messages (not 
related to TLS) you do need to configure anything this file will be used 
only to make the library work, but your IdP will not request your 
certificate. If you use encryption, you should configure your own Keystore 
and manage the keys in there. 

In the Documentation of the plugin you can found how to configure 
encryption and how this Keystore works.

https://github.com/jenkinsci/saml-plugin/blob/master/doc/CONFIGURE.md

*Encryption* - If your provider requires encryption or signing, you can 
specify the keystore details here that should be used. If you do not 
specify a keystore, the plugin would create one with a key that is valid 
for a year, this key would be recreate when it expires, by default the key 
is not exposed in the SP metadata if you do not enable signing.
   
   - *Keystore path* - The path to the keystore file created with the 
   keygen command.
   - *Key Alias* - The alias used in the -alias argument of the keytool< 
   command.
   - *Keystore password* - The password used in the -storepass argument of 
   the keytool command.
   - *Private Key password* - The password used in the -keypass argument of 
   keytool.
   - *Auth Request Signature* - Enable signature of the Redirect Binding 
   Auth Request, If you enable it the encryption and signing key would 
   available in the SP metadata file and URL 
   (JENKINS_URL/securityRealm/metadata). The disable of signing auth request 
   does not work with HTTP redirection binging, it only works for POST binding.


El martes, 3 de noviembre de 2020 a las 16:48:28 UTC+1, Igor David escribió:

> Hello,
>
> What is the correct way to renew an expired certificate 
> (JENKINS_HOME/saml-jenkins-keystore.jks) which is used for SAML Plugin 
> please?
>
> https://github.com/jenkinsci/saml-plugin
>
> In that process, what is the purpose of saml-jenkins-keystore.xml (e.g. is 
> it generated every time a new certificate is renewed or)?
>
> I have tried removing  JENKINS_HOME/saml-jenkins-keystore.jk, disabling 
> SAML plugin and re-enabling it again and I do see that it has generated new 
> certificate, but I am not sure if this is the correct way and what happens 
> with JENKINS_HOME/saml-jenkins-keystore.xml in that case? 
>
> Thanks in advance.
>
> Kind regards,
> Igor
>

-- 
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/e5490d2b-bf6d-47f1-8ed4-513f7e59772dn%40googlegroups.com.


Re: JNLP inbound Agent

2020-11-02 Thread Ivan Fernandez Calvo

El lunes, 2 de noviembre de 2020 a las 18:39:41 UTC+1, vit...@1-family.net 
escribió:

> Thanks Ivan for your response,
>
> I'm running Jenkins in a standalone mode, without any web server such as 
> Apache / Nginx in front of it,
> Jenkins is configured for TSL 8080,
> and I've configured the inbound agents fixed 8081 port, so I'm not 
> following what kind of port negotiation should be happening?
>
>
Basically, the remoting process connects to the HTTP/S port and the Jenkins 
instance return the inboud port to connect, if you want to know more 
see 
https://docs.oracle.com/javase/tutorial/deployment/deploymentInDepth/jnlp.html, 
 
https://github.com/jenkinsci/remoting, and this 
presentation https://oleg-nenashev.github.io/troubleshooting-remoting-issues/
 

> All relevant ports are open both on the Jenkins side, and on the slave 
> side,
> and I do not see any hints other then those I posted herein.
> Where can I find more clues regarding the issue?
> How would you troubleshoot it?
>
>
First of all, as I commented before you have to check which Jenkins URL you 
have configured in Manage Jenkins/System Configuration/Jenkins URL (80% 
sure it is your issue). Then go to the agent status page and copy the 
connection command line you have there, with that command line start 
testing it from your local environment if you have access to both ports 
8080 and 8081, if it does not work, the exception should have some 
information about the error. for troubleshooting the error from here check :

https://support.cloudbees.com/hc/en-us/articles/360028535872-How-to-troubleshoot-JNLP-agents-connection-issues-with-Jenkins-


-- 
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/e0bdc884-4fa3-4126-b3d3-2264f2f3ebb5n%40googlegroups.com.


Re: JNLP inbound Agent

2020-11-01 Thread Ivan Fernandez Calvo
The inbound agents negotiate the connection calling a HTTP/S URL, because 
of that your fixed inbound does not apear in the URL you see in the UI. The 
URL you see there, it is generated with the setting Jenkins URL you have in 
Manage Jenkins/System Configuration,. Because you see an HTTP URL and you 
said that you have an HTTPS connection probably you have a warning on 
Manage Jenkins about that you do not have your Jenkins URL well configured. 
So if you have a Apache or Nginx in front Jenkins to configure the HTTPS 
you have to set the Jenkins URL to the effective URL that should use all 
clients/agents, it is the URL exposed by Apace/Nginx, then your URL to 
connect you will see in the UI wil be the correct and the negotiation of 
the inbound port will work. 
One last thing, take care that the agent can reach the HTTP/S and inbound 
ports.
 
El sábado, 31 de octubre de 2020 a las 21:27:09 UTC+1, vit...@1-family.net 
escribió:

> Hi,
>
> I'm trying to configure inbound agent (slave).
> For this purpose I've defined in Jenkin's Global security setting
>
> TCP port for inbound agents: Fixed: 8081, and created a new node.
>
> *The node settings page suggests the following command to be run on the 
> agent:*
> java -jar agent.jar  
> -jnlpUrl http://ip:8080/computer/NODE/slave-agent.jnlp -secret SECRET 
> -workDir "/home/pi/jenkins"
> This is strange, as I configured the TCP Port for inbound connections to 
> be 8081, not 8080.
> Moreover, the server itself is secuted with TLS, however jenkins suggests 
> to use HTTP.
>
> *Running the command produces the following error:*
> Failed to obtain 
> http://ip:8080/computer/NODE/slave-agent.jnlp?encrypt=true
> java.net.SocketException: Unexpected end of file from server
> at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:851)
> at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
> at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:848)
> at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)
> at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1593)
> at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
> at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)
> at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:517)
> at hudson.remoting.Launcher.run(Launcher.java:347)
> at hudson.remoting.Launcher.main(Launcher.java:298)
> Waiting 10 seconds before retry
>
> *Trying to change port to 8081 produces:*
> Failed to obtain 
> http://ip:8081/computer/NODE/slave-agent.jnlp?encrypt=true
> java.io.IOException: Failed to load 
> http://ci.adam-cogtec.com:8081/computer/VitaliysAutoPi/slave-agent.jnlp?encrypt=true:
>  
> 404 Not Found
> at hudson.remoting.Launcher.parseJnlpArguments(Launcher.java:519)
> at hudson.remoting.Launcher.run(Launcher.java:347)
> at hudson.remoting.Launcher.main(Launcher.java:298)
> Waiting 10 seconds before retry
>
> *Changing the URL to https & port 8081 hangs for a long time.*
>
>
> *Changing the URL to https & port 8080 produces the following error:*
> Oct 31, 2020 7:23:14 PM hudson.remoting.jnlp.Main$CuiListener error
> SEVERE: Handshake response not received.
> io.jenkins.remoting.shaded.javax.websocket.DeploymentException: Handshake 
> response not received.
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3$1.run(ClientManager.java:694)
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$3.run(ClientManager.java:712)
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager$SameThreadExecutorService.execute(ClientManager.java:866)
> at 
> java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112)
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:511)
> at 
> io.jenkins.remoting.shaded.org.glassfish.tyrus.client.ClientManager.connectToServer(ClientManager.java:355)
> at hudson.remoting.Engine.runWebSocket(Engine.java:628)
> at hudson.remoting.Engine.run(Engine.java:470)
>
> *So which URL should be the right URL, and how would you troubleshoot this 
> issue?*
>
> Many Thanks!
> Vitaliy
>

-- 
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/c1983273-42ed-4376-8025-9d84af082956n%40googlegroups.com.


Re: ConcurrentModificationException saving artifacts to GCP

2020-10-29 Thread Ivan Fernandez Calvo
Well, we really did not workaround the issue, it simply happens fewer 
times, the real solution will 
be https://github.com/jenkinsci/google-storage-plugin/pull/120

El jueves, 29 de octubre de 2020 a las 16:53:38 UTC+1, Ivan Fernandez Calvo 
escribió:

> We have workaround the issue by using a semaphore to call the GCP storage 
> step
>
>
> import groovy.transform.Field
> @Field def lock = false
>
> @NonCPS
> def setLock(){
>   synchronized(lock) {
> lock = true
>   }
> }
>
> @NonCPS
> def setUnlock(){
>   synchronized(lock) {
> lock = false
>   }
> }
>
> @NonCPS
> def isLock(){
>   synchronized(lock) {
> return lock
>   }
> }
>
> def waitForUnlock(){
>   while(isLock()){
> sleep 10
>   }
> }
>
> def uploadPackages(bucketUri, baseDir){
>   waitForUnlock()
>   setLock()
>   googleStorageUpload(bucket: bucketUri,
> credentialsId: "${JOB_GCS_CREDENTIALS}",
> pathPrefix: "${baseDir}/build/distributions/",
> pattern: "${baseDir}/build/distributions/**/*",
>     sharedPublicly: true,
> showInline: true
>   )
>   setUnlock()
> }
> El miércoles, 28 de octubre de 2020 a las 22:34:59 UTC+1, Ivan Fernandez 
> Calvo escribió:
>
>> Hi,
>>
>> We are facing some issues with a job that has about 100 stages in 
>> parallel, we track down the issue and it happens when we storage artifacts 
>> on GCP in parallel, the thing is that I am not sure it is related to the 
>> plugin directly, Could someone take a look to this stack trace and confirm 
>> that it is not related to the Core? BTW we are using Jenkins 2.252 
>>
>> *19:12:54*  java.util.ConcurrentModificationException*19:12:54*  at 
>> java.util.HashMap$HashIterator.nextNode(HashMap.java:1445)*19:12:54* 
>> at java.util.HashMap$KeyIterator.next(HashMap.java:1469)*19:12:54*  at 
>> com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:73)*19:12:54*
>>at 
>> com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)*19:12:54*
>>  at 
>> com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)*19:12:54*
>> at 
>> com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)*19:12:54*
>> at 
>> hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:264)*19:12:54*
>> at 
>> hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:251)*19:12:54*
>>   Caused: java.lang.RuntimeException: Failed to serialize 
>> com.google.jenkins.plugins.storage.reports.BuildGcsUploadReport#files for 
>> class 
>> com.google.jenkins.plugins.storage.reports.BuildGcsUploadReport*19:12:54*
>>   at 
>> hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:255)*19:12:54*
>>  at 
>> hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:223)*19:12:54*
>>   at 
>> com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)*19:12:54*
>>  at 
>> hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)*19:12:54*
>> at 
>> hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)*19:12:54*
>>   at 
>> com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)*19:12:54*
>>  at 
>> com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)*19:12:54*
>> at 
>> com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)*19:12:54*
>> at 
>> com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)*19:12:54*
>> at 
>> com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)*19:12:54*
>>  at 
>> com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)*19:12:54*
>>at 
>> com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)*19:12:54*
>>  at 
>> com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)*19:12:54*
>> at 
>> com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)*19:12:54*

Re: ConcurrentModificationException saving artifacts to GCP

2020-10-29 Thread Ivan Fernandez Calvo
We have workaround the issue by using a semaphore to call the GCP storage 
step


import groovy.transform.Field
@Field def lock = false

@NonCPS
def setLock(){
  synchronized(lock) {
lock = true
  }
}

@NonCPS
def setUnlock(){
  synchronized(lock) {
lock = false
  }
}

@NonCPS
def isLock(){
  synchronized(lock) {
return lock
  }
}

def waitForUnlock(){
  while(isLock()){
sleep 10
  }
}

def uploadPackages(bucketUri, baseDir){
  waitForUnlock()
  setLock()
  googleStorageUpload(bucket: bucketUri,
credentialsId: "${JOB_GCS_CREDENTIALS}",
pathPrefix: "${baseDir}/build/distributions/",
pattern: "${baseDir}/build/distributions/**/*",
sharedPublicly: true,
showInline: true
  )
  setUnlock()
}
El miércoles, 28 de octubre de 2020 a las 22:34:59 UTC+1, Ivan Fernandez 
Calvo escribió:

> Hi,
>
> We are facing some issues with a job that has about 100 stages in 
> parallel, we track down the issue and it happens when we storage artifacts 
> on GCP in parallel, the thing is that I am not sure it is related to the 
> plugin directly, Could someone take a look to this stack trace and confirm 
> that it is not related to the Core? BTW we are using Jenkins 2.252 
>
> *19:12:54*  java.util.ConcurrentModificationException*19:12:54*   at 
> java.util.HashMap$HashIterator.nextNode(HashMap.java:1445)*19:12:54* 
> at java.util.HashMap$KeyIterator.next(HashMap.java:1469)*19:12:54*  at 
> com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:73)*19:12:54*
>at 
> com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)*19:12:54*
>  at 
> com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)*19:12:54*
> at 
> com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)*19:12:54*
> at 
> hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:264)*19:12:54*
> at 
> hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:251)*19:12:54*
>   Caused: java.lang.RuntimeException: Failed to serialize 
> com.google.jenkins.plugins.storage.reports.BuildGcsUploadReport#files for 
> class 
> com.google.jenkins.plugins.storage.reports.BuildGcsUploadReport*19:12:54* 
>  at 
> hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:255)*19:12:54*
>  at 
> hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:223)*19:12:54*
>   at 
> com.thoughtworks.xstream.converters.reflection.PureJavaReflectionProvider.visitSerializableFields(PureJavaReflectionProvider.java:138)*19:12:54*
>  at 
> hudson.util.RobustReflectionConverter.doMarshal(RobustReflectionConverter.java:209)*19:12:54*
> at 
> hudson.util.RobustReflectionConverter.marshal(RobustReflectionConverter.java:150)*19:12:54*
>   at 
> com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)*19:12:54*
>  at 
> com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)*19:12:54*
> at 
> com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:43)*19:12:54*
> at 
> com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:88)*19:12:54*
> at 
> com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.writeItem(AbstractCollectionConverter.java:64)*19:12:54*
>  at 
> com.thoughtworks.xstream.converters.collections.CollectionConverter.marshal(CollectionConverter.java:74)*19:12:54*
>at 
> com.thoughtworks.xstream.core.AbstractReferenceMarshaller.convert(AbstractReferenceMarshaller.java:69)*19:12:54*
>  at 
> com.thoughtworks.xstream.core.TreeMarshaller.convertAnother(TreeMarshaller.java:58)*19:12:54*
> at 
> com.thoughtworks.xstream.core.AbstractReferenceMarshaller$1.convertAnother(AbstractReferenceMarshaller.java:84)*19:12:54*
> at 
> hudson.util.RobustReflectionConverter.marshallField(RobustReflectionConverter.java:264)*19:12:54*
> at 
> hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:251)*19:12:54*
>   Caused: java.lang.RuntimeException: Failed to serialize 
> hudson.model.Actionable#actions for class 
> org.jenkinsci.plugins.workflow.job.WorkflowRun*19:12:54* at 
> hudson.util.RobustReflectionConverter$2.writeField(RobustReflectionConverter.java:255)*19:12:54*
>  at 
> hudson.util.RobustReflectionConverter$2.visit(RobustReflectionConverter.java:223)*19:12:54*
>   at 
> com.thoughtworks.xstre

Re: How to access jenkins using ip address remotely ?

2020-10-20 Thread Ivan Fernandez Calvo
Do you use something like this to run Jenkins?

java --jar jenkins.war -httpListenAddress=0.0.0.0 --httpPort=8080

El martes, 20 de octubre de 2020 a las 19:35:17 UTC+2, nhoj.p...@gmail.com 
escribió:

> From the command line do;
> $ netstat -an | grep 8080
>
> That will show you what ip address as listening on the port 8080, e.g.
> your jenkins instance. If it's only listening to local addresses then
> it will never work remotely.
>
> Don't have access to a jenkins at the moment, but within Jenkins
> configuration you should be able to select what addresses jenkins
> should bind to and listen to. It might require a manual change in the
> configuration then restart.
>
> John
>
>
> On Tue, 20 Oct 2020 at 15:41, Danny Trunk  wrote:
> >
> > Hello Vaibhav,
> >
> > what does "remotely" mean? Inside your network or outside from the 
> internet?
> > Inside of your network this should work out of the box.
> > Outside from the internet you need to open port 8080 to access it.
> > Please refer to the documentation of your router on how to open a port.
> > Keep in mind this might be a security issue.
> >
> > And in addition: If you have 24h reconnect in order to get a new ip 
> address you can get and run a so called DynDNS address.
> > There are several providers out there.
> > Some (or most?) routers support configuring a DynDNS address as well - 
> so you don't have to run a service on your computer.
> >
> > Am Mo, 19. Okt, 2020 um 10:22 NACHMITTAGS schrieb Vaibhav Khachane <
> vkha...@namutek.com>:
> >
> > Hello Team,
> >
> > I am trying to access jenkins using ip address but it is not working . I 
> am using macOS.
> >
> > Following jenkins url working fine
> > http://localhost:8080/
> > http://127.0.0.1:8080/
> > http://0.0.0.0:8080/
> >
> > but while using ip adress of my machine it is not working
> > http://(ip address of my. machine ):8080/
> >
> >
> > --
> > 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-use...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/0a2be992-d850-41d8-a0eb-6959888f0cb0n%40googlegroups.com
> .
> >
> > --
> > 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-use...@googlegroups.com.
> > To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/JS8IIQ.Z02SEYIZGNFU2%40gmail.com
> .
>

-- 
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/51f117b4-be03-4c8b-b469-d513b411316fn%40googlegroups.com.


Re: Jenkins SAML with google

2020-10-15 Thread Ivan Fernandez Calvo
Did you set the proper *Group Attribute* in the configuration? Did you 
check that the groups are loaded in the user? if you go to 
JENKINS_URL/user/USENAME/configure at the end page you can see the groups 
loaded.
in case there is no groups check that you SAMLResponse contains the 
groups 
https://github.com/jenkinsci/saml-plugin/blob/master/doc/TROUBLESHOOTING.md#troubleshooting
 
and check that you select the proper group attribute,
if all those things are correct it works as it is explained at 
https://github.com/jenkinsci/saml-plugin/blob/master/doc/CONFIGURE.md#configuring-groups-security
El jueves, 15 de octubre de 2020 a las 7:02:59 UTC+2, Rishi Gautam escribió:

> Thank you Ivan for responding, but that didn't worked for me as well.
>
> On Wed, Oct 14, 2020 at 10:33 PM Ivan Fernandez Calvo  
> wrote:
>
>> Hi,
>>
>> you have how to do it in the documentation of the plugin 
>> https://github.com/jenkinsci/saml-plugin/blob/master/doc/CONFIGURE.md#configuring-groups-security
>>
>> El miércoles, 14 de octubre de 2020 a las 13:52:07 UTC+2, Rishi Gautam 
>> escribió:
>>
>>> Using role based strategy, is there any way to give default permission 
>>> to all logged in users? 
>>> I used authenticated group but it is not working and always forwarded to 
>>> logout. 
>>>
>>> Also, how to enable permission for groups in google?
>>>
>> -- 
>> 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-use...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jenkinsci-users/83dd4f84-8b73-4412-b3cf-ba2d64cde25fn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jenkinsci-users/83dd4f84-8b73-4412-b3cf-ba2d64cde25fn%40googlegroups.com?utm_medium=email_source=footer>
>> .
>>
>

-- 
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/9ef84a96-78b7-488d-ad3a-999aff8c9787n%40googlegroups.com.


Re: Jenkins SAML with google

2020-10-14 Thread Ivan Fernandez Calvo
Hi,

you have how to do it in the documentation of the plugin 
https://github.com/jenkinsci/saml-plugin/blob/master/doc/CONFIGURE.md#configuring-groups-security

El miércoles, 14 de octubre de 2020 a las 13:52:07 UTC+2, Rishi Gautam 
escribió:

> Using role based strategy, is there any way to give default permission to 
> all logged in users? 
> I used authenticated group but it is not working and always forwarded to 
> logout. 
>
> Also, how to enable permission for groups in google?
>

-- 
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/83dd4f84-8b73-4412-b3cf-ba2d64cde25fn%40googlegroups.com.


Re: SVN Issue

2020-10-12 Thread Ivan Fernandez Calvo
>we are planning to migrate Jenkins master to Linux

Do your new Jenkins instance is the same version as the old? Do both have 
the same version of the SVN plugin installed? also around that error should 
be a stack trace that gives the real issue, that message is generic.

El lunes, 12 de octubre de 2020 a las 14:53:34 UTC+2, venh...@gmail.com 
escribió:

> We have a Jenkins master configured (long back) on Windows Server. All our 
> slaves are also on Windows servers, since the application source code is in 
> .Net.
>
> We have configured multibranch pipeline jobs which are working fine. 
> However, we are planning to migrate Jenkins master to Linux, although the 
> slaves will still be Windows servers. The application source code is in SVN.
>
> After moving to the new Jenkins instance (we still have the old one also), 
> we are facing an issue with Multibranch pipeline. The issue is "ERROR: 
> Subversion checkout has been canceled". I am not able to understand the 
> root cause. Can anyone please help?
>
> Regards,
> Venkatesh
>

-- 
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/d749fd70-2e16-44a3-b6ee-f76903a9ffadn%40googlegroups.com.


Re: master to agent connection keeps breaking every 3-4 hours

2020-09-30 Thread Ivan Fernandez Calvo
ideally, on both sides, make it on one side usually is enough.

El miércoles, 30 de septiembre de 2020 a las 3:22:00 UTC+2, 
ashish...@gmail.com escribió:

> Thanks, are these setting to be applied on master side or slave or both?
>
> On Wednesday, September 30, 2020 at 12:15:23 AM UTC+8 kuisat...@gmail.com 
> wrote:
>
>>
>>- Why does agent tries to connect to master when its already 
>>connected?
>>
>> That suggests half-closed connections, it means that the agent loses the 
>> connection with the Jenkins instance but the FIN notification never arrived 
>> to the Jenkins instance so the connection is open in the Jenkins instance 
>> side. It could be related to networks equipment and the policies that have 
>> for open connections, the recommendation is to tune the TCP stack to keep 
>> those connections open with traffic see 
>> https://support.cloudbees.com/hc/en-us/articles/115001416548#7tcpretransmissiontimeoutossperhapsincrease
>>
>> El martes, 29 de septiembre de 2020 a las 10:47:22 UTC+2, 
>> ashish...@gmail.com escribió:
>>
>>> Hi Team, We are using JNLP to connect Mac agent to Linux master node.
>>>
>>> Jenkins agent keeps disconnecting frequently, and we are getting below 
>>> logs in master.
>>>
>>> Can you please suggest how to resolve this? What are the steps to 
>>> further triage the same.
>>>
>>> Some of the questions we are trying to answer is:
>>>
>>>- What is EOFException?
>>>- Why does agent tries to connect to master when its already 
>>>connected?
>>>- Why does eventually the ping / connection fails? 
>>>
>>> We keep seeing this pattern in logs too often and too frequently. Any 
>>> help would be appreciated.
>>>
>>> Results are same even if we try any of the below options:
>>>
>>>- Connected using *Launch agent from Browser*
>>>- Connected by *starting automator* in Mac which runs shell/zsh to 
>>>run agent.jar
>>>- Connected by running *plist* in Mac
>>>
>>> * Jenkins environment:*
>>>
>>>- Jenkins: 2.249.1
>>>- Master Node: Linux RHEL 8.1
>>>- Master Java Version: 1.8.0_242
>>>- Slave System: macOS Catalina, Version 10.15.6
>>>- Slave Java Version: 1.8.0_261
>>>
>>> *Connection #xxx failed: java.io.EOFException Sep 29, 2020 2:45:21 AM  
>>> INFO hudson.TcpSlaveAgentListener$ConnectionHandler run Accepted 
>>> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57215 Sep 29, 2020 
>>> 2:45:21 AM  
>>> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer on 
>>> Recv[JNLP4-connect connection from x.x.x.x/x.x.x.x:57215] Refusing headers 
>>> from remote:  is already connected to this master. Rejecting 
>>> this connection.Sep 29, 2020 2:45:31 AM  
>>> INFO hudson.TcpSlaveAgentListener$ConnectionHandler runConnection #xxx 
>>> failed: java.io.EOFException Sep 29, 2020 2:45:31 
>>> AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler runAccepted 
>>> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57218 Sep 29, 2020 
>>> 2:45:32 AM  
>>> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer 
>>> onRecv[JNLP4-connect connection from x.x.x.x/x.x.x.x] Refusing headers from 
>>> remote:  is already connected to this master. Rejecting this 
>>> connection.Sep 29, 2020 2:45:32 AM INFO hudson.slaves.ChannelPinger$1 
>>> onDeadPing failed. Terminating the channel JNLP4-connect connection from 
>>> x.x.x.x/x.x.x.x:57015. java.util.concurrent.TimeoutException: Ping started 
>>> at 1601318492966 hasn't completed by 1601318732966at 
>>> hudson.remoting.PingThread.ping(PingThread.java:134)at 
>>> hudson.remoting.PingThread.run(PingThread.java:90) *
>>>
>>>  
>>>
>>> TIA
>>>
>>>  
>>>
>>

-- 
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/c0005418-b120-4bb8-939f-f12f064847dbn%40googlegroups.com.


Re: master to agent connection keeps breaking every 3-4 hours

2020-09-29 Thread Ivan Fernandez Calvo

   
   - Why does agent tries to connect to master when its already connected?

That suggests half-closed connections, it means that the agent loses the 
connection with the Jenkins instance but the FIN notification never arrived 
to the Jenkins instance so the connection is open in the Jenkins instance 
side. It could be related to networks equipment and the policies that have 
for open connections, the recommendation is to tune the TCP stack to keep 
those connections open with traffic 
see 
https://support.cloudbees.com/hc/en-us/articles/115001416548#7tcpretransmissiontimeoutossperhapsincrease

El martes, 29 de septiembre de 2020 a las 10:47:22 UTC+2, 
ashish...@gmail.com escribió:

> Hi Team, We are using JNLP to connect Mac agent to Linux master node.
>
> Jenkins agent keeps disconnecting frequently, and we are getting below 
> logs in master.
>
> Can you please suggest how to resolve this? What are the steps to further 
> triage the same.
>
> Some of the questions we are trying to answer is:
>
>- What is EOFException?
>- Why does agent tries to connect to master when its already connected?
>- Why does eventually the ping / connection fails? 
>
> We keep seeing this pattern in logs too often and too frequently. Any help 
> would be appreciated.
>
> Results are same even if we try any of the below options:
>
>- Connected using *Launch agent from Browser*
>- Connected by *starting automator* in Mac which runs shell/zsh to run 
>agent.jar
>- Connected by running *plist* in Mac
>
> * Jenkins environment:*
>
>- Jenkins: 2.249.1
>- Master Node: Linux RHEL 8.1
>- Master Java Version: 1.8.0_242
>- Slave System: macOS Catalina, Version 10.15.6
>- Slave Java Version: 1.8.0_261
>
> *Connection #xxx failed: java.io.EOFException Sep 29, 2020 2:45:21 AM  
> INFO hudson.TcpSlaveAgentListener$ConnectionHandler run Accepted 
> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57215 Sep 29, 2020 
> 2:45:21 AM  
> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer on 
> Recv[JNLP4-connect connection from x.x.x.x/x.x.x.x:57215] Refusing headers 
> from remote:  is already connected to this master. Rejecting 
> this connection.Sep 29, 2020 2:45:31 AM  
> INFO hudson.TcpSlaveAgentListener$ConnectionHandler runConnection #xxx 
> failed: java.io.EOFException Sep 29, 2020 2:45:31 
> AM INFO hudson.TcpSlaveAgentListener$ConnectionHandler runAccepted 
> JNLP4-connect connection #xxx from x.x.x.x/x.x.x.x:57218 Sep 29, 2020 
> 2:45:32 AM  
> INFO org.jenkinsci.remoting.protocol.impl.ConnectionHeadersFilterLayer 
> onRecv[JNLP4-connect connection from x.x.x.x/x.x.x.x] Refusing headers from 
> remote:  is already connected to this master. Rejecting this 
> connection.Sep 29, 2020 2:45:32 AM INFO hudson.slaves.ChannelPinger$1 
> onDeadPing failed. Terminating the channel JNLP4-connect connection from 
> x.x.x.x/x.x.x.x:57015. java.util.concurrent.TimeoutException: Ping started 
> at 1601318492966 hasn't completed by 1601318732966at 
> hudson.remoting.PingThread.ping(PingThread.java:134)at 
> hudson.remoting.PingThread.run(PingThread.java:90) *
>
>  
>
> TIA
>
>  
>

-- 
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/1e7bdce3-dbb1-47c8-9d2a-0257496388een%40googlegroups.com.


Re: How do you set java options for ssh agents

2020-09-25 Thread Ivan Fernandez Calvo
ok, I think I know what happens, I saw it before using Docker and JCasC, if 
you make changes on the JCasC and restart Jenkins from UI the changes are 
not applied because JCasC is not executed on that restart, but if you stop 
the Jenkins instance and start it again the changes are applied IIRC is how 
it works.

El miércoles, 23 de septiembre de 2020 a las 23:37:18 UTC+2, Ivan Fernandez 
Calvo escribió:

> I will configure a test environment with JCasC that has jmvOptions too see 
> how it behaves, then we will know if it is an issue or not, in any case is 
> weird.
>
> El El mié, 23 sept 2020 a las 22:10, Tim Black  
> escribió:
>
>> More info: In my case, a reboot is definitely needed. A 
>> disconnect/reconnect does not suffice, nor does rebooting just the 
>> master/controller or the agent in sequence - *the only way I see the 
>> correct jvmOptions being used is by rebooting the entire cluster at once*
>> . 
>>
>> I'm using Jenkins 2.222.3, ssh build agents plugin 1.31.2. 
>>
>> Another probably important piece of info here is that *I have 
>> "ServerAliveCountMax 10" and "ServerAliveInterval 60" in the ssh client on 
>> the Jenkins master/controller, to help keep ssh connections alive for 
>> longer amount of time when agents are very very busy performing builds and 
>> may not have the cycles to respond to the master/controller.*
>>
>> I'm also using ansible and configuration-as-code plugin (1.43) to 
>> configure *everything* in the jenkins cluster. So, to make a change to 
>> the agent java_options, what I do is:
>>
>> 1. Modify the local jenkins.yml CasC file to include new "jvmOptions" 
>> values for my agent, e.g. my latest:
>>
>>   - permanent:
>>   name: "jenkins-testing-agent-1"
>>   nodeDescription: "Fungible Agent for jenkins-testing"
>>   labelString: ""
>>   mode: "NORMAL"
>>   remoteFS: "/home/jenkins/.jenkins"
>>   launcher:
>> ssh:
>>   credentialsId: "jenkins_user_on_linux_agent"
>>   host: "jenkins-testing-agent-1"
>>   jvmOptions: "-Dhudson.slaves.WorkspaceList=- 
>> -Dorg.apache.commons.jelly.tags.fmt.timeZone=America/Vancouver *-Xmx4g 
>> -Xms1g* -XX:+AlwaysPreTouch -XX:+HeapDumpOnOutOfMemoryError 
>> -XX:HeapDumpPath=/home/jenkins/.jenkins/support -XX:+UseG1GC 
>> -XX:+UseStringDeduplication -XX:+ParallelRefProcEnabled 
>> -XX:+DisableExplicitGC -XX:+UnlockDiagnosticVMOptions 
>> -XX:+UnlockExperimentalVMOptions -verbose:gc 
>> -Xlog:gc:/home/jenkins/.jenkins/support/gc-%t.log -XX:+PrintGC 
>> -XX:+PrintGCDetails -XX:ErrorFile=/hs_err_%p.log -XX:+LogVMOutput 
>> -XX:LogFile=/home/jenkins/.jenkins/support/jvm.log"
>>   launchTimeoutSeconds: 30
>>   maxNumRetries: 20
>>   port: 22
>>   retryWaitTime: 10
>>   sshHostKeyVerificationStrategy: 
>> "nonVerifyingKeyVerificationStrategy"
>>
>> 2. send the CasC yaml file to /jenkins.yml on the 
>> master/controller machine
>> 3. run geerlingguy.jenkins role which, among other things, detects a 
>> change and restarts the jenkins service
>> 4. on Jenkins restart, Jenkins applies the new CasC settings in 
>> jenkins.yaml, and this can be verified as correct in the GUI subsequently
>> 5. the agents are not restarted in this process (which I assert should be 
>> fine/ok)  
>>
>> After my ansible playbook is complete, and all (verifiably correct) 
>> config has been applied to controller/agents, I look at the agent logs and 
>> they appear to have gone back to having the empty jvmOptions like I 
>> originally reported:
>>
>> SSHLauncher{host='jenkins-testing-agent-1', port=22, 
>> credentialsId='jenkins_user_on_linux_agent', *jvmOptions=''*, 
>> javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', 
>> launchTimeoutSeconds=30, maxNumRetries=20, retryWaitTime=10, 
>> sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy,
>>  
>> tcpNoDelay=true, trackCredentials=true} 
>>
>> At this point, *if I only reboot the agent, when the master/controller 
>> reconnect to it the logs still shows jvmOptions=''*.
>>
>> *If I then reboot the master/controller, is still shows jvmOptions=''*.
>>
>> But if (and only iff) I reboot the entire cluster, I get the correct 
>> application of my ssh agent jvmOptions:
>>
>> SSHLauncher{host='jenkins-testing-agent-1', port=22, 
>> credentialsId='jenkins_us

Re: SAML with Okta is very slow

2020-09-24 Thread Ivan Fernandez Calvo
Is your Jenkins home in a NFS or other network storage? I think so for the 
mount point, when a user enter a few files are written, because your IO is 
slow the IO operations are blocked waiting to finish that make the login 
slower than expected. You probably has more performance issues, I usually 
recommend to not use NFS file systems for the Jenkins home, take a look to 
this KB https://support.cloudbees.com/hc/en-us/articles/217479948-NFS-Guide

El jueves, 24 de septiembre de 2020 a las 15:52:05 UTC+2, 
mark.sc...@gmail.com escribió:

> Here are the logs in a better format.  
>
> Sep 24, 2020 7:52:17 AM 
> FINE org.pac4j.saml.client.SAML2Client retrieveUserProfileAdding attribute 
> value mark.schroering@*.com for attribute null 
> Sep 24, 2020 7:52:17 AM 
> FINE org.pac4j.core.profile.UserProfile addAttributeno conversion => key: 
> email / value: [mark.schroering@*.com] / class java.util.ArrayList 
> Sep 24, 2020 7:52:17 AM 
> FINE org.pac4j.core.profile.UserProfile addAttributeno conversion => key: 
> notBefore / value: 2020-09-24T11:46:38.907Z / class org.joda.time.DateTime 
> Sep 24, 2020 7:52:17 AM 
> FINE org.pac4j.core.profile.UserProfile addAttributeno conversion => key: 
> notOnOrAfter / value: 2020-09-24T11:56:38.907Z / class 
> org.joda.time.DateTime 
> Sep 24, 2020 7:52:17 AM 
> FINEST org.jenkinsci.plugins.saml.OpenSAMLWrapperreset TCCL 
> Sep 24, 2020 7:53:35 AM 
> FINE 
> org.jenkinsci.plugins.saml.SamlSecurityRealmSamlSecurityRealm.doCommenceLogin 
> called. Using consumerServiceUrl 
> https://ci.infra.lifeomic.com/securityRealm/finishLogin 
> Sep 24, 2020 7:53:35 AM 
> FINE org.jenkinsci.plugins.saml.SamlSecurityRealmSafe URL redirection: / 
> Sep 24, 2020 7:53:35 AM 
> FINEST org.jenkinsci.plugins.saml.OpenSAMLWrapperadapt TCCL 
> Sep 24, 2020 7:53:45 AM 
> FINE 
> org.jenkinsci.plugins.saml.SamlSecurityRealmSamlSecurityRealm.doCommenceLogin 
> called. Using consumerServiceUrl 
> https://ci.infra.lifeomic.com/securityRealm/finishLogin 
> Sep 24, 2020 7:53:45 AM 
> FINE org.jenkinsci.plugins.saml.SamlSecurityRealmSafe URL redirection: / 
> Sep 24, 2020 7:53:45 AM 
> FINEST org.jenkinsci.plugins.saml.OpenSAMLWrapperadapt TCCL 
> Sep 24, 2020 7:54:13 AM 
> INFO org.pac4j.saml.metadata.SAML2ServiceProviderMetadataResolver Using SP 
> entity ID https://ci.infra.lifeomic.com/securityRealm/finishLogin 
> Sep 24, 2020 7:54:13 AM 
> INFO org.pac4j.saml.metadata.SAML2ServiceProviderMetadataResolver 
> resolveWriting sp metadata to /mnt/jenkins_home/saml-sp-metadata.xml 
> Sep 24, 2020 7:54:13 AM 
> INFO org.pac4j.saml.metadata.SAML2ServiceProviderMetadataResolver 
> resolveAttempting to create directory structure for /mnt/jenkins_home
>
> On Thursday, September 24, 2020 at 9:37:54 AM UTC-4 Mark Schroering wrote:
>
>> We have noticed it taking a very long time (up to 60s) to complete the 
>> SAML auth flow.  Here are some logs showing the bigger time gaps.  We are 
>> on version 1.1.7 of the SAML plugin and running Jenkins version 2.257. 
>>
>>
>> Sep 24, 2020 7:52:17 AM FINE org.pac4j.saml.client.SAML2Client 
>> retrieveUserProfileAdding attribute value mark.schroering@*.com for 
>> attribute null Sep 24, 2020 7:52:17 
>> AM FINE org.pac4j.core.profile.UserProfile addAttributeno conversion => 
>> key: email / value: [mark.schroering@*.com] / class java.util.ArrayList 
>> Sep 24, 2020 7:52:17 AM FINE org.pac4j.core.profile.UserProfile 
>> addAttributeno conversion => key: notBefore / value: 
>> 2020-09-24T11:46:38.907Z / class org.joda.time.DateTime Sep 24, 2020 
>> 7:52:17 AM FINE org.pac4j.core.profile.UserProfile addAttributeno 
>> conversion => key: notOnOrAfter / value: 2020-09-24T11:56:38.907Z / class 
>> org.joda.time.DateTime Sep 24, 2020 7:52:17 
>> AM FINEST org.jenkinsci.plugins.saml.OpenSAMLWrapperreset TCCL Sep 24, 2020 
>> 7:53:35 
>> AM FINE 
>> org.jenkinsci.plugins.saml.SamlSecurityRealmSamlSecurityRealm.doCommenceLogin
>>  
>> called. Using consumerServiceUrl 
>> https://ci.infra.lifeomic.com/securityRealm/finishLogin Sep 24, 2020 
>> 7:53:35 AM FINE org.jenkinsci.plugins.saml.SamlSecurityRealmSafe URL 
>> redirection: / Sep 24, 2020 7:53:35 
>> AM FINEST org.jenkinsci.plugins.saml.OpenSAMLWrapperadapt TCCL Sep 24, 2020 
>> 7:53:45 
>> AM FINE 
>> org.jenkinsci.plugins.saml.SamlSecurityRealmSamlSecurityRealm.doCommenceLogin
>>  
>> called. Using consumerServiceUrl 
>> https://ci.infra.lifeomic.com/securityRealm/finishLogin Sep 24, 2020 
>> 7:53:45 AM FINE org.jenkinsci.plugins.saml.SamlSecurityRealmSafe URL 
>> redirection: / Sep 24, 2020 7:53:45 
>> AM FINEST org.jenkinsci.plugins.saml.OpenSAMLWrapperadapt TCCL Sep 24, 2020 
>> 7:54:13 
>> AM INFO org.pac4j.saml.metadata.SAML2ServiceProviderMetadataResolver Using 
>> SP entity ID https://ci.infra.lifeomic.com/securityRealm/finishLogin Sep 
>> 24, 2020 7:54:13 
>> AM INFO org.pac4j.saml.metadata.SAML2ServiceProviderMetadataResolver 
>> resolveWriting sp metadata to /mnt/jenkins_home/saml-sp-metadata.xml Sep 

Re: How do you set java options for ssh agents

2020-09-23 Thread Ivan Fernandez Calvo
The jvmOptions settings work, I just tested it on the latest version. Did 
you disconnect and connect the agent again to apply the changes? if you 
only click on save the agent does not discconect and connect with the new 
settings, you have to disconnect the agent with the action disconnect from 
the menu and lauch the agent again with the launch button in the status 
page.  

El miércoles, 23 de septiembre de 2020 a las 19:01:46 UTC+2, Ivan Fernandez 
Calvo escribió:

> How much memory those agents have? you set "-Xmx64g -Xms64g" for the 
> remoting process (not for builds) you agent has to have more than 64GB of 
> RAM to run any build on it, you grab 64GB only for the remoting process, 
> and this RAM should be enough to run you builds. The remoting agent usually 
> does not need more than 256-512MB, this keeps the rest of your agent memory 
> for builds, agents rarely need JVM options to tune the memory the default 
> configuration is enough, the only case I will recommend to pass JVM option 
> is to limit the memory of the agent process.
>
> the jvmOptions field should work is tested on unit test, if not is and 
> issue, Which version of Jenksin and ssh build agents plugin do your use?
>
> El miércoles, 23 de septiembre de 2020 a las 1:21:28 UTC+2, 
> timb...@gmail.com escribió:
>
>> I'm using ssh-slaves-plugin 
>> <https://github.com/jenkinsci/ssh-slaves-plugin> to configure and launch 
>> 2 ssh agents, and I've specified several java options in these agents' 
>> config (see photo and text list below), but when these agents are launched, 
>> the agents' log still shows empty jvmOptions in the ssh launcher call. 
>> Agent Log excerpt:
>>
>> SSHLauncher{host='jenkins-testing-agent-1', port=22, 
>> credentialsId='jenkins_user_on_linux_agent', *jvmOptions=''*, 
>> javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', 
>> launchTimeoutSeconds=30, maxNumRetries=20, retryWaitTime=10, 
>> sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy,
>>  
>> tcpNoDelay=true, trackCredentials=true} 
>> [09/22/20 15:56:12] [SSH] Opening SSH connection to 
>> jenkins-testing-agent-1:22. 
>> [09/22/20 15:56:16] [SSH] WARNING: SSH Host Keys are not being verified. 
>> Man-in-the-middle attacks may be possible against this connection. 
>> [09/22/20 15:56:16] [SSH] Authentication successful. 
>> [09/22/20 15:56:16] [SSH] The remote user's environment is: 
>> BASH=/usr/bin/bash
>> .
>> .
>> .
>> [SSH] java -version returned 11.0.8. 
>> [09/22/20 15:56:16] [SSH] Starting sftp client. [09/22/20 15:56:16] [SSH] 
>> Copying latest remoting.jar... Source agent hash is 
>> 0146753DA5ED62106734D59722B1FA2C. Installed agent hash is 
>> 0146753DA5ED62106734D59722B1FA2C Verified agent jar. No update is 
>> necessary. Expanded the channel window size to 4MB 
>> [09/22/20 15:56:16] [SSH] Starting agent process: cd 
>> "/home/jenkins/.jenkins" && java -jar remoting.jar -workDir 
>> /home/jenkins/.jenkins -jar-cache /home/jenkins/.jenkins/remoting/jarCache 
>> Sep 22, 2020 3:56:17 PM org.jenkinsci.remoting.engine.WorkDirManager 
>> initializeWorkDir INFO: Using /home/jenkins/.jenkins/remoting as a remoting 
>> work directory Sep 22, 2020 3:56:17 PM 
>> org.jenkinsci.remoting.engine.WorkDirManager setupLogging INFO: Both error 
>> and output logs will be printed to /home/jenkins/.jenkins/remoting 
>> <===[JENKINS REMOTING CAPACITY]===>channel started Remoting version: 4.2 
>> This is a Unix agent WARNING: An illegal reflective access operation has 
>> occurred WARNING: Illegal reflective access by 
>> jenkins.slaves.StandardOutputSwapper$ChannelSwapper to constructor 
>> java.io.FileDescriptor(int) WARNING: Please consider reporting this to the 
>> maintainers of jenkins.slaves.StandardOutputSwapper$ChannelSwapper WARNING: 
>> Use --illegal-access=warn to enable warnings of further illegal reflective 
>> access operations WARNING: All illegal access operations will be denied in 
>> a future release Evacuated stdout Agent successfully connected and online 
>>
>>
>> [image: jenkins-ssh-agent-config.PNG]
>>
>> This is the full text in the "JVM Options" field for 
>> jenkins-testing-agent-1 and 2:
>>
>> -Dhudson.slaves.WorkspaceList=- 
>> -Dorg.apache.commons.jelly.tags.fmt.timeZone=America/Vancouver -Xmx64g 
>> -Xms64g -XX:+AlwaysPreTouch -XX:+HeapDumpOnOutOfMemoryError 
>> -XX:HeapDumpPath=/home/jenkins/.jenkins/support -XX:+UseG1GC 
>> -XX:+UseStringDeduplication -XX:+ParallelRefProcEnabled 
>> -XX:+DisableExplicitGC -XX:+UnlockDiagnosti

Re: How do you set java options for ssh agents

2020-09-23 Thread Ivan Fernandez Calvo
How much memory those agents have? you set "-Xmx64g -Xms64g" for the 
remoting process (not for builds) you agent has to have more than 64GB of 
RAM to run any build on it, you grab 64GB only for the remoting process, 
and this RAM should be enough to run you builds. The remoting agent usually 
does not need more than 256-512MB, this keeps the rest of your agent memory 
for builds, agents rarely need JVM options to tune the memory the default 
configuration is enough, the only case I will recommend to pass JVM option 
is to limit the memory of the agent process.

the jvmOptions field should work is tested on unit test, if not is and 
issue, Which version of Jenksin and ssh build agents plugin do your use?

El miércoles, 23 de septiembre de 2020 a las 1:21:28 UTC+2, 
timb...@gmail.com escribió:

> I'm using ssh-slaves-plugin 
>  to configure and launch 
> 2 ssh agents, and I've specified several java options in these agents' 
> config (see photo and text list below), but when these agents are launched, 
> the agents' log still shows empty jvmOptions in the ssh launcher call. 
> Agent Log excerpt:
>
> SSHLauncher{host='jenkins-testing-agent-1', port=22, 
> credentialsId='jenkins_user_on_linux_agent', *jvmOptions=''*, 
> javaPath='', prefixStartSlaveCmd='', suffixStartSlaveCmd='', 
> launchTimeoutSeconds=30, maxNumRetries=20, retryWaitTime=10, 
> sshHostKeyVerificationStrategy=hudson.plugins.sshslaves.verifiers.NonVerifyingKeyVerificationStrategy,
>  
> tcpNoDelay=true, trackCredentials=true} 
> [09/22/20 15:56:12] [SSH] Opening SSH connection to 
> jenkins-testing-agent-1:22. 
> [09/22/20 15:56:16] [SSH] WARNING: SSH Host Keys are not being verified. 
> Man-in-the-middle attacks may be possible against this connection. 
> [09/22/20 15:56:16] [SSH] Authentication successful. 
> [09/22/20 15:56:16] [SSH] The remote user's environment is: 
> BASH=/usr/bin/bash
> .
> .
> .
> [SSH] java -version returned 11.0.8. 
> [09/22/20 15:56:16] [SSH] Starting sftp client. [09/22/20 15:56:16] [SSH] 
> Copying latest remoting.jar... Source agent hash is 
> 0146753DA5ED62106734D59722B1FA2C. Installed agent hash is 
> 0146753DA5ED62106734D59722B1FA2C Verified agent jar. No update is 
> necessary. Expanded the channel window size to 4MB 
> [09/22/20 15:56:16] [SSH] Starting agent process: cd 
> "/home/jenkins/.jenkins" && java -jar remoting.jar -workDir 
> /home/jenkins/.jenkins -jar-cache /home/jenkins/.jenkins/remoting/jarCache 
> Sep 22, 2020 3:56:17 PM org.jenkinsci.remoting.engine.WorkDirManager 
> initializeWorkDir INFO: Using /home/jenkins/.jenkins/remoting as a remoting 
> work directory Sep 22, 2020 3:56:17 PM 
> org.jenkinsci.remoting.engine.WorkDirManager setupLogging INFO: Both error 
> and output logs will be printed to /home/jenkins/.jenkins/remoting 
> <===[JENKINS REMOTING CAPACITY]===>channel started Remoting version: 4.2 
> This is a Unix agent WARNING: An illegal reflective access operation has 
> occurred WARNING: Illegal reflective access by 
> jenkins.slaves.StandardOutputSwapper$ChannelSwapper to constructor 
> java.io.FileDescriptor(int) WARNING: Please consider reporting this to the 
> maintainers of jenkins.slaves.StandardOutputSwapper$ChannelSwapper WARNING: 
> Use --illegal-access=warn to enable warnings of further illegal reflective 
> access operations WARNING: All illegal access operations will be denied in 
> a future release Evacuated stdout Agent successfully connected and online 
>
>
> [image: jenkins-ssh-agent-config.PNG]
>
> This is the full text in the "JVM Options" field for 
> jenkins-testing-agent-1 and 2:
>
> -Dhudson.slaves.WorkspaceList=- 
> -Dorg.apache.commons.jelly.tags.fmt.timeZone=America/Vancouver -Xmx64g 
> -Xms64g -XX:+AlwaysPreTouch -XX:+HeapDumpOnOutOfMemoryError 
> -XX:HeapDumpPath=/home/jenkins/.jenkins/support -XX:+UseG1GC 
> -XX:+UseStringDeduplication -XX:+ParallelRefProcEnabled 
> -XX:+DisableExplicitGC -XX:+UnlockDiagnosticVMOptions 
> -XX:+UnlockExperimentalVMOptions -verbose:gc 
> -Xlog:gc:/home/jenkins/.jenkins/support/gc-%t.log -XX:+PrintGC 
> -XX:+PrintGCDetails -XX:ErrorFile=/hs_err_%p.log -XX:+LogVMOutput 
> -XX:LogFile=/home/jenkins/.jenkins/support/jvm.log
>
> I am having intermittent catastrophic failures of these agent machines 
> during builds and am trying to properly configure java settings per 
> Cloudbees best practices, but I cannot seem to get off the ground here. 
> Another problem in my agents that's probably related is that the agent-side 
> (remoting) logs are all zero bytes.
>
> Thanks for your help.
>

-- 
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/964c6651-837a-42e1-8ab2-52df4c36598dn%40googlegroups.com.


Re: View all credentials on an instance (global, folders, users, ...)

2020-09-14 Thread Ivan Fernandez Calvo
I think this groovy script is what you want 
https://github.com/cloudbees/jenkins-scripts/blob/master/list-credential.groovy

El lunes, 14 de septiembre de 2020 a las 14:57:33 UTC+2, 
geoffroy...@gmail.com escribió:

> Hello
>
> as a global instance admin, is there a way i can view (not decrypt) all 
> credentials stored in it?
> */credentials* will only show global/system credentials.
>
> If a credential is created within a Folder, the only way to view it is to 
> go to url */job//credentials/store/folder/*
>
> This is quite difficult to track all those credentials provided Folders 
> are used quite extensively on our instance.
> The same also apply to user credentials, although it is not on our 
> immediate concerns.
>
> Is there any option to activate on Jenkins to get such "recursive" view on 
> credentials, or shall we go for a script to execute? Any pointer?
>
> Regards
>

-- 
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/31f5dd0f-1069-4cac-81bc-470788914400n%40googlegroups.com.


Re: Windows client ssh connection error

2020-09-01 Thread Ivan Fernandez Calvo
NS REMOTING CAPACITY]===>Sep 01, 2020 2:00:19 PM 
> org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
>
> INFO: Using c:\JenkinsSlave\remoting as a remoting work directory
>
> Sep 01, 2020 2:00:19 PM org.jenkinsci.remoting.engine.WorkDirManager 
> setupLogging
>
> INFO: Both error and output logs will be printed to c:\JenkinsSlave\remoting
>
> <===[JENKINS REMOTING CAPACITY]===>ERROR: Connection terminated
>
> ERROR: java.io.IOException: Unexpected termination of the channel
>
> java.io.EOFException
>
> at 
> java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2681)
>
> at 
> java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3156)
>
> at 
> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
>
> at java.io.ObjectInputStream.(ObjectInputStream.java:358)
>
> at 
> hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:49)
>
> at hudson.remoting.Command.readFrom(Command.java:142)
>
> at hudson.remoting.Command.readFrom(Command.java:128)
>
> at 
> hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
>
> at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
>
> Caused: java.io.IOException: Unexpected termination of the channel
>
> at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
>
> hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected 
> termination of the channel
>
> at hudson.remoting.Request.abort(Request.java:340)
>
> at hudson.remoting.Channel.terminate(Channel.java:1081)
>
> at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:94)
>
> Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote call 
> to KeilDellGris
>
>at 
> hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
>
>at hudson.remoting.Request.call(Request.java:202)
>
>at hudson.remoting.Channel.call(Channel.java:997)
>
>at 
> hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:642)
>
>at 
> hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:424)
>
>at 
> hudson.plugins.sshslaves.SSHLauncher.startAgent(SSHLauncher.java:623)
>
>at 
> hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:112)
>
>at 
> hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:457)
>
>at 
> hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:422)
>
>at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>
>at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>
>at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
>
>at java.lang.Thread.run(Thread.java:748)
>
> Caused by: java.io.IOException: Unexpected termination of the channel
>
> at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
>
> Caused by: java.io.EOFException
>
> at 
> java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2681)
>
> at 
> java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3156)
>
> at 
> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
>
> at java.io.ObjectInputStream.(ObjectInputStream.java:358)
>
> at 
> hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:49)
>
> at hudson.remoting.Command.readFrom(Command.java:142)
>
> at hudson.remoting.Command.readFrom(Command.java:128)
>
> at 
> hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
>
> at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
>
> [09/01/20 14:00:21] Launch failed - cleaning up connection
>
> [09/01/20 14:00:21] [SSH] Connection closed.
>
>  
>
>  
>
> *From:* jenkins...@googlegroups.com  *On 
> Behalf Of *Jérôme Godbout
> *Sent:* September 1, 2020 12:40 PM
> *To:* jenkins...@googlegroups.com
> *Subject:* RE: Windows client ssh connection error
>
>  
>
> Yes, I created the folder and give the user (I made a local user for this 
>

Re: Windows client ssh connection error

2020-09-01 Thread Ivan Fernandez Calvo
when you enter on that Windows machine though SSH manually, Do you have a 
long banner at the beginning that you do not have in the other machine?

El martes, 1 de septiembre de 2020 a las 18:04:53 UTC+2, Ivan Fernandez 
Calvo escribió:

> Has the user that connect permissions on c:\JenkinsSlave? Is the folder 
> c:\JenkinsSlave\remoting created? Are there some err_pid* files or log 
> files in c:\JenkinsSlave folder?
>
> El martes, 1 de septiembre de 2020 a las 17:48:39 UTC+2, Jérôme Godbout 
> escribió:
>
>> Hi,
>>
>>  
>>
>> I did solve my issue with the ssh agent I had earlier, but when I try to 
>> do the same on another Windows client machine I get this weird error below. 
>> The log on the slave are empty (c:\JenkinsSlave\remoting). The error is 
>> a bit vague and I have no clue what is wrong. I can connect with ssh, I 
>> also did it on the master node to approve the address to ensure it was not 
>> an issue. Seem like the exchange stream are breaking down!?! what is going 
>> on?
>>
>>  
>>
>> [09/01/20 11:33:18] [SSH] Checking java version of 
>> C:\Java\1_8_0_261\/bin/java
>>
>> [09/01/20 11:33:19] [SSH] C:\Java\1_8_0_261\/bin/java -version returned 
>> 1.8.0_261.
>>
>> [09/01/20 11:33:19] [SSH] Starting sftp client.
>>
>> [09/01/20 11:33:19] [SSH] Copying latest remoting.jar...
>>
>> Source agent hash is E5FEC468D6F172BF394E1F2571EA686C. Installed agent 
>> hash is E5FEC468D6F172BF394E1F2571EA686C
>>
>> Verified agent jar. No update is necessary.
>>
>> Expanded the channel window size to 4MB
>>
>> [09/01/20 11:33:35] [SSH] Starting agent process: cd "c:\JenkinsSlave" && 
>> C:\Java\1_8_0_261\/bin/java  -jar remoting.jar -workDir c:\JenkinsSlave 
>> -jar-cache c:\JenkinsSlave/remoting/jarCache
>>
>> <===[JENKINS REMOTING CAPACITY]===>Sep 01, 2020 11:33:35 AM 
>> org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
>>
>> INFO: Using c:\JenkinsSlave\remoting as a remoting work directory
>>
>> Sep 01, 2020 11:33:35 AM org.jenkinsci.remoting.engine.WorkDirManager 
>> setupLogging
>>
>> INFO: Both error and output logs will be printed to 
>> c:\JenkinsSlave\remoting
>>
>> <===[JENKINS REMOTING CAPACITY]===>Exception in thread "main" 
>> java.io.EOFException: unexpected stream termination
>>
>> at 
>> hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:415)
>>
>> at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:360)
>>
>> at hudson.remoting.Launcher.main(Launcher.java:770)
>>
>> at hudson.remoting.Launcher.runWithStdinStdout(Launcher.java:718)
>>
>> at hudson.remoting.Launcher.run(Launcher.java:398)
>>
>> at hudson.remoting.Launcher.main(Launcher.java:298)
>>
>> ERROR: ERROR: Connection terminated
>>
>> java.io.IOException: Unexpected termination of the channel
>>
>> java.io.EOFException
>>
>> at 
>> java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2681)
>>
>> at 
>> java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3156)
>>
>> at 
>> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
>>
>> at java.io.ObjectInputStream.(ObjectInputStream.java:358)
>>
>> at 
>> hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:49)
>>
>> at hudson.remoting.Command.readFrom(Command.java:142)
>>
>> at hudson.remoting.Command.readFrom(Command.java:128)
>>
>> at 
>> hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
>>
>> at 
>> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
>>
>> Caused: java.io.IOException: Unexpected termination of the channel
>>
>> at 
>> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
>>
>> hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected 
>> termination of the channel
>>
>> at hudson.remoting.Request.abort(Request.java:340)
>>
>> at hudson.remoting.Channel.terminate(Channel.java:1081)
>>
>> at 
>> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:94)
>>
>>  

Re: Windows client ssh connection error

2020-09-01 Thread Ivan Fernandez Calvo
Has the user that connect permissions on c:\JenkinsSlave? Is the folder 
c:\JenkinsSlave\remoting created? Are there some err_pid* files or log 
files in c:\JenkinsSlave folder?

El martes, 1 de septiembre de 2020 a las 17:48:39 UTC+2, Jérôme Godbout 
escribió:

> Hi,
>
>  
>
> I did solve my issue with the ssh agent I had earlier, but when I try to 
> do the same on another Windows client machine I get this weird error below. 
> The log on the slave are empty (c:\JenkinsSlave\remoting). The error is a 
> bit vague and I have no clue what is wrong. I can connect with ssh, I also 
> did it on the master node to approve the address to ensure it was not an 
> issue. Seem like the exchange stream are breaking down!?! what is going on?
>
>  
>
> [09/01/20 11:33:18] [SSH] Checking java version of 
> C:\Java\1_8_0_261\/bin/java
>
> [09/01/20 11:33:19] [SSH] C:\Java\1_8_0_261\/bin/java -version returned 
> 1.8.0_261.
>
> [09/01/20 11:33:19] [SSH] Starting sftp client.
>
> [09/01/20 11:33:19] [SSH] Copying latest remoting.jar...
>
> Source agent hash is E5FEC468D6F172BF394E1F2571EA686C. Installed agent 
> hash is E5FEC468D6F172BF394E1F2571EA686C
>
> Verified agent jar. No update is necessary.
>
> Expanded the channel window size to 4MB
>
> [09/01/20 11:33:35] [SSH] Starting agent process: cd "c:\JenkinsSlave" && 
> C:\Java\1_8_0_261\/bin/java  -jar remoting.jar -workDir c:\JenkinsSlave 
> -jar-cache c:\JenkinsSlave/remoting/jarCache
>
> <===[JENKINS REMOTING CAPACITY]===>Sep 01, 2020 11:33:35 AM 
> org.jenkinsci.remoting.engine.WorkDirManager initializeWorkDir
>
> INFO: Using c:\JenkinsSlave\remoting as a remoting work directory
>
> Sep 01, 2020 11:33:35 AM org.jenkinsci.remoting.engine.WorkDirManager 
> setupLogging
>
> INFO: Both error and output logs will be printed to 
> c:\JenkinsSlave\remoting
>
> <===[JENKINS REMOTING CAPACITY]===>Exception in thread "main" 
> java.io.EOFException: unexpected stream termination
>
> at 
> hudson.remoting.ChannelBuilder.negotiate(ChannelBuilder.java:415)
>
> at hudson.remoting.ChannelBuilder.build(ChannelBuilder.java:360)
>
> at hudson.remoting.Launcher.main(Launcher.java:770)
>
> at hudson.remoting.Launcher.runWithStdinStdout(Launcher.java:718)
>
> at hudson.remoting.Launcher.run(Launcher.java:398)
>
> at hudson.remoting.Launcher.main(Launcher.java:298)
>
> ERROR: ERROR: Connection terminated
>
> java.io.IOException: Unexpected termination of the channel
>
> java.io.EOFException
>
> at 
> java.io.ObjectInputStream$PeekInputStream.readFully(ObjectInputStream.java:2681)
>
> at 
> java.io.ObjectInputStream$BlockDataInputStream.readShort(ObjectInputStream.java:3156)
>
> at 
> java.io.ObjectInputStream.readStreamHeader(ObjectInputStream.java:862)
>
> at java.io.ObjectInputStream.(ObjectInputStream.java:358)
>
> at 
> hudson.remoting.ObjectInputStreamEx.(ObjectInputStreamEx.java:49)
>
> at hudson.remoting.Command.readFrom(Command.java:142)
>
> at hudson.remoting.Command.readFrom(Command.java:128)
>
> at 
> hudson.remoting.AbstractSynchronousByteArrayCommandTransport.read(AbstractSynchronousByteArrayCommandTransport.java:35)
>
> at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:63)
>
> Caused: java.io.IOException: Unexpected termination of the channel
>
> at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:77)
>
> hudson.remoting.RequestAbortedException: java.io.IOException: Unexpected 
> termination of the channel
>
> at hudson.remoting.Request.abort(Request.java:340)
>
> at hudson.remoting.Channel.terminate(Channel.java:1081)
>
> at 
> hudson.remoting.SynchronousCommandTransport$ReaderThread.run(SynchronousCommandTransport.java:94)
>
> Suppressed: hudson.remoting.Channel$CallSiteStackTrace: Remote 
> call to KeilDellGris
>
>at 
> hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1788)
>
>at hudson.remoting.Request.call(Request.java:202)
>
>at hudson.remoting.Channel.call(Channel.java:997)
>
>at 
> hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:642)
>
>at 
> hudson.slaves.SlaveComputer.setChannel(SlaveComputer.java:424)
>
>at 
> hudson.plugins.sshslaves.SSHLauncher.startAgent(SSHLauncher.java:623)
>
>at 
> hudson.plugins.sshslaves.SSHLauncher.access$400(SSHLauncher.java:112)
>
>at 
> hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:457)
>
>at 
> hudson.plugins.sshslaves.SSHLauncher$1.call(SSHLauncher.java:422)
>
>at java.util.concurrent.FutureTask.run(FutureTask.java:266)
>
>at 
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
>
>at 
> 

Re: Windows slave by ssh

2020-08-27 Thread Ivan Fernandez Calvo
I hate this 
class src/main/java/hudson/plugins/sshslaves/JavaVersionChecker.java I 
though to remove it and force configuring the Java path in the plugin or 
have Java in the PATH, it is a requirement to run the remoting process. The 
PR from Alex is a valid workaround meanwhile I think how to remove that 
class.

El jueves, 27 de agosto de 2020 a las 18:10:35 UTC+2, jn...@cloudbees.com 
escribió:

> could this be https://issues.jenkins-ci.org/browse/JENKINS-47510 ?
>
> On Thursday, August 27, 2020 at 3:55:08 PM UTC+1 slide wrote:
>
>> Feel free to open your own PR then. I took the time to try and fix an 
>> immediate issue in the short amount of time I had to look at it. This 
>> should fix for the majority of people I believe, there will definitely be 
>> corner cases that can be addressed in the future.
>>
>> On Thu, Aug 27, 2020 at 7:20 AM Jérôme Godbout  wrote:
>>
>>> Why only escape the command when it contains space, you could always do 
>>> it, so other characters would also be properly escaped, the if is useless.
>>>
>>> if(javaCommand.contains(" ")) {
>>>
>>>  
>>>
>>> javaCommand = "\"" + javaCommand + "\"";
>>>
>>> }
>>>
>>>  
>>>
>>>  
>>>
>>> *From:* jenkins...@googlegroups.com  *On 
>>> Behalf Of *Slide
>>> *Sent:* August 27, 2020 10:11 AM
>>> *To:* Jenkins User Mailing List 
>>> *Subject:* Re: Windows slave by ssh
>>>
>>>  
>>>
>>> I opened this PR against the ssh-agents-plugin  
>>> https://github.com/jenkinsci/ssh-slaves-plugin/pull/183
>>>
>>>  
>>>
>>> On Thu, Aug 27, 2020 at 6:22 AM Jérôme Godbout  
>>> wrote:
>>>
>>> This is exactly what I’m using now, not more need for Cygwin for ssh 
>>> (about time Microsoft ). Remove any space from the JAVA_HOME path 
>>> solve the issue, but the default install path for Java is inside the 
>>> Program Files folders, so by default it has a space. Not supporting spaces 
>>> (and probably other character) is a bug. It’s not a big issue, but this 
>>> should be fix. As for the \ or /, this should be handle by the  source code 
>>> and perform the right conversion to node native format. In my script I 
>>> always use *nix / path and convert them to native before running the actual 
>>> command in a shell. I even made some Groovy pipeline functions to be 
>>> platform agnostic as much as possible, the default implementation force us 
>>> to put if(isUnix()) everywhere and it’s annoying. Having a function to 
>>> manipulate the files and folders (create, remove, touch, move, rename) 
>>> should be there by default for CI pipelines and be platform agnostic. This 
>>> is pretty basic stuff.
>>>
>>>  
>>>
>>> This is where you realize Qt, C# and Python are way ahead into path 
>>> manipulation.  Do a little as possible into Groovy-ish language and use 
>>> Ansible or Python scripts to do the actual work lifting, made my life so 
>>> much less painful.
>>>
>>>  
>>>
>>> *From:* jenkins...@googlegroups.com  *On 
>>> Behalf Of *Slide
>>> *Sent:* August 26, 2020 6:03 PM
>>> *To:* Jenkins User Mailing List 
>>> *Subject:* Re: Windows slave by ssh
>>>
>>>  
>>>
>>> Well, running on Cygwin is almost like running on a *NIX platform. Not 
>>> exactly, but almost. I am referring to the OpenSSH-Win64 port that is now 
>>> supported by MS. 
>>>
>>>  
>>>
>>> On Wed, Aug 26, 2020 at 2:50 PM Jason Pyeron  wrote:
>>>
>>> Sorry to be a Johnny come lately – but we have only used SSH launch of 
>>> windows for quite a long time now.
>>>
>>>  
>>>
>>> We use Cygwin to do so. You can use any SSH server though.
>>>
>>>  
>>>
>>> The most important thing is to ensure Java’s home has no spaces in the 
>>> path.
>>>
>>>  
>>>
>>> The second most important thing is to use mixed pathing constructs. E.g. 
>>> javaPath='C:/programs.x64/Java/jdk-14/bin/java note the forward slashes. It 
>>> is a happy middle ground for bash and java.
>>>
>>>  
>>>
>>> *From:* jenkins...@googlegroups.com  *On 
>>> Behalf Of *Slide
>>> *Sent:* Wednesday, August 26, 2020 5:18 PM
>>> *To:* Jenkins User Mailing List 
>>> *Subject:* Re: Windows slave by ssh
>>>
>>>  
>>>
>>> Historically, Windows agents couldn't really be run using this plugin, 
>>> it is only somewhat recently that Windows had good SSH support. So, there 
>>> are probably some leftovers from the plugin only being used on *NIX 
>>> systems. 
>>>
>>>  
>>>
>>> On Wed, Aug 26, 2020 at 2:07 PM Jérôme Godbout  
>>> wrote:
>>>
>>> Hi,
>>>
>>> Reinstalling Java into a path like c:\Java work just fine now. Wonder 
>>> why the Linux and the Windows master doesn’t show the same behavior on 
>>> this? Is this code part only for *nix platform?
>>>
>>>  
>>>
>>> Anyway, thanks for the pointer,
>>>
>>> Jerome
>>>
>>>  
>>>
>>> *From:* jenkins...@googlegroups.com  *On 
>>> Behalf Of *Slide
>>> *Sent:* August 26, 2020 4:23 PM
>>> *To:* Jenkins User Mailing List 
>>> *Subject:* Re: Windows slave by ssh
>>>
>>>  
>>>
>>> It looks like this code would need to be updated to handle when there 
>>> are spaces:  
>>> 

Re: Gradle Build takes long time while running from Jenkins slave but its faster when I run from local command line

2020-08-26 Thread Ivan Fernandez Calvo
When you run the job on Jenkins the agent process is writing more files to 
the workspace, like the log so the IO speed to the NFS server is really 
important, I would not recommend to use NFS for the workspace if you cannot 
ensure a 100-150MB/s IO and NFSv4 protocol
 https://support.cloudbees.com/hc/en-us/articles/217479948-NFS-Guide 
. I 
guess you need it as cache for the dependencies or other stuff, so should 
be better to only use the NFS on read only mode for that cache and use the 
local disk for the build. If you are using pipelines you can reduce the IO 
by disabling the persistence options but you lost the rerun from a stage 
feature https://www.jenkins.io/doc/book/pipeline/scaling-pipeline/

El miércoles, 26 de agosto de 2020 a las 14:53:50 UTC+2, manic...@gmail.com 
escribió:

> Gradle Clean/Build takes long time while running from Jenkins slave but 
> its faster when I run from local command line on the same slave with the 
> same user logged in.
>
> I have a gradle job configured and it runs as part of multi branch 
> pipeline. 
> * Checkout - First stage
> * Clean  - Second stage
> * Build - Thrid stage 
>
> When the job is run from Jenkins (dedicated slave), it took 12 mins of 
> time to complete the clean operation and 1 hour for build operation. 
>
> Whereas, when I logged into the same slave machine with same user I used 
> in Jenkins, it took only 4 mins for clean and 15 mins for build. 
>
> The remote root directory is in NFS path. I also played around increasing 
> the heap space for Jenkins slave with advanced JVM options "-Xms4096M 
> -Xmx8192M -XX:MaxPermSize=4192M -Djava.awt.headless=true", but it doenst 
> help much.
>
> Please share your thoughts. 
>
> Regads,
> Saravanan
>

-- 
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/8683c8e7-a361-41f7-9881-341da8891e2en%40googlegroups.com.


Re: Security Vulnerability on my Jenkins Server

2020-08-24 Thread Ivan Fernandez Calvo
Yes, configuring the ciphers accepted by your JDK edit the 
file lib\security\java.security (the path will vary based on your Java 
version)

El lunes, 24 de agosto de 2020 a las 16:48:22 UTC+2, eric@gmail.com 
escribió:

> Hi all!  I'm getting hit by my secuity team for a vulnerability for the 
> Jenkins CLI via ssh allowing the following weak ciphers:
>
>   hmac-md5
>   hmac-md5-96
>   hmac-sha1-96
>
> Is there a way to configure ciphers accepted for the Jenkins CLI?
>
> Thanks,
> Eric
>

-- 
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/f28c34c0-ad6a-4305-89c5-9fd93f9ffb90n%40googlegroups.com.


Strange SAML-jenkins certificate expired causing JENKINS-ADFS integration SSO login to fail

2020-08-13 Thread Ivan Fernandez Calvo
SAML plugin needs a certificate for sign and encrypt the communications with 
the IdP, if you no provide one the SAML plugin generate a key and a certificate 
for that purpose, the certificate is renewed automatically when it expires but 
the IdP needs the new certificate is your responsability to provide the new 
certificate to the IdP, all of this is in the documentation of the plugin.

-- 
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/9eba951c-a12d-4c85-9933-5f4c3aa05c41o%40googlegroups.com.


Re: SAML plugin - differentiate between encryption and signing certificate

2020-07-28 Thread Ivan Fernandez Calvo
Hi,

The configuration only allows one certificate, this is used for singing and 
encryption, so it is not possible to use two different certificates.

El lunes, 27 de julio de 2020, 21:54:03 (UTC+2), Chris DW escribió:
>
> Hi , 
>
> When setting up the Jenkins SAML plugin, is it possible to configure two 
> different certificates (generated from the same private key) for signing 
> and encryption? 
> The plugin seems to allow to configure just one key alias from one 
> keystore. (
> https://github.com/jenkinsci/saml-plugin/blob/master/doc/CONFIGURE.md)
> I'ml looking to configure 
> alias 1 = private key A + signing certificate chain C1
> alias 2 = private key A+ encryption certificate chain C2
>
> When enabling option 'Auth Request Signature' to  enable the signature of 
> the Redirect Binding Auth Request, I can see two key descriptors being 
> written to the saml-sp-metadata.xml file: 
>
> 
> http://www.w3.org/2000/09/xmldsig#;>
> 
> ...
>
> and 
>
>  
> http://www.w3.org/2000/09/xmldsig#;>
> 
> ...
>
> This leads me to believe that a setup with different sign and encryption 
> certs is a possibility.
> I've tried to configure the correct values for my setup directly in the 
> saml-sp-metadata.xml file, but the file gets overwritten on each login 
> attempt. 
>
> Does the current implementation of the saml plugin dictate the encryption 
> and signing cert to be the same and if not, how do I configure these? 
>
> Kind regards, 
> Chris
>

-- 
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/b189b9e7-5429-4fa1-9f6d-a72564f8a352o%40googlegroups.com.


[JCasC] can i utilize variables?

2020-07-24 Thread Ivan Fernandez Calvo
Hi,

You can use environment variables inside of your JCasC file. If you need 
something more complicated you can use a Jinja template and 
https://github.com/kolypto/j2cli to make the transformation to YAML

-- 
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/a8d4e976-1d2d-4638-8ce3-69df6d86e9d6o%40googlegroups.com.


Re: SSH Agent, z/OS USS, and git authentication problems

2020-07-12 Thread Ivan Fernandez Calvo
I think that this is the reason why it does not work 
https://support.cloudbees.com/hc/en-us/articles/224910467-Why-am-I-unable-to-authenticate-via-sshagent-inside-docker-

El sábado, 11 de julio de 2020, 22:25:08 (UTC+2), Randall Becker escribió:
>
> I'm having issues trying to get an agent to authenticate using the SSH 
> Agent plugin on a R2.4 z/OS USS agent with a Docker Jenkins controller. The 
> goal is to convince GitSCM to actually fetch properly. We get SSH 
> authentication errors no matter what happens. This is using Pipelines.
>
> I've tried 
> sshagent (credentials: ['mvs-randall']) {
> checkout([$class: 'GitSCM',
> branches: [[name: '*/development']],
> extensions: [
> [$class: 'CleanBeforeCheckout'],
> [$class: 'SubmoduleOption', 
> disableSubmodules: false, parentCredentials: true,
> recursiveSubmodules: true, 
> reference: '', trackingSubmodules: false]],
> doGenerateSubmoduleConfigurations: 
> false, submoduleCfg: [],
> userRemoteConfigs: [[url: 
> 'g...@xx.xxx.xxx.xxx:proj/repo.git'']]])
> }
> and
> checkout([$class: 'GitSCM',
> branches: [[name: '*/development']],
> extensions: [
> [$class: 'CleanBeforeCheckout'],
> [$class: 'SubmoduleOption', 
> disableSubmodules: false, parentCredentials: true,
> recursiveSubmodules: true, reference: 
> '', trackingSubmodules: false]],
> doGenerateSubmoduleConfigurations: false, 
> submoduleCfg: [],
> userRemoteConfigs: [[credentialsId: 
> 'mvs-randall',url: 'g...@xx.xxx.xxx.xxx:proj/repo.git']]])
>
> Both result in Permission denied (publickey).
>
> I've done the same thing on many other platforms with no problem. This 
> seems very R2.4 specific. There was a change in the supported file 
> encodings as well - we used to use -Dfile.encoding=utf8 in the agent config 
> (because this is an IBM that likes EBCDIC), but had to move to 
> -Dfile.encoding=ISO8859-1 and everything seems messed up now. IBM had this 
> funky script they recommend that massages the key into an IBM-1047 encoding 
> but that does not help at all - in fact the GitSCM agent cannot process any 
> results if that script is used.
>
> Help! 
>
> TIA,
> Randall
>

-- 
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/94a39cf1-295e-4b51-a42b-3b586e422542o%40googlegroups.com.


Re: Jenkins SAML ADFS and local users.

2020-07-01 Thread Ivan Fernandez Calvo

>
>
> Are any future plans to have the same capability with SAML/ADFS plugin
> or anything else down the line planned in Jenkins Core to overcome this
> scenario?
>

No, I do not have plans to add any kind of fallback user to the SAML 
plugin, this, in my opinion, is to add a non-related SAML logics to manage 
API users. You can workaround it with a real user in the SAML IdP and an 
API Token, In case that these fallback users make any sense, T¡this feature 
should be implemented in a plugin for those kind os users, in that way is 
something you can combine with any Authentication plugin, and we do not 
have to reinvent the wheel on each authentication plugin. Unfortunately, 
Jenkins does not support more than one Security Realm active at the same 
time. Another option can be to extend the API token feature to support 
local users but this is part of the core IIRC.

-- 
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/3c650e5f-1f6c-4801-93ba-ce6ebf4af54eo%40googlegroups.com.


Re: How to edit xml files through Jenkins pipeline?

2020-06-23 Thread Ivan Fernandez Calvo
Hi, 

I'd not recommend processing the XML file inside the Jenkinsfile, all the 
Groovy code you put in a Jenkins file consumes resources in the Jenkins 
instance (not in the Agent) and process an XML file can be a heavy process. 
I recommend you call a command-line tool or a Python script to process the 
file, in that way you will use only resources in the Agent. You have an 
interesting Jesse Glick presentation about this kind of thing 

How To Use Jenkins Less
https://www.youtube.com/watch?reload=9=Zeqc6--0eQw



El martes, 23 de junio de 2020, 6:09:50 (UTC+2), Gajanan Mahajan escribió:
>
> I've to update xml file as a part of pipeline. From following, I've to 
> replace `value` from `true` to false
>
> 
> 
>
> Also, following commented code, I've to uncomment -
>
> 
>
> Both of above snippets can be anywhere in xml file. `sed` utility won't 
> help much here. 
>
> Could you please suggest best possible approaches, solutions for this?
>

-- 
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/9662ec31-53a0-4f38-924e-6359215a200fo%40googlegroups.com.


Re: viewing the public key for a ssh pki credential?

2020-05-27 Thread Ivan Fernandez Calvo
You can make groovy magic on the Jenkins console, grab the credential, and 
extract the public key, but sounds odd. but this pipeline make the job for 
any credential and it is easy :D

pipeline {
   agent any
   parameters {
  credentials credentialType: 
'com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey', 
defaultValue: '', description: '', name: 'credential', required: true
}
   stages {
  stage('Hello') {
 steps {
sshagent([params.credential]) {
sh 'ssh-add -L'
}
 }
  }
   }
}

El martes, 26 de mayo de 2020, 19:35:48 (UTC+2), Jason Pyeron escribió:
>
> For a given existing credential, how can an authorized keys entry be 
> extracted from Jenkins? (It is easy to do (in java, openssl, ssh-keygen, 
> etc..) if you know the private key)
>
>  
>
> TL;DR
>
>  
>
> Take the following ssh-key being added to Jenkins:
>
>  
>
> $ ssh-keygen.exe -f /tmp/jenkins-issue -t rsa -N '' -C 
> jenkins-issue@hostname
>
> Generating public/private rsa key pair.
>
> Your identification has been saved in /tmp/jenkins-issue
>
> Your public key has been saved in /tmp/jenkins-issue.pub
>
> The key fingerprint is:
>
> SHA256:NDX21mT0Fp47rDryohouLU88iMAtS6K5enLLHO0PuUE jenkins-issue@hostname
>
> The key's randomart image is:
>
> +---[RSA 3072]+
>
> |  +  .+. |
>
> | o o +..o|
>
> |o   o .oo|
>
> |. .. . .  ...|
>
> |o+ .E   S  + |
>
> |=.+oo.. .|
>
> |oo..*=   .   |
>
> |.+o=o=o  o ..|
>
> |+++.*=o.. +o.|
>
> +[SHA256]-+
>
>  
>
> $ cat /tmp/jenkins-issue
>
> -BEGIN OPENSSH PRIVATE KEY-
>
> b3BlbnNzaC1rZXktdjEABG5vbmUEbm9uZQABAAABlwdzc2gtcn
>
> NhAwEAAQAAAYEAy6NY6POJ4K4+QF4k6oFFbsonb8POvSSYWiIudXtqST8biPsKGFcl
>
> 3dYlKaxk86cKf6E/JTnBrlecyyB5QL9B0U9nxNdm+dY61dP02PS1T7MRGEm8q4v4jkQGfQ
>
> m7/7ubSiaJ4xJ/QYCs1gzw0+7A4Sb7dSmruOn7C7nE07rJDlLdmM8TZSdITgVfiw+382bE
>
> ojDEwYh0itAoUVxlkiF4QDmohWkexLjINE6klzVsbGUatc7RrMJ21ifxf5ko6z5o7XhGAf
>
> HOIxkstOL7WHPeRRMTACBBfCs6FcjhRm5tloA8mv5OTyj8MRJfTIKEVRQZWNcFfZhKEbn3
>
> BR0dhvAHrl26gSuqMLb3vVbV/FnqsZ47ME8GL3UjMqdERjqw6KyvcjOOWqoBtMq2wWsFFc
>
> 3IyfLl3cVul8gnb3qQiuuW42o7VsVEfyHHh7T9nHWH1qyVEUUjszOT4syMt2DzMsHCwdsa
>
> OPxB/PszpYv9epU9Mit8ZxzKxvNv9BfO3nPaUfULAAAFkJEmPFaRJjxWB3NzaC1yc2
>
> EAAAGBAMujWOjzieCuPkBeJOqBRW7KJ2/Dzr0kmFoiLnV7akk/G4j7ChhXJd3WJSmsZPOn
>
> Cn+hPyU5wa5XnMsgeUC/QdFPZ8TXZvnWOtXT9Nj0tU+zERhJvKuL+I5EBn0Ju/+7m0omie
>
> MSf0GArNYM8NPuwOEm+3Upq7jp+wu5xNO6yQ5S3ZjPE2UnSE4FX4sPt/NmxKIwxMGIdIrQ
>
> KFFcZZIheEA5qIVpHsS4yDROpJc1bGxlGrXO0azCdtYn8X+ZKOs+aO14RgHxziMZLLTi+1
>
> hz3kUTEwAgQXwrOhXI4UZubZaAPJr+Tk8o/DESX0yChFUUGVjXBX2YShG59wUdHYbwB65d
>
> uoErqjC2971W1fxZ6rGeOzBPBi91IzKnREY6sOisr3IzjlqqAbTKtsFrBRXNyMny5d3Fbp
>
> fIJ296kIrrluNqO1bFRH8hx4e0/Zx1h9aslRFFI7Mzk+LMjLdg8zLBwsHbGjj8Qfz7M6WL
>
> /XqVPTIrfGccysbzb/QXzt5z2lH1CwMBAAEAAAGBALoEWwFhBn/haygtV5eHwr8zlt
>
> a3jTCmLy2Wr83NkQebyDFW8J/Pa9268nOg8Q7JdgOkbiQ5ID179tRus5R7oUnsOSRMh9qM
>
> 4W3WkoFk+AL31hPTt68Uy1ZZuXua2sr+uxn/HlH44ZoaSse1RoCyRirmCym5iQ3/Xr4VUk
>
> D/DQ4ykA44isUKHzh2HBLRpv2G0PQ/jFwlpB/xigLYXkggntI8WT6VCfA1w1xUwnEF8icK
>
> LF4LsOkZMqjqD+a5J/HMLTcF1wqd7SNlUFuNCrWjsfSPejQEE8WDqCFaFkOcho4276ICjP
>
> dlNJV/F2hrOcLMzWenNfQbch1Sp0aFin6OpTSzqt66i8W3QZl4zQ61iLJS+jlVRABwMK0d
>
> 2Zc1Xwk9O9px2ResXUf31slMVeXXgGTjQzwLvOytifGhOTVIIIeTxgQfcsyY7OgRwhe64o
>
> W1Pcj1uzkS6Tj/Lc24jdk/fjwQai7RWVP0k2xYgBkbe/A9V/8bZUQHmsjzSmja2ex/0QAA
>
> AMB1l84CrCRmMS7nmFULtSCM0a5bgbobptUoN9f0hCvzt6s2Wu9ImLWyig0R/e5lz2kCqM
>
> hoVXAXjFZnWsyQKsZu4vZ2NBm9yGQOp24LXk7/VX+RaIfgrUKrUP+Qep83s44TRtV6q7T4
>
> KYMLLMY31ibECBxPdNQz5o+GxjoNdyxV4lmPGOgz7l0voPu7v6CLN6aW/NQB3TBBgJLEV7
>
> QTvsrXW94pWVyISpa4wGU/+oKGZOEoQAHc4n4xJ6Swezm9Q1cAAADBAPXqOjQoeYUImOqg
>
> OVmSCCFkeMJVQNOTevF5FOOSu9MoTsXla2ot2uJDqxkyRvhxKsqHX22rSS5ZbMggXN5gSH
>
> gPmDtRpbdqHGSmoPGYcXF45L48E+8gDmySFS0FEx3I5hfcRS0mv6VcVel3P0TG70GP5J/R
>
> GDFxbGlWe+U3dSyXaWJBX43ok+Ly4LocdslV8nkqkAtztgjM+MMA5VQjZumi4AZOqeZZgW
>
> Qc6Gh/Dyq3ZeVRXFEIz/j+GujTFnJMjQAAAMEA0/1FLiAfJoi0sjbB8zBzwngNQ+XxkuXO
>
> ZSNjIfV84VSaUFh1/x3RoV+/00aDyoHVQ7BCNyiLaJ7pC6UTxURkdw1MubbFUB/ZKZadtX
>
> OFT2M/FDr3SjoImRpuoUZItddSKuSxmuRiSwCsScwk6QcHQJ2+EMseggEBwZRjO8JJanLw
>
> x08wtUWlzBaKsOkhm2mW6SGzPpjDfBum9EnEtFIxaMmGCSHjtBUUcTDnerOo65Nax3cjGV
>
> mL5+q+icjzHr33FmplbmtpbnMtaXNzdWVAaG9zdG5hbWUBAgME
>
> -END OPENSSH PRIVATE KEY-
>
>  
>
> $ cat /tmp/jenkins-issue.pub
>
> ssh-rsa 
> B3NzaC1yc2EDAQABAAABgQDLo1jo84ngrj5AXiTqgUVuyidvw869JJhaIi51e2pJPxuI+woYVyXd1iUprGTzpwp/oT8lOcGuV5zLIHlAv0HRT2fE12b51jrV0/TY9LVPsxEYSbyri/iORAZ9Cbv/u5tKJonjEn9BgKzWDPDT7sDhJvt1Kau46fsLucTTuskOUt2YzxNlJ0hOBV+LD7fzZsSiMMTBiHSK0ChRXGWSIXhAOaiFaR7EuMg0TqSXNWxsZRq1ztGswnbWJ/F/mSjrPmjteEYB8c4jGSy04vtYc95FExMAIEF8KzoVyOFGbm2WgDya/k5PKPwxEl9MgoRVFBlY1wV9mEoRufcFHR2G8AeuXbqBK6owtve9VtX8WeqxnjswTwYvdSMyp0RGOrDorK9yM45aqgG0yrbBawUVzcjJ8uXdxW6XyCdvepCK65bjajtWxUR/IceHtP2cdYfWrJURRSOzM5PizIy3YPMywcLB2xo4/EH8+zOli/16lT0yK3xnHMrG82/0F87ec9pR9Qs=
>  
> 

Re: slave status as offline on another jenkins master server

2020-05-27 Thread Ivan Fernandez Calvo
Do you mean you have the same agent connected to two different masters with 
different versions of the core and using the same user with the same home? 
if so, this is a miracle that works, you are sharing same files between two 
different instances of Jenkins core that also are in different versions. If 
you want to connect those instances to both masters (not recommended 
because you shared resources in a predictable way) you should use different 
users at least.

El miércoles, 27 de mayo de 2020, 15:10:52 (UTC+2), Om Prasad Surapu 
escribió:
>
> Hi All,
>
> We have a jenkins master running with 2.13 version on EC2 instance. As 
> part of Upgrade, we took AMI of existing jenkins master and provisioned 
> instance and upgraded jenkins to higher version.
>
> After upgrade, all the slave nodes status showing as Idle but few days 
> later they are offline suddenly. But same slave nodes status as Idle on Old 
> jenkins master. It was AMI of Old jenkins server so keys were already 
> copied and can do ssh from new jenkins master to slave node.
>
> Has anyone seen similar issue? 
>
> Thanks,
> Om 
>

-- 
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/5ea534be-3cf5-495e-9aa5-9b3b48f0eb0d%40googlegroups.com.


Re: [JNLP][Agent][Docker] connect an Agent to a Jenkins instance using self-signed certs

2020-04-13 Thread Ivan Fernandez Calvo
I make it with JCasC, basically is a Docker compose with Jenkins, openSAML, and 
a SSH Build Agent, it is what I use to test issues see 
https://github.com/kuisathaverat/jenkins-issues/tree/master/jobDSL

You have a bunch of examples on the JCasC demo folder

https://github.com/jenkinsci/configuration-as-code-plugin/blob/master/demos/build_agents/README.md

-- 
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/c969d56f-f62a-498a-91be-58d8d6842a81%40googlegroups.com.


Re: [JNLP][Agent][Docker] connect an Agent to a Jenkins instance using self-signed certs

2020-04-11 Thread Ivan Fernandez Calvo
Well, it was a stupid thing the URL that I pass to the Docker container is 
the JNLP agent URL (
https://jenkins:9443/computer/jnlp-agent/slave-agent.jnlp ), it should be 
the Jenkins URL (https://jenkins:9443 
), so that's my 
error.

This command works as expected :palmface: 

docker run --name jnlp-agent -it --rm --network net jenkins/jnlp-slave 
-disableHttpsCertValidation -credentials jenkins:"SuP3rP4ssw0rd" -url 
https://jenkins:9443 
 
224a6accfb5b9728e3db3dfc43ae8d2d986b24c09b2d8701497ca13c474d3dde jnlp-agent

BTW the error message is completely unrelated to the fail that was what 
confuses me. 

-- 
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/88f0e8d3-97c6-42d6-8a53-850b73bc2f05%40googlegroups.com.


[JNLP][Agent][Docker] connect an Agent to a Jenkins instance using self-signed certs

2020-04-11 Thread Ivan Fernandez Calvo
Hi,

I have a Jenkins instance running (2.230, also I have tested LTS) on a 
Docker container using only HTTPS with self-signed certificates, in the 
same network I start an SSH Build Agent and a JNLP Agent, the SSH Build 
agent connects
without issues, but the JNLP gives me an error I dunno what it is related, 
it said that the X-Instance-Identity is invalid, there is no proxy or 
anything else in between and the X-Instance-Identity is there so I dunno, 
why Jenkins said, is invalid, Do anyone see something similar or know what 
is this error about?

This is the Agent config



jnlp-agent


/home/jenkins


2


NORMAL




false


/home/jenkins


remoting


false



false



jnlp linux





These are the commands I use to launch the Jenkins instance

printf "[dn]\nCN=localhost\n[req]\ndistinguished_name = 
dn\n[EXT]\nsubjectAltName=DNS:localhost\nkeyUsage=digitalSignature\nextendedKeyUsage=serverAuth"
 
> domain.ext

openssl req \

-newkey rsa:2048 -nodes -sha256 -keyout domain_private.key \

-x509 -days 365 -out domain.crt \

-subj '/CN=localhost' -extensions EXT -config domain.ext

openssl rsa -in domain_private.key -out domain.key


docker run \

-e JENKINS_OPTS="--httpPort=-1 --httpsPort=9443 
--httpsCertificate=/var/lib/jenkins/cert 
--httpsPrivateKey=/var/lib/jenkins/pk"

--name jenkins \

--rm \

-p 9443:9443 \

-v jenkins_home:/var/jenkins_home \

--network net \

jenkins/jenkins-tls:2.230



An this is the command used to launch eht Agent

docker run --name jnlp-agent -it --rm --network net jenkins/jnlp-slave 
-disableHttpsCertValidation -credentials jenkins:"SuP3rP4ssw0rd" -url 
https://jenkins:9443/computer/jnlp-agent/slave-agent.jnlp 
224a6accfb5b9728e3db3dfc43ae8d2d986b24c09b2d8701497ca13c474d3dde jnlp-agent 

Apr 11, 2020 11:36:59 AM hudson.remoting.jnlp.Main createEngine

INFO: Setting up agent: jnlp-agent

Apr 11, 2020 11:36:59 AM hudson.remoting.jnlp.Main$CuiListener 

INFO: Jenkins agent is running in headless mode.

Apr 11, 2020 11:36:59 AM hudson.remoting.jnlp.Main createEngine

WARNING: Certificate validation for HTTPs endpoints is disabled

Apr 11, 2020 11:37:00 AM hudson.remoting.Engine startEngine

INFO: Using Remoting version: 4.3

Apr 11, 2020 11:37:00 AM hudson.remoting.Engine startEngine

WARNING: No Working Directory. Using the legacy JAR Cache location: 
/home/jenkins/.jenkins/cache/jars

Apr 11, 2020 11:37:00 AM hudson.remoting.jnlp.Main$CuiListener status

INFO: Locating server among 
[https://jenkins:9443/computer/jnlp-agent/slave-agent.jnlp]

Apr 11, 2020 11:37:00 AM 
org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver openURLConnection

WARNING: HTTPs certificate check is disabled for the endpoint.

Apr 11, 2020 11:37:00 AM hudson.remoting.jnlp.Main$CuiListener error

SEVERE: 
https://jenkins:9443/computer/jnlp-agent/slave-agent.jnlp/tcpSlaveAgentListener/
 
appears to be publishing an invalid X-Instance-Identity.

java.io.IOException: 
https://jenkins:9443/computer/jnlp-agent/slave-agent.jnlp/tcpSlaveAgentListener/
 
appears to be publishing an invalid X-Instance-Identity.

at 
org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:287)

at hudson.remoting.Engine.innerRun(Engine.java:693)

at hudson.remoting.Engine.run(Engine.java:518)

So I've changed to try to use direct connect without luck 

JENKINS_INSTANCE_IDENTITY=$(curl -sfkI https://localhost:9443 | grep 
X-Instance-Identity | cut -d\  -f2)


echo ${JENKINS_INSTANCE_IDENTITY}

MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAijph9cC+d2brNUMc+wE8Y3ZUvByXYIDZzJpAL37x6juBmwTGKPhOhCmmal/Lm5dTMAF1IWnZyOlMnLPrcPm4ifbhOS11Azpk/3lIH+DrK0ypXqVgYRf9ovLF7ZFRvNZovr6eMHXql4pK5wzgFQGM0ZcP6WwaWfKAma3ekqFLz986WvNBsQ4r7C5sxPZLYiSBuBiy+8bMSzzfd6S7FbpWG3RMJjXckw5mG4jDmLkMSfdhLrTsTKQbcPgPrbSJlZdZRUW5SdxsFF0oxuhhNibUkNgDcDQ3UEHVVVM2H7g1ul3gzOThX6mXf6Hm/YUCNmIGlQIb/siOQe5mxcYxxl/VAQIDAQAB

docker run --name jnlp-agent -it --rm --network net jenkins/jnlp-slave 
-disableHttpsCertValidation -credentials jenkins:"SuP3rP4ssw0rd" 
-instanceIdentity ${JENKINS_INSTANCE_IDENTITY} -direct jenkins:9443 
224a6accfb5b9728e3db3dfc43ae8d2d986b24c09b2d8701497ca13c474d3dde jnlp-agent 

Apr 11, 2020 11:45:28 AM hudson.remoting.jnlp.Main createEngine

INFO: Setting up agent: jnlp-agent

Apr 11, 2020 11:45:29 AM hudson.remoting.jnlp.Main$CuiListener 

INFO: Jenkins agent is running in headless mode.

Apr 11, 2020 11:45:29 AM hudson.remoting.jnlp.Main createEngine

WARNING: Certificate validation for HTTPs endpoints is disabled

Apr 11, 2020 11:45:29 AM hudson.remoting.Engine startEngine

INFO: Using Remoting version: 4.3

Apr 11, 2020 11:45:29 AM hudson.remoting.Engine startEngine

WARNING: No Working Directory. Using the legacy JAR Cache location: 
/home/jenkins/.jenkins/cache/jars

Apr 11, 2020 11:45:29 AM hudson.remoting.jnlp.Main$CuiListener status

INFO: Locating server among []

Apr 11, 2020 11:45:29 AM hudson.remoting.jnlp.Main$CuiListener error

SEVERE: Illegal base64 

  1   2   3   >