jenkins_home, docker, upgrades

2020-12-07 Thread Ewelina Wilkosz

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?

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

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/97993ad1-85da-489b-9d8c-ebb436fb6b79n%40googlegroups.com.


Re: hostPathVolume not mounting on Kubernetes pods(Dynamic Jenkins Agent)

2020-12-07 Thread Ujjawal Khare
Great...if you want it to work on other versions...then play with alpine
version..(try with latest first...) your u are using in your docker
container

On Mon, 7 Dec 2020, 10:26 Mohan,  wrote:

> Thanks Ujjawal. I have upgraded my docker image from Ubuntu 16.04.6 LTS -
> 3.10.0-1160.6.1.el7.x86_64 to Ubuntu 16.04.7 to 3.10.0-1160.6.1.el7.x86_64
> still didn't work. But it seems Kubernetes on CentOS-7.9 & with
> Kernal-3.10.0-1160.6.1.el7.x86_64 is having a kernel specific issue. So I
> have upgraded my native host's OS to CentOS-8.2 with -
> 4.18.0-193.28.1.el8_2.x86_64 kernel, Now my pipeline build is working
> fine.
>
> On Sat, Dec 5, 2020 at 7:09 PM Ujjawal Khare 
> wrote:
>
>> Great and if it again works on older CentOS then please try to update
>> your alpine to latest version.
>>
>> I am sure then it will start working on latest CentOS too.
>>
>> We recently faced similar issue with elasticsearch 7 and then it got
>> fixed after we updated Alpin.
>>
>> On Sat, 5 Dec 2020, 19:06 Mohan,  wrote:
>>
>>> Acutally have tried with Ubuntu-16.04-LTS image aswell even in that also
>>> same issue.
>>>
>>> Sure next will try with K8s host's native OS CentOS- 7.8(It was working
>>> earlier).
>>>
>>> On Sat, 5 Dec 2020, 6:45 pm Ujjawal Khare, 
>>> wrote:
>>>
>>> The issue may be because of kernel version. Old alpine seems to be
 having issue with it.

 Can you try same on an older version of CentOS..?

 Or try to use latest version of alpine.

 Regards,
 Ujjawal

 On Sat, 5 Dec 2020, 09:19 Mk,  wrote:

> *Environment: *
> Jenkins - Version 2.235.5  (LTS)
> Kubernetes Jenkins Plugin - 1.27.7
> 
>
> *K8s-Master & Worker Server Details:- *
> OS - CentOS Linux release 7.9.2009 (Core) & Kernal -
> 3.10.0-1160.6.1.el7.x86_64
> Docker Version - 19.03.12
> Client Version: v1.19.0
> Server Version: v1.19.0
>
> I am trying to mount a *hostPathVolume *through Jenkins
> Kubernetes-plugin *podTemplate *and when the pod gets kicked off via
> Jenkins master the path of my K8s worker not getting mounted on K8s
> pods(Jenkins Agent).
>
> I have the below podTemplate
>
> podTemplate(containers: [
> containerTemplate(name: 'build', image: 'alpine/git', ttyEnabled:
> true, command: 'cat'),
> containerTemplate(name: 'test', image: 'maven:3.3.9-jdk-8-alpine',
> command: 'cat', ttyEnabled: true),
> ],
> volumes: [
> hostPathVolume(mountPath: '/home/jenkins', hostPath:
> '/test-vol/abc/workspace'),
> ]
> ) {
> node ("jenkins-node") {
> stage('Code Checkout') {
> checkout([$class: 'GitSCM', branches: [[name: '*/master']],
> doGenerateSubmoduleConfigurations: false, extensions: [[$class:
> 'CloneOption', depth: 0, noTags: false, reference: '', shallow: false,
> timeout: 120]], submoduleCfg: [], userRemoteConfigs: [[url:
> 'ssh://userid@gerrit-server:29418/abc/repository']]])
> }
> }
> node(POD_LABEL) {
> stage('Build') {
> container('build') {
> sh label: '', script: '''cd /home/jenkins/Jenkins_Job/project/src/
> mvn clean install'''
> }
> stage('Test') {
> container('test') {
> sh label: '', script: '''cd /home/jenkins/Jenkins_Job/project/src/
> mvn test'''
> }
> }
> }
> }
> }
> I expect the volume to be mounted in my pod, I have tried with *K8s
> v1.19.4* and *Kubernetes Jenkins Plugin - 1.27.0* but same result.
> Not sure what is causing the problem on *CentOS-7.9* K8s. Whereas the
> same is working perfectly on *CentOS - 8.2.2004 (Core) &
> 4.18.0-193.14.2.el8_2.x86_64 kernal. *
>
> --
> 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/73c67b12-bea5-4e9b-b51a-0acf83f1bd76n%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/CAEVfYmjK%2BSgtKV28mko9YOCY4dFZoytmwxdKPorRTWMcQ7oRuw%40mail.gmail.com
 
 .

>>> --
>>> You re

Re: Dynamic Jenkins file

2020-12-07 Thread Mark Waite
On Mon, Dec 7, 2020 at 4:24 AM Ven H  wrote:

> Is it possible to define everything including SharedLibrary method names
> for call, parameters, stages, steps etc in a yml file and call during
> execution? I want to create a generic Jenkinsfile, which will load &
> execute everything based on the yml data. Please advise.
>
>
Pipeline as YAML plugin  may
help.  The Jenkins Online Meetup video 
provides an introduction as well.

-- 
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/CAO49JtG0OH-91-UtpN0PQ6C64Gr6aML6ZP9CAKUw6CCoo4Wu5g%40mail.gmail.com.


Dynamic Jenkins file

2020-12-07 Thread Ven H
Is it possible to define everything including SharedLibrary method names
for call, parameters, stages, steps etc in a yml file and call during
execution? I want to create a generic Jenkinsfile, which will load &
execute everything based on the yml data. Please advise.

-- 
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/CAPp28er6s%3DJYiaZKxbHoJDZAPoqRAQd6sFFrjF%3DnK7cHTxgPCA%40mail.gmail.com.


Re: Jenkins unable to read config.xml: hudson.security.GlobalMatrixAuthorizationStrategy hudson.security.LDAPSecurityRealm

2020-12-07 Thread Adrian Wyssmann
Thanks @Daniel. In meanwhile we have seen that there was a screw-up with 
the plugins. I basically disabled  
.. and 
.. in the config,xml which helped us us to 
properly access the UI 
We have then seen that there were a lot of plugin incompatibilities and 
thus a lot of plugins not loaded. Restoring all plugins solved the issue.

What causes the problem is still further investigated but we suspect an 
improper update - the server is air-gapped so plugins have to be manually 
updated and not via the update mechanism of jenkins

On Monday, December 7, 2020 at 11:23:29 AM UTC+1 db...@cloudbees.com wrote:

> You're using https://plugins.jenkins.io/role-strategy/ and that plugin is 
> not installed, disabled, or unloadable. Check the log to find out which, 
> then address the problem.
>
> On Mon, Dec 7, 2020 at 8:40 AM Adrian Wyssmann  wrote:
>
>> Hi all
>>
>> Today we are suddenly facing issues with ldap plugin
>>
>> com.thoughtworks.xstream.mapper.CannotResolveClassException: 
>> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy 
>> at 
>> com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74) 
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:379) at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:43) at 
>> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
>>  
>> at 
>> com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:48)
>>  
>> at 
>> hudson.util.RobustReflectionConverter.determineType(RobustReflectionConverter.java:476)
>>  
>> at 
>> hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:326)
>>  
>> Caused: jenkins.util.xstream.CriticalXStreamException: 
>> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy 
>> : 
>> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy 
>>  Debugging information  message : 
>> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy 
>> cause-exception : 
>> com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message : 
>> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy 
>> class : hudson.model.Hudson required-type : hudson.model.Hudson 
>> converter-type : hudson.util.RobustReflectionConverter path : 
>> /hudson/authorizationStrategy line number : 14 version : not available  
>>
>> The issue is also described at 
>> https://stackoverflow.com/questions/55429268/jenkins-unable-to-read-config-xml-hudson-security-globalmatrixauthorizationstra,
>>  
>> however the solution described there does not really help me.
>>
>> -- 
>> You received thi

Re: Jenkins unable to read config.xml: hudson.security.GlobalMatrixAuthorizationStrategy hudson.security.LDAPSecurityRealm

2020-12-07 Thread Daniel Beck
You're using https://plugins.jenkins.io/role-strategy/ and that plugin is
not installed, disabled, or unloadable. Check the log to find out which,
then address the problem.

On Mon, Dec 7, 2020 at 8:40 AM Adrian Wyssmann  wrote:

> Hi all
>
> Today we are suddenly facing issues with ldap plugin
>
> com.thoughtworks.xstream.mapper.CannotResolveClassException:
> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy
> at
> com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.SecurityMapper.realClass(SecurityMapper.java:71)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at hudson.util.XStream2$CompatibilityMapper.realClass(XStream2.java:379) at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at hudson.util.xstream.MapperDelegate.realClass(MapperDelegate.java:43) at
> com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
> at
> com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:48)
> at
> hudson.util.RobustReflectionConverter.determineType(RobustReflectionConverter.java:476)
> at
> hudson.util.RobustReflectionConverter.doUnmarshal(RobustReflectionConverter.java:326)
> Caused: jenkins.util.xstream.CriticalXStreamException:
> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy
> :
> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy
>  Debugging information  message :
> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy
> cause-exception :
> com.thoughtworks.xstream.mapper.CannotResolveClassException cause-message :
> com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy
> class : hudson.model.Hudson required-type : hudson.model.Hudson
> converter-type : hudson.util.RobustReflectionConverter path :
> /hudson/authorizationStrategy line number : 14 version : not available
>
> The issue is also described at
> https://stackoverflow.com/questions/55429268/jenkins-unable-to-read-config-xml-hudson-security-globalmatrixauthorizationstra,
> however the solution described there does not really help 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/386a8b43-9864-4a33-8396-3698edb327f9n%40googlegroups.com
> 
> .
>


-- 

Daniel Beck
Senior Software Engineer
CloudBees, Inc.

-- 
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-