Jenkins configurations gets reverted by SYSTEM user anomaly

狂风中的少年 提交于 2021-01-21 10:02:08

问题


I am running Jenkins version 2.85 on Kubernetes as pod(Affinity set to one workernode). I am creating Jobs using Salt Jenkins module by passing XML to this module.

I am using Jenkins Global Library for preforming job execution.

My Job config looks like this

I am calling GobalLibrary with my parameters like repoURL, componet etc..,

Things goes well for weeks and now I landed to a weird situation where my job configurations(config.xml) gets updated/revert automatically.

Intermittently my "Build with parameter" options disappears and I can see only "Build now" in Jenkins GUI. Initially I thought someone is doing this, so to track the config changes I installed Job config history plugin in Jenkins and what I find is strange. Someone with "SYSTEM" username is making/reverting changes.

This is how it looks

and what I find is SYSTEM user revert only JOB config changes, not the PIPELINE.

I am not sure what's going wrong behind the scenes and how to stop or fix this. This is my Production instance so I am more worried.

I can see a SYSTEM user in my Jenkins

but I can not delete that user

Few relevant Question I find for this but with no answers

Configuration of Jobs getting updated by System user on Jenkins

Jenkins SYSTEM user removes custom workspace configuration

I am not sure if this Jenkins Bug or some plugin is playing with my soul.

Need help! :(


回答1:


Okay I find the answer to this problem.

I have used properties in my Jekins Global Library something like this

// Disable concurrent builds
//properties([disableConcurrentBuilds()])

which overrides my external job configuration(done via salt).

Hint I get from this blog: https://st-g.de/2016/12/parametrized-jenkins-pipelines




回答2:


I also had this problem. For me it was solved when I changed the Build triggers -> Build Periodically settings from 'H 23 * * *' to '00 23 * * *'. (As I want my build to execute every night at 23:00.) Where H lets Jenkins decide when to run the job somewhere between 23:00 and 23:59 to spread load evenly. It seems Jenkins sometimes decided that it would be best to run my job on a different server and changed the parameters automatically.



来源:https://stackoverflow.com/questions/50192880/jenkins-configurations-gets-reverted-by-system-user-anomaly

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!