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

2022-12-05 Thread 'Dirk Heinrichs' via Jenkins Users
Am Montag, dem 05.12.2022 um 11:28 -0600 schrieb M.Madhusudana Reddy:

My java version was jdk-11.0.16+8 and I updated this to the latest one in JAVA 
11 this morning which is jdk-11.0.17+8 and I still see the same error.

Tomcat is of version 9.0.0.0

Ah, I see. We have different conditions, then. We're not running Jenkins in 
Tomcat here. And I checked again what our problem was with Java 11.0.16. It was 
a memory leak which led to Jenkins (or better: its JVM) being OOM-killed by the 
Linux kernel. THAT was fixed with 11.0.17.

Bye...

Dirk

--

Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Phone: +49 2226 15966 18
Email: dhein...@opentext.com
Website: 
www.recommind.de
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, 
Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht 
gestattet.

-- 
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/dba5491ad09b0ca4eb8ba76c80ecf6dcb663316d.camel%40opentext.com.


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

2022-12-05 Thread M.Madhusudana Reddy
Hi Mark -

Looks like the Tomcat upgrade from 9.0.0 to 9.0.70 fixed the issue. I am no
longer seeing that error/Jenkins controller getting crashed.

Thanks all for all your help.

Regards,
M.Madhu


On Mon, Dec 5, 2022 at 2:14 PM Mark Waite  wrote:

>
>
> On Monday, December 5, 2022 at 1:02:18 PM UTC-7 Madhu Muchukota wrote:
>
>> Thanks Mark
>>
>> All I'm doing is just triggering/running a multi branch pipeline job from
>> the controller UI.
>>
>> I will be happy to share more information needed from my end.
>>
>>
> Unfortunately, somehow you have a failure mode that is different than the
> 100,000+ Jenkins controllers around the world that are running with Java
> 11.  I don't have any suggestions about what could be different.
>
> Things that you could explore:
>
>- Does the same failure happen
>   - on a different computer running the same configuration?
>   - on a different computer running without Tomcat?
>   - on the same computer running without Tomcat?
>   - Were there recent upgrades to any components?
>   - Core upgrade
>   - Plugin upgrades
>   - Operating system upgrades
>- Were there any recent system configuration changes?
>   - Were settings increased on the system make it more secure or to
>   better defend it?
>
>
> --
> 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/7d818b09-f66f-4681-8163-2c1b26070e88n%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/CAN%2BS7NoH8%2BRrBagTjFp%3Dz5_HKvoPzdd%2B45bUVb2TX9K-bOeYBQ%40mail.gmail.com.


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

2022-12-05 Thread Mark Waite


On Monday, December 5, 2022 at 1:02:18 PM UTC-7 Madhu Muchukota wrote:

> Thanks Mark 
>
> All I'm doing is just triggering/running a multi branch pipeline job from 
> the controller UI.
>
> I will be happy to share more information needed from my end. 
>
>
Unfortunately, somehow you have a failure mode that is different than the 
100,000+ Jenkins controllers around the world that are running with Java 
11.  I don't have any suggestions about what could be different.

Things that you could explore:

   - Does the same failure happen
  - on a different computer running the same configuration?
  - on a different computer running without Tomcat?
  - on the same computer running without Tomcat?
  - Were there recent upgrades to any components?
  - Core upgrade
  - Plugin upgrades
  - Operating system upgrades
   - Were there any recent system configuration changes?
  - Were settings increased on the system make it more secure or to 
  better defend it?
   

-- 
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/7d818b09-f66f-4681-8163-2c1b26070e88n%40googlegroups.com.


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

2022-12-05 Thread M.Madhusudana Reddy
Thanks Mark

All I'm doing is just triggering/running a multi branch pipeline job from
the controller UI.

I will be happy to share more information needed from my end.

I also looked at the compute resources of my controller node and don't see
any issues over there.

###

*** buffer overflow detected ***: /opt/apps/java/current_java/bin/java
terminated
=== Backtrace: =
/lib64/libc.so.6(__fortify_fail+0x37)[0x7f829c70b7a7]
/lib64/libc.so.6(+0x116922)[0x7f829c709922]
/lib64/libc.so.6(+0x118707)[0x7f829c70b707]
/lib64/libglib-2.0.so.0(g_spawn_sync+0x230)[0x7f821b6ec130]
/lib64/libglib-2.0.so.0(g_spawn_command_line_sync+0x75)[0x7f821b6ec805]
/lib64/libgio-2.0.so.0(+0xb2100)[0x7f821c07e100]
/lib64/libgio-2.0.so.0(g_dbus_address_get_for_bus_sync+0x340)[0x7f821c07fad0]
/lib64/libgio-2.0.so.0(+0xbf2fe)[0x7f821c08b2fe]
/lib64/libgio-2.0.so.0(g_bus_get_sync+0x56)[0x7f821c090c46]
/usr/lib64/gio/modules/libdconfsettings.so(+0x7b00)[0x7f821a512b00]
/usr/lib64/gio/modules/libdconfsettings.so(+0x7bed)[0x7f821a512bed]
/lib64/libglib-2.0.so.0(+0x48d47)[0x7f821b6a1d47]
/lib64/libglib-2.0.so.0(g_main_context_dispatch+0x159)[0x7f821b6a5119]
/lib64/libglib-2.0.so.0(+0x4c478)[0x7f821b6a5478]
/lib64/libglib-2.0.so.0(g_main_context_iteration+0x2c)[0x7f821b6a552c]
/usr/lib64/gio/modules/libdconfsettings.so(+0x7d6d)[0x7f821a512d6d]
/lib64/libglib-2.0.so.0(+0x735b0)[0x7f821b6cc5b0]
/lib64/libpthread.so.0(+0x7ea5)[0x7f829cdddea5]
/lib64/libc.so.6(clone+0x6d)[0x7f829c6f1b0d]
=== Memory map: 
68000-80163f000 rw-p  00:00 0
80163f000-84000 ---p  00:00 0
55c431546000-55c431547000 r-xp  fd:04 23498504
/opt/apps/java/jdk-11.0.17+8/bin/java
55c431747000-55c431748000 r--p 1000 fd:04 23498504
/opt/apps/java/jdk-11.0.17+8/bin/java
55c431748000-55c431749000 rw-p 2000 fd:04 23498504
/opt/apps/java/jdk-11.0.17+8/bin/java
55c41000-55c433755000 rw-p  00:00 0
 [heap]
7f8219509000-7f821950a000 ---p  00:00 0
7f821950a000-7f8219d0a000 rw-p  00:00 0
7f8219d0a000-7f8219d0b000 ---p  00:00 0
7f8219d0b000-7f821a50b000 rw-p  00:00 0
7f821a50b000-7f821a517000 r-xp  fd:00 33776740
/usr/lib64/gio/modules/libdconfsettings.so
7f821a517000-7f821a716000 ---p c000 fd:00 33776740
/usr/lib64/gio/modules/libdconfsettings.so
7f821a716000-7f821a717000 r--p b000 fd:00 33776740
/usr/lib64/gio/modules/libdconfsettings.so
7f821a717000-7f821a718000 rw-p c000 fd:00 33776740
/usr/lib64/gio/modules/libdconfsettings.so
7f821a718000-7f821a71c000 r-xp  fd:00 102553411
 /usr/lib64/libuuid.so.1.3.0
7f821a71c000-7f821a91b000 ---p 4000 fd:00 102553411
 /usr/lib64/libuuid.so.1.3.0
7f821a91b000-7f821a91c000 r--p 3000 fd:00 102553411
 /usr/lib64/libuuid.so.1.3.0
7f821a91c000-7f821a91d000 rw-p 4000 fd:00 102553411
 /usr/lib64/libuuid.so.1.3.0
7f821a91d000-7f821a959000 r-xp  fd:00 102553418
 /usr/lib64/libblkid.so.1.1.0
7f821a959000-7f821ab58000 ---p 0003c000 fd:00 102553418
 /usr/lib64/libblkid.so.1.1.0
7f821ab58000-7f821ab5b000 r--p 0003b000 fd:00 102553418
 /usr/lib64/libblkid.so.1.1.0
7f821ab5b000-7f821ab5c000 rw-p 0003e000 fd:00 102553418
 /usr/lib64/libblkid.so.1.1.0
7f821ab5c000-7f821ab5d000 rw-p  00:00 0
7f821ab5d000-7f821ab72000 r-xp  fd:00 103879708
 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f821ab72000-7f821ad71000 ---p 00015000 fd:00 103879708
 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f821ad71000-7f821ad72000 r--p 00014000 fd:00 103879708
 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f821ad72000-7f821ad73000 rw-p 00015000 fd:00 103879708
 /usr/lib64/libgcc_s-4.8.5-20150702.so.1
7f821ad73000-7f821adb3000 r-xp  fd:00 102553420
 /usr/lib64/libmount.so.1.1.0
7f821adb3000-7f821afb3000 ---p 0004 fd:00 102553420
 /usr/lib64/libmount.so.1.1.0
7f821afb3000-7f821afb4000 r--p 0004 fd:00 102553420
 /usr/lib64/libmount.so.1.1.0
7f821afb4000-7f821afb5000 rw-p 00041000 fd:00 102553420
 /usr/lib64/libmount.so.1.1.0
7f821afb5000-7f821afb6000 rw-p  00:00 0
7f821afb6000-7f821afcc000 r-xp  fd:00 103211987
 /usr/lib64/libresolv-2.17.so


#

Thanks
M.Madhu


On Mon, Dec 5, 2022 at 11:41 AM Mark Waite 
wrote:

>
>
> On Monday, December 5, 2022 at 10:29:49 AM UTC-7 Madhu Muchukota wrote:
>
>> Thanks Ivan and Dirk.
>>
>> My java version was jdk-11.0.16+8 and I updated this to the latest one in
>> JAVA 11 this morning which is jdk-11.0.17+8 and I still see the same error.
>>
>> Tomcat is of version 9.0.0.0
>> Jenkins is of version 2.375.1
>>
>>
> The message that you're seeing indicates that the Java process was killed
> by the operating system when the Java process performed an unsafe operation
> (buffer overflow).  The Java virtual machine works very hard to prevent
> Java programs from being able to perform unsafe operations.  There are some
> areas where Java allows unsafe operations (Java Native Interface, Java
> 

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

2022-12-05 Thread Mark Waite


On Monday, December 5, 2022 at 10:29:49 AM UTC-7 Madhu Muchukota wrote:

> Thanks Ivan and Dirk.
>
> My java version was jdk-11.0.16+8 and I updated this to the latest one in 
> JAVA 11 this morning which is jdk-11.0.17+8 and I still see the same error.
>
> Tomcat is of version 9.0.0.0
> Jenkins is of version 2.375.1
>
>
The message that you're seeing indicates that the Java process was killed 
by the operating system when the Java process performed an unsafe operation 
(buffer overflow).  The Java virtual machine works very hard to prevent 
Java programs from being able to perform unsafe operations.  There are some 
areas where Java allows unsafe operations (Java Native Interface, Java 
Native Runtime project ), but those are exceptional 
cases.  In almost all cases, buffer overflow failures should not happen in 
a Linux Java process.

If you can provide instructions so that others can duplicate the problem, 
the OpenJDK team and others are likely very interested in the conditions 
that cause the failure.

If your goal is to avoid the issue rather than investigate why it is 
failing, you might try running Jenkins without Tomcat.  If that still shows 
the issue, then you might try bisecting your most recent plugin updates to 
see if one of the recent plugin updates is associated with the change of 
behavior.

A process killed by buffer overflow is very rare in the Jenkins world and 
in the Java world.

Mark Waite
 

-- 
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/b2444171-95b2-45ed-8e9a-146407bc41dcn%40googlegroups.com.


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

2022-12-05 Thread M.Madhusudana Reddy
Thanks Ivan and Dirk.

My java version was jdk-11.0.16+8 and I updated this to the latest one in
JAVA 11 this morning which is jdk-11.0.17+8 and I still see the same error.

Tomcat is of version 9.0.0.0
Jenkins is of version 2.375.1



Thanks
M.Madhu


On Mon, Dec 5, 2022 at 12:32 AM 'Dirk Heinrichs' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Am Freitag, dem 02.12.2022 um 13:41 -0800 schrieb Madhu Muchukota:
>
> 5568a8c67000-5568a8c68000 r-xp  fd:04 17591637
> /opt/apps/java/jdk-11.0.16+8/bin/java
>
>
> You need to update to 11.0.17, it contains a fix.
>
> HTH...
>
> Dirk
>
> --
>
> *Dirk Heinrichs*
> Senior Systems Engineer, Delivery Pipeline
> OpenText ™ Discovery | Recommind
> *Phone*: +49 2226 15966 18
> *Email*: dhein...@opentext.com
> *Website*: www.recommind.de
> Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
> Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan,
> Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
> irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
> vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
> Weitergabe dieser Mail sind nicht gestattet.
>
> --
> 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/db34e239bf19b96d52f34e4974decbb06dc974ab.camel%40opentext.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/CAN%2BS7NoiXNSdKgQ0YxeWuNUGa71pkEawtcB2eiH%3DZQwpoDdhEg%40mail.gmail.com.


Re: Running Jenkins as a Service in RHEL 8

2022-12-05 Thread eric....@gmail.com
Not sure changing the home directory is the answer.  I think the true 
answer resides in how to allow the jenkins service to run in SELINUX...

On Monday, December 5, 2022 at 8:45:42 AM UTC-7 slide wrote:

> Jenkins switched to systemd "recently" check this page for how to change 
> env variables and such 
> https://www.jenkins.io/doc/book/system-administration/systemd-services/ 
>
> On Mon, Dec 5, 2022 at 8:40 AM eric@gmail.com  
> wrote:
>
>> Changing the JENKINS_HOME directory in that config file didn't work.  I 
>> got the same error some it's using that link somewhere else...
>>
>> Thanks,
>> Eric
>>
>> On Monday, December 5, 2022 at 8:09:31 AM UTC-7 eric@gmail.com wrote:
>>
>>> Hi All,
>>>
>>> I'm running into an issue running Jenkins as a service in RHEL 8 with 
>>> SELINUX running (I don't have a choice).  It seems since /var/lib/jenkins 
>>> is a symbolic link to /opt/jenkins, SELINUX doesn't want to allow running 
>>> the service from there.  Would it be acceptable to just change the value 
>>> for JENKINS_HOME to /opt/jenkins in /etc/sysconfig/jenkins?  Thanks!
>>>
>>>
>>> ]# journalctl -xe
>>>
>>>You can generate a 
>>> local policy module to allow this access.
>>>
>>>Do
>>>
>>>allow this access for 
>>> now by executing:
>>>
>>># ausearch -c 
>>> '(jenkins)' --raw | audit2allow -M my-jenkins
>>>
>>># semodule -X 300 -i 
>>> my-jenkins.pp
>>>
>>>
>>>
>>> Dec 02 10:45:03 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run(): 
>>> Set alarm timeout to 10
>>>
>>> Dec 02 10:45:03 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run(): 
>>> Cancel pending alarm
>>>
>>> Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: SELinux is preventing 
>>> /usr/lib/systemd/systemd from read access on the lnk_file /var/lib/jenkins. 
>>> For com>
>>>
>>> Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: SELinux is preventing 
>>> /usr/lib/systemd/systemd from read access on the lnk_file /var/lib/jenkins.
>>>
>>>
>>>
>>>*  Plugin 
>>> catchall_labels (83.8 confidence) suggests   ***
>>>
>>>
>>>
>>>If you want to allow 
>>> systemd to have read access on the jenkins lnk_file
>>>
>>>Then you need to 
>>> change the label on /var/lib/jenkins
>>>
>>>Do
>>>
>>># semanage fcontext 
>>> -a -t FILE_TYPE '/var/lib/jenkins'
>>>
>>>where FILE_TYPE is 
>>> one of the following: NetworkManager_etc_rw_t, NetworkManager_etc_t, 
>>> NetworkManager_un>
>>>
>>>Then execute:
>>>
>>>restorecon -v 
>>> '/var/lib/jenkins'
>>>
>>>
>>>
>>>
>>>
>>>*  Plugin 
>>> catchall (17.1 confidence) suggests   **
>>>
>>>
>>>
>>>If you believe that 
>>> systemd should be allowed read access on the jenkins lnk_file by default.
>>>
>>>Then you should 
>>> report this as a bug.
>>>
>>>You can generate a 
>>> local policy module to allow this access.
>>>
>>>Do
>>>
>>>allow this access for 
>>> now by executing:
>>>
>>># ausearch -c 
>>> '(jenkins)' --raw | audit2allow -M my-jenkins
>>>
>>># semodule -X 300 -i 
>>> my-jenkins.pp
>>>
>>>
>>>
>>> Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run(): 
>>> Set alarm timeout to 10
>>>
>>> Dec 02 10:45:18 nd655bd001 systemd[1]: setroubleshootd.service: 
>>> Succeeded.
>>>
>>> -- Subject: Unit succeeded
>>>
>>> -- Defined-By: systemd
>>>
>>> -- Support: https://access.redhat.com/support 
>>> 

Re: Host key verification failed

2022-12-05 Thread Edward Rolison
I had this issue, and found the workaround was to run 'ssh-keyscan' and add
_all_ the keys to the '.ssh/known_hosts' file.



On Mon, 5 Dec 2022 at 12:45, 'Dirk Heinrichs' via Jenkins Users <
jenkinsci-users@googlegroups.com> wrote:

> Am Montag, dem 05.12.2022 um 18:03 +0530 schrieb Ram R:
>
> you need to check in the ssh plugin username and password
>
>
> Why? The error message clearly says "*HOST* key verification failed".
>
> Bye...
>
> Dirk
>
> --
>
> *Dirk Heinrichs*
> Senior Systems Engineer, Delivery Pipeline
> OpenText ™ Discovery | Recommind
> *Phone*: +49 2226 15966 18
> *Email*: dhein...@opentext.com
> *Website*: www.recommind.de
> Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
> Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan,
> Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden
> Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
> irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und
> vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
> Weitergabe dieser Mail sind nicht gestattet.
>
> --
> 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/1607c084d2525dbc1a0b9ff37ada836923294c11.camel%40opentext.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/CAJLp5qhe6bqLtEgkdexfXF9hy5vZ-QXcQ2PsXvQ8onKLsCVLtQ%40mail.gmail.com.


Re: Running Jenkins as a Service in RHEL 8

2022-12-05 Thread Alex Earl
Jenkins switched to systemd "recently" check this page for how to change
env variables and such
https://www.jenkins.io/doc/book/system-administration/systemd-services/

On Mon, Dec 5, 2022 at 8:40 AM eric@gmail.com 
wrote:

> Changing the JENKINS_HOME directory in that config file didn't work.  I
> got the same error some it's using that link somewhere else...
>
> Thanks,
> Eric
>
> On Monday, December 5, 2022 at 8:09:31 AM UTC-7 eric@gmail.com wrote:
>
>> Hi All,
>>
>> I'm running into an issue running Jenkins as a service in RHEL 8 with
>> SELINUX running (I don't have a choice).  It seems since /var/lib/jenkins
>> is a symbolic link to /opt/jenkins, SELINUX doesn't want to allow running
>> the service from there.  Would it be acceptable to just change the value
>> for JENKINS_HOME to /opt/jenkins in /etc/sysconfig/jenkins?  Thanks!
>>
>>
>> ]# journalctl -xe
>>
>>You can generate a
>> local policy module to allow this access.
>>
>>Do
>>
>>allow this access for
>> now by executing:
>>
>># ausearch -c
>> '(jenkins)' --raw | audit2allow -M my-jenkins
>>
>># semodule -X 300 -i
>> my-jenkins.pp
>>
>>
>>
>> Dec 02 10:45:03 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run():
>> Set alarm timeout to 10
>>
>> Dec 02 10:45:03 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run():
>> Cancel pending alarm
>>
>> Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: SELinux is preventing
>> /usr/lib/systemd/systemd from read access on the lnk_file /var/lib/jenkins.
>> For com>
>>
>> Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: SELinux is preventing
>> /usr/lib/systemd/systemd from read access on the lnk_file /var/lib/jenkins.
>>
>>
>>
>>*  Plugin
>> catchall_labels (83.8 confidence) suggests   ***
>>
>>
>>
>>If you want to allow
>> systemd to have read access on the jenkins lnk_file
>>
>>Then you need to
>> change the label on /var/lib/jenkins
>>
>>Do
>>
>># semanage fcontext -a
>> -t FILE_TYPE '/var/lib/jenkins'
>>
>>where FILE_TYPE is one
>> of the following: NetworkManager_etc_rw_t, NetworkManager_etc_t,
>> NetworkManager_un>
>>
>>Then execute:
>>
>>restorecon -v
>> '/var/lib/jenkins'
>>
>>
>>
>>
>>
>>*  Plugin catchall
>> (17.1 confidence) suggests   **
>>
>>
>>
>>If you believe that
>> systemd should be allowed read access on the jenkins lnk_file by default.
>>
>>Then you should report
>> this as a bug.
>>
>>You can generate a
>> local policy module to allow this access.
>>
>>Do
>>
>>allow this access for
>> now by executing:
>>
>># ausearch -c
>> '(jenkins)' --raw | audit2allow -M my-jenkins
>>
>># semodule -X 300 -i
>> my-jenkins.pp
>>
>>
>>
>> Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run():
>> Set alarm timeout to 10
>>
>> Dec 02 10:45:18 nd655bd001 systemd[1]: setroubleshootd.service: Succeeded.
>>
>> -- Subject: Unit succeeded
>>
>> -- Defined-By: systemd
>>
>> -- Support: https://access.redhat.com/support
>> 
>>
>> --
>>
>> -- The unit setroubleshootd.service has successfully entered the 'dead'
>> state.
>>
>> lines 5338-5376/5376 (END)
>>
> --
> 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/0c57cbc8-8b60-4f6b-852a-bc892b97af38n%40googlegroups.com
> 

Re: Running Jenkins as a Service in RHEL 8

2022-12-05 Thread eric....@gmail.com
Changing the JENKINS_HOME directory in that config file didn't work.  I got 
the same error some it's using that link somewhere else...

Thanks,
Eric

On Monday, December 5, 2022 at 8:09:31 AM UTC-7 eric@gmail.com wrote:

> Hi All,
>
> I'm running into an issue running Jenkins as a service in RHEL 8 with 
> SELINUX running (I don't have a choice).  It seems since /var/lib/jenkins 
> is a symbolic link to /opt/jenkins, SELINUX doesn't want to allow running 
> the service from there.  Would it be acceptable to just change the value 
> for JENKINS_HOME to /opt/jenkins in /etc/sysconfig/jenkins?  Thanks!
>
>
> ]# journalctl -xe
>
>You can generate a 
> local policy module to allow this access.
>
>Do
>
>allow this access for 
> now by executing:
>
># ausearch -c 
> '(jenkins)' --raw | audit2allow -M my-jenkins
>
># semodule -X 300 -i 
> my-jenkins.pp
>
>
>
> Dec 02 10:45:03 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run(): 
> Set alarm timeout to 10
>
> Dec 02 10:45:03 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run(): 
> Cancel pending alarm
>
> Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: SELinux is preventing 
> /usr/lib/systemd/systemd from read access on the lnk_file /var/lib/jenkins. 
> For com>
>
> Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: SELinux is preventing 
> /usr/lib/systemd/systemd from read access on the lnk_file /var/lib/jenkins.
>
>
>
>*  Plugin 
> catchall_labels (83.8 confidence) suggests   ***
>
>
>
>If you want to allow 
> systemd to have read access on the jenkins lnk_file
>
>Then you need to change 
> the label on /var/lib/jenkins
>
>Do
>
># semanage fcontext -a 
> -t FILE_TYPE '/var/lib/jenkins'
>
>where FILE_TYPE is one 
> of the following: NetworkManager_etc_rw_t, NetworkManager_etc_t, 
> NetworkManager_un>
>
>Then execute:
>
>restorecon -v 
> '/var/lib/jenkins'
>
>
>
>
>
>*  Plugin catchall 
> (17.1 confidence) suggests   **
>
>
>
>If you believe that 
> systemd should be allowed read access on the jenkins lnk_file by default.
>
>Then you should report 
> this as a bug.
>
>You can generate a 
> local policy module to allow this access.
>
>Do
>
>allow this access for 
> now by executing:
>
># ausearch -c 
> '(jenkins)' --raw | audit2allow -M my-jenkins
>
># semodule -X 300 -i 
> my-jenkins.pp
>
>
>
> Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run(): 
> Set alarm timeout to 10
>
> Dec 02 10:45:18 nd655bd001 systemd[1]: setroubleshootd.service: Succeeded.
>
> -- Subject: Unit succeeded
>
> -- Defined-By: systemd
>
> -- Support: https://access.redhat.com/support 
> 
>
> -- 
>
> -- The unit setroubleshootd.service has successfully entered the 'dead' 
> state.
>
> lines 5338-5376/5376 (END)
>

-- 
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/0c57cbc8-8b60-4f6b-852a-bc892b97af38n%40googlegroups.com.


Running Jenkins as a Service in RHEL 8

2022-12-05 Thread eric....@gmail.com
Hi All,

I'm running into an issue running Jenkins as a service in RHEL 8 with 
SELINUX running (I don't have a choice).  It seems since /var/lib/jenkins 
is a symbolic link to /opt/jenkins, SELINUX doesn't want to allow running 
the service from there.  Would it be acceptable to just change the value 
for JENKINS_HOME to /opt/jenkins in /etc/sysconfig/jenkins?  Thanks!


]# journalctl -xe

   You can generate a local 
policy module to allow this access.

   Do

   allow this access for 
now by executing:

   # ausearch -c 
'(jenkins)' --raw | audit2allow -M my-jenkins

   # semodule -X 300 -i 
my-jenkins.pp

   

Dec 02 10:45:03 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run(): Set 
alarm timeout to 10

Dec 02 10:45:03 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run(): 
Cancel pending alarm

Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: SELinux is preventing 
/usr/lib/systemd/systemd from read access on the lnk_file /var/lib/jenkins. 
For com>

Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: SELinux is preventing 
/usr/lib/systemd/systemd from read access on the lnk_file /var/lib/jenkins.

   

   *  Plugin 
catchall_labels (83.8 confidence) suggests   ***

   

   If you want to allow 
systemd to have read access on the jenkins lnk_file

   Then you need to change 
the label on /var/lib/jenkins

   Do

   # semanage fcontext -a 
-t FILE_TYPE '/var/lib/jenkins'

   where FILE_TYPE is one 
of the following: NetworkManager_etc_rw_t, NetworkManager_etc_t, 
NetworkManager_un>

   Then execute:

   restorecon -v 
'/var/lib/jenkins'

   

   

   *  Plugin catchall 
(17.1 confidence) suggests   **

   

   If you believe that 
systemd should be allowed read access on the jenkins lnk_file by default.

   Then you should report 
this as a bug.

   You can generate a local 
policy module to allow this access.

   Do

   allow this access for 
now by executing:

   # ausearch -c 
'(jenkins)' --raw | audit2allow -M my-jenkins

   # semodule -X 300 -i 
my-jenkins.pp

   

Dec 02 10:45:07 nd655bd001 setroubleshoot[144816]: AnalyzeThread.run(): Set 
alarm timeout to 10

Dec 02 10:45:18 nd655bd001 systemd[1]: setroubleshootd.service: Succeeded.

-- Subject: Unit succeeded

-- Defined-By: systemd

-- Support: https://access.redhat.com/support 


-- 

-- The unit setroubleshootd.service has successfully entered the 'dead' 
state.

lines 5338-5376/5376 (END)

-- 
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/8ce021ab-d787-4fe3-96d5-d5476a4aac75n%40googlegroups.com.


Re: Copy To Slave plugin error

2022-12-05 Thread 'Daniel Beck' via Jenkins Users
On Mon, Dec 5, 2022 at 1:55 PM ekambaram varathan 
wrote:

> I am using jenkins 2.361.2 version and i have "Copy to Slave" plugin
> version 1.4.4 .
> …
> FATAL: hudson/org/apache/tools/tar/TarInputStream
> java.lang.ClassNotFoundException:
> hudson.org.apache.tools.tar.TarInputStream…
> Please let me know what would be the cause for this error.
>

The plugin is incompatible with Jenkins 2.318 and newer and hasn't been
distributed by the Jenkins project since early 2018. I recommend you look
into alternative solutions for what you're currently using it for.

-- 
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/CAMo7Pt%2B4sPE83iUMCKTNUuRtzGcoSyKmW3tBuYtq_UMDEWx2gA%40mail.gmail.com.


Re: Need to re trigger if the Jenkins job fail for scheduled job

2022-12-05 Thread opayq-gg
Hi,

you could check if a Conditional Build Step helps you (you might need to 
install the corresponding plugin): Jenkins sets an environment variable with 
the trigger cause, you might be able to use that.

On 5 December 2022 09:37:36 CET, Praju  wrote:
>Hi,
>To achieve (Re trigger if the Jenkins job fail when it is  scheduled job  ) 
>this one I am Enabling *Retry build after failure in *post build action but 
>it will re trigger if we run manually also. Can any one suggest how to re 
>trigger job if fail when it is scheduler.  
>
>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/fc7f9e0a-d44b-4bc7-a94e-081fb8b3dbc3n%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/BD1A0B48-D5C1-41D6-8F93-BB175A684B9C%40chsc.de.


Cannot read keys when either application does not have a console or when console input has been redirected. Try Console.Read.

2022-12-05 Thread Uttam K
Hello All,

Getting below error while executing .exe from Jenkins pipeline where as i 
am able to execute the same command from cmd console from the agent.

Error Message:
Cannot read keys when either application does not have a console or when 
console input has been redirected. Try Console.Read.


-- 
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/d1f31767-bbf3-4899-aa60-35a6ef10a489n%40googlegroups.com.


Copy To Slave plugin error

2022-12-05 Thread ekambaram varathan
I am using jenkins 2.361.2 version and i have "Copy to Slave" plugin 
version 1.4.4 .
Currently i have problem with copy files slave host. my jenkins job always 
fails with below error:

Building remotely on slave_linux01 in workspace 
/var/jenkins/slave/workspace/Copy_to_Slave
[copy-to-slave] Copying 'data/**,jobs/configuration', excluding nothing, 
from 'file:/var/jenkins/' on the master to 
'file:/var/jenkins/slave/workspace/Copy_to_Slave/' on 'slave_linux01'.
FATAL: hudson/org/apache/tools/tar/TarInputStream
java.lang.ClassNotFoundException: hudson.org.apache.tools.tar.TarInputStream
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:476)
at jenkins.util.URLClassLoader2.findClass(URLClassLoader2.java:35)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:589)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
Caused: java.lang.NoClassDefFoundError: 
hudson/org/apache/tools/tar/TarInputStream
at 
com.michelin.cio.hudson.plugins.copytoslave.CopyToSlaveBuildWrapper.setUp(CopyToSlaveBuildWrapper.java:133)
at hudson.model.Build$BuildExecution.doRun(Build.java:158)
at 
hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:524)
at hudson.model.Run.execute(Run.java:1899)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
at hudson.model.ResourceController.execute(ResourceController.java:107)
at hudson.model.Executor.run(Executor.java:449)
Finished: FAILURE

Please let me know what would be the cause for this error.

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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/871a1cac-afa1-444e-9886-ff894f1fa612n%40googlegroups.com.


Re: Host key verification failed

2022-12-05 Thread 'Dirk Heinrichs' via Jenkins Users
Am Montag, dem 05.12.2022 um 18:03 +0530 schrieb Ram R:

you need to check in the ssh plugin username and password

Why? The error message clearly says "HOST key verification failed".

Bye...

Dirk

--

Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Phone: +49 2226 15966 18
Email: dhein...@opentext.com
Website: 
www.recommind.de
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, 
Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht 
gestattet.

-- 
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/1607c084d2525dbc1a0b9ff37ada836923294c11.camel%40opentext.com.


Re: Host key verification failed

2022-12-05 Thread 'Dirk Heinrichs' via Jenkins Users
Am Montag, dem 05.12.2022 um 17:55 +0530 schrieb pooja pooja:

While executing my job am getting below error can anyone help me on this issue?

No screenshots, please. Copy/paste is far anyway.

The problem seems to be in the script that is called. It seems to try to make 
an SSH connection to a remote host of which the key has not been accepted, yet 
(on the host that is running the job/stage).

HTH,

Dirk

--

Dirk Heinrichs
Senior Systems Engineer, Delivery Pipeline
OpenText ™ Discovery | Recommind
Phone: +49 2226 15966 18
Email: dhein...@opentext.com
Website: 
www.recommind.de
Recommind GmbH, Von-Liebig-Straße 1, 53359 Rheinbach
Vertretungsberechtigte Geschäftsführer Gordon Davies, Madhu Ranganathan, 
Christian Waida, Registergericht Amtsgericht Bonn, Registernummer HRB 10646
This e-mail may contain confidential and/or privileged information. If you are 
not the intended recipient (or have received this e-mail in error) please 
notify the sender immediately and destroy this e-mail. Any unauthorized 
copying, disclosure or distribution of the material in this e-mail is strictly 
forbidden
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. 
Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten 
haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. 
Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail sind nicht 
gestattet.

-- 
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/88b30b5819a0c450769e6866a2830ed2d9f14ac7.camel%40opentext.com.


Re: Host key verification failed

2022-12-05 Thread Ram R
 I think you need to check in the ssh plugin username and password in
jenkins, there should be a connection issue.

Ramkrishna
9652540292



On Mon, Dec 5, 2022 at 5:55 PM pooja pooja  wrote:

> Hi all,
> While executing my job am getting below error can anyone help me on this
> issue?
>
> --
> 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/CANJUvtzQjRury4Ywu3AUwHV3L9a0a78niHcRV0OoV_wa6YBAQA%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/CABNk%2BKd1RKHgnNuNPtbEGYwm5bMV78tADaGS8Pb0ouqRJzwFpw%40mail.gmail.com.


Re: substituting different credentials() in a multibranch pipeline depending on branch

2022-12-05 Thread Arnaud bourree
Hi,

So many ways to do the same:
- have credentials name with branch name in (my personal choise)
- define a pipeline method to switch/read map
- imbrication of ternary operator

Arnaud

Le lun. 5 déc. 2022, 10:11, Victor Sudakov  a écrit :

> What would you do if you needed multiple branches with multiple choices of
> variables, like a "case" or "if ... else ... elif" operators?
> On 02.12.2022 13:33, Arnaud bourree wrote:
>
> environment {
>
>   SERVICE_KEY = credentials("${env.BRANCH_NAME.equals('master') ?
> 'PROD_SERVICE_KEY' : 'SERVICE_KEY'}")
>
> Le ven. 2 déc. 2022, 03:05, Victor Sudakov  a écrit :
>
>> Hello Arnaud,
>>
>> Can you please post the whole line within environment{} as you suggest it
>> should look?
>> On 02.12.2022 03:47, Arnaud bourree wrote:
>>
>> Hi,
>>
>> env.master'.equals(env.BRANCH_NAME) is String as 'master' is.
>> Try 'master'.equals(env.BRANCH_NAME) instead of
>> env.BRANCH_NAME == 'master'
>>
>> Le mer. 30 nov. 2022, 05:24, Victor Sudakov  a écrit :
>>
>>> This syntax may be operational, but I need more testing:
>>>
>>> environment {
>>>
>>>   SERVICE_KEY = credentials("${env.BRANCH_NAME == 'master' ?
>>> 'PROD_SERVICE_KEY' : 'SERVICE_KEY'}")
>>>
>>> }
>>>
>>>
>>> On 30.11.2022 09:53, Victor Sudakov wrote:
>>>
>>> Have you tested your suggestion?
>>>
>>> For me,
>>>
>>> SERVICE_KEY_S = credentials(env.BRANCH_NAME == 'STAGE-NOV28' ?
>>> 'SERVICE_KEY' : 'PROD_SERVICE_KEY')
>>>
>>> thows the error:
>>>
>>> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
>>> failed:
>>> WorkflowScript: 40: Internal function call parameters must be strings. @
>>> line 40, column 32.
>>>SERVICE_KEY_S = credentials(env.BRANCH_NAME == 'STAGE-NOV28' ?
>>> 'SERVICE_KEY' : 'PROD_SERVICE_KEY')
>>>
>>> I have also tried this syntax (found in the Internet somewhere):
>>>
>>> MYTESTVAR = "${env.BRANCH_NAME == "main" ?
>>> "credentials('PROD_SERVICE_KEY')" : "credentials('SERVICE_KEY')"}"
>>>
>>> and it does not work either. Maybe the issue is with single or double
>>> quotes. Anyway, a real-life working example is very welcome.
>>> On 30.11.2022 06:36, James Nord wrote:
>>>
>>> Try
>>>
>>> credentials(env.BRANCH_NAME='main' ? 'PROD_CLIENT_ID' : 'DEV...')
>>>
>>> or some syntax like that..
>>>
>>> On Mon, 28 Nov 2022, 06:05 Victor Sudakov,  wrote:
>>>
 Dear Colleagues,

 Can you please suggest a way to use different credentials depending on
 the Git
 branch in a multi-branch pipeline? In other words, I would like to have

 pipeline {
   environment {
 CLIENT_ID = credentials('PROD_CLIENT_ID')
   }
 ...
 }

 if the Git branch is "main" and

 pipeline {
   environment {
 CLIENT_ID = credentials('DEV_CLIENT_ID')
   }
 ...
 }

 if the Git branch is "dev", or even "*".

 What would be the correct Groovy syntax to substitute "PROD_CLIENT_ID"
 or
 "DEV_CLIENT_ID" depending on the branch name?

 --
 Victor Sudakov
 Systems Administrator
 Streamline - Property Management Software
 Website: www.streamlinevrs.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/Y4ROJK3SmJsTTxhz%40vrs6.4vrs.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/CAPzq3pemjoPXo%3DcCeC9oEwdNhD88VqXM6BvBRbZUsQoba172jw%40mail.gmail.com
>>> 
>>> .
>>>
>>> --
>>> Victor Sudakov
>>> Systems Administrator
>>> Streamline - Property Management Software
>>> Website: www.streamlinevrs.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/01f47251-a69e-039c-68c2-7377f902768e%404vrs.com
>>> 
>>> .
>>>
>>> --
>>> Victor Sudakov
>>> Systems Administrator
>>> Streamline - Property Management Software
>>> Website: www.streamlinevrs.com
>>>
>>> --
>>> You received this message because you are subscribed 

Re: substituting different credentials() in a multibranch pipeline depending on branch

2022-12-05 Thread Victor Sudakov
What would you do if you needed multiple branches with multiple choices 
of variables, like a "case" or "if ... else ... elif" operators?


On 02.12.2022 13:33, Arnaud bourree wrote:


environment {

  SERVICE_KEY = credentials("${env.BRANCH_NAME.equals('master') ? 
'PROD_SERVICE_KEY' : 'SERVICE_KEY'}")



Le ven. 2 déc. 2022, 03:05, Victor Sudakov  a écrit :

Hello Arnaud,

Can you please post the whole line within environment{} as you
suggest it should look?

On 02.12.2022 03:47, Arnaud bourree wrote:

Hi,

env.master'.equals(env.BRANCH_NAME) is String as 'master' is.
Try 'master'.equals(env.BRANCH_NAME) instead of
env.BRANCH_NAME == 'master'

Le mer. 30 nov. 2022, 05:24, Victor Sudakov  a écrit :

This syntax may be operational, but I need more testing:

environment {

  SERVICE_KEY = credentials("${env.BRANCH_NAME == 'master' ?
'PROD_SERVICE_KEY' : 'SERVICE_KEY'}")

}


On 30.11.2022 09:53, Victor Sudakov wrote:


Have you tested your suggestion?

For me,

SERVICE_KEY_S = credentials(env.BRANCH_NAME == 'STAGE-NOV28'
? 'SERVICE_KEY' : 'PROD_SERVICE_KEY')

thows the error:

org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed:
WorkflowScript: 40: Internal function call parameters must
be strings. @ line 40, column 32.
   SERVICE_KEY_S = credentials(env.BRANCH_NAME ==
'STAGE-NOV28' ? 'SERVICE_KEY' : 'PROD_SERVICE_KEY')

I have also tried this syntax (found in the Internet somewhere):

MYTESTVAR = "${env.BRANCH_NAME == "main" ?
"credentials('PROD_SERVICE_KEY')" :
"credentials('SERVICE_KEY')"}"

and it does not work either. Maybe the issue is with single
or double quotes. Anyway, a real-life working example is
very welcome.

On 30.11.2022 06:36, James Nord wrote:

Try

credentials(env.BRANCH_NAME='main' ? 'PROD_CLIENT_ID' :
'DEV...')

or some syntax like that..

On Mon, 28 Nov 2022, 06:05 Victor Sudakov, 
wrote:

Dear Colleagues,

Can you please suggest a way to use different
credentials depending on the Git
branch in a multi-branch pipeline? In other words, I
would like to have

pipeline {
  environment {
    CLIENT_ID = credentials('PROD_CLIENT_ID')
  }
...
}

if the Git branch is "main" and

pipeline {
  environment {
    CLIENT_ID = credentials('DEV_CLIENT_ID')
  }
...
}

if the Git branch is "dev", or even "*".

What would be the correct Groovy syntax to substitute
"PROD_CLIENT_ID" or
"DEV_CLIENT_ID" depending on the branch name?

-- 
Victor Sudakov

Systems Administrator
Streamline - Property Management Software
Website: www.streamlinevrs.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/Y4ROJK3SmJsTTxhz%40vrs6.4vrs.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/CAPzq3pemjoPXo%3DcCeC9oEwdNhD88VqXM6BvBRbZUsQoba172jw%40mail.gmail.com

.
-- 
Victor Sudakov

Systems Administrator
Streamline - Property Management Software
Website:www.streamlinevrs.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/01f47251-a69e-039c-68c2-7377f902768e%404vrs.com


Need to re trigger if the Jenkins job fail for scheduled job

2022-12-05 Thread Praju
Hi,
To achieve (Re trigger if the Jenkins job fail when it is  scheduled job  ) 
this one I am Enabling *Retry build after failure in *post build action but 
it will re trigger if we run manually also. Can any one suggest how to re 
trigger job if fail when it is scheduler.  

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/fc7f9e0a-d44b-4bc7-a94e-081fb8b3dbc3n%40googlegroups.com.