-
Notifications
You must be signed in to change notification settings - Fork 236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot deploy new jenkins with install-plugins.sh #758
Comments
it has been fixed already in #755. No official release yet, but you can use this one -> virtuslab/jenkins-operator:bef796a |
I am testing the virtuslab/jenkins-operator:bef796a image and Jenkins jenkins/jenkins:2.346.2-lts-jdk11 the behavior is different from virtuslab/jenkins-operator:29c5b1e. virtuslab/jenkins-operator:29c5b1e behavior
Jenkins exits here and Jenkins Operator restarts the pod. virtuslab/jenkins-operator:bef796a behavior
Then over in Jenkins Operator log -
Is there another daily build we should be testing? |
Any update on the official release about this fix? |
use jenkins-plugin-cli, read the official documentation |
Can we do anything on the user side and hack the operator to make it using |
@UkonnRa I'm bulding by own Dockerfile to support it
install-plugins.sh
|
Thanks for your response! Finally I choose to use |
I was able to get passed this error, but it's hacky: On /var/jenkins/scripts/init.sh and that fails with a non-zero exit status code due to what I believe is the in-progress migration to the Defaulted container "jenkins-master" out of: jenkins-master, backup
+ '[' '' == true ']'
+ echo 'To print debug messages set environment variable '\''DEBUG_JENKINS_OPERATOR'\'' to '\''true'\'''
+ mkdir -p /var/lib/jenkins/init.groovy.d
To print debug messages set environment variable 'DEBUG_JENKINS_OPERATOR' to 'true'
+ cp -n /var/jenkins/init-configuration/createOperatorUser.groovy /var/lib/jenkins/init.groovy.d
+ mkdir -p /var/lib/jenkins/scripts
+ cp /var/jenkins/scripts/init.sh /var/jenkins/scripts/install-plugins.sh /var/lib/jenkins/scripts
+ chmod +x /var/lib/jenkins/scripts/init.sh /var/lib/jenkins/scripts/install-plugins.sh
+ echo 'Installing plugins required by Operator - begin'
Installing plugins required by Operator - begin
+ cat
+ [[ -z '' ]]
+ install-plugins.sh
WARN: install-plugins.sh has been removed, please switch to jenkins-plugin-cli ^ at this point the pod would enter the kubernetes-operator/pkg/configuration/base/resources/scripts_configmap.go Lines 288 to 292 in 3a143a0
I am opening a pr, but I do not know if the For now, I already installed all my plugins using jenkins@jenkins-jenkins:/$ jenkins-plugin-cli -f /usr/share/jenkins/ref/plugins.txt
Done
jenkins@jenkins-jenkins:/$ echo $?
0 So I can bypass the error by overriding the containers:
- name: jenkins-master
image: <custom jenkins image built in an aws ecr>
imagePullPolicy: Always
command:
- sh
- -c
- |
#!/usr/bin/env bash -e
echo "initializing: /var/jenkins/scripts/init.sh"
/var/jenkins/scripts/init.sh
last_status="$$?"
echo "/var/jenkins/scripts/init.sh exited with status=$${last_status}"
echo "starting jenkins: exec /usr/bin/tini -s -- /usr/local/bin/jenkins.sh"
exec /usr/bin/tini -s -- /usr/local/bin/jenkins.sh ^ logs this on startup: Defaulted container "jenkins-master" out of: jenkins-master, backup
initializing: /var/jenkins/scripts/init.sh
To print debug messages set environment variable 'DEBUG_JENKINS_OPERATOR' to 'true'
+ '[' '' == true ']'
+ echo 'To print debug messages set environment variable '\''DEBUG_JENKINS_OPERATOR'\'' to '\''true'\'''
+ mkdir -p /var/lib/jenkins/init.groovy.d
+ cp -n /var/jenkins/init-configuration/createOperatorUser.groovy /var/lib/jenkins/init.groovy.d
+ mkdir -p /var/lib/jenkins/scripts
+ cp /var/jenkins/scripts/init.sh /var/jenkins/scripts/install-plugins.sh /var/lib/jenkins/scripts
+ chmod +x /var/lib/jenkins/scripts/init.sh /var/lib/jenkins/scripts/install-plugins.sh
+ echo 'Installing plugins required by Operator - begin'
Installing plugins required by Operator - begin
+ cat
+ [[ -z '' ]]
+ install-plugins.sh
WARN: install-plugins.sh has been removed, please switch to jenkins-plugin-cli
/var/jenkins/scripts/init.sh exited with status=1
starting jenkins: exec /usr/bin/tini -s -- /usr/local/bin/jenkins.sh
Running from: /usr/share/jenkins/jenkins.war ^ with the plugins already installed in the docker image, the Note there was an additional downstream error/sleep that I fixed by changing the path for Before I found the exec /sbin/tini -s -- /usr/local/bin/jenkins.sh
***************************************************************************
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING *
***************************************************************************
Please update your scripts to use /usr/bin/tini going forward.
The previous path has been preserved for backwards compatibility
but WILL BE REMOVED in the future (around Jenkins >= 2.345+).
Now sleeping 2 minutes... ^ after seeing this sleep message, I migrated to jenkins@jenkins-jenkins:/$ ps auwwx
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
jenkins 1 0.0 0.0 2316 572 ? Ss 19:03 0:00 /usr/bin/tini -s -- /usr/local/bin/jenkins.sh
jenkins 15 8.6 0.5 7925132 2472648 ? Sl 19:03 2:18 java -Duser.home=/var/lib/jenkins -Djenkins.install.runSetupWizard=false -Djava.awt.headless=true -Djenkins.model.Jenkins.slaveAgentPort=50000 -Dhudson.lifecycle=hudson.lifecycle.ExitLifecycle -jar /usr/share/jenkins/jenkins.war
jenkins 1611 0.0 0.0 5992 3768 pts/0 Ss 19:16 0:00 bash
jenkins 1722 0.0 0.0 8592 3252 pts/0 R+ 19:29 0:00 ps auwwx |
…ins.sh to jenkins-plugin-cli and migrating /sbin/tini to /usr/bin/tini
* the fix was original attempted here: jenkinsci#764 but was not working correctly due to 2-3 additional changes which needed to be done * removed the openshift check because the env is not mention anywhere and also the new jenkins-plugin-cli does not a specific command for openshift. Finally this does not make any sense in general, the only problem in ocp will be the user id that will be mapped to a random uid but that's another story. The command to install the plugins should remain the same across different k8s flavours.
As by instruction found on jenkinsci/kubernetes-operator#758 (comment), the plugin install script was swapped by a Plugin Manager CLI called *jenkins-plugin-cli*. Documentation is found at https://github.com/jenkinsci/docker/blob/master/README.md#usage-1.
tried several fixes and hit many errors like
finally composed a values.yaml that works
helm install jenkins-op08 jenkins/jenkins-operator -f values.yaml |
Describe the bug
Jenkins released a new version that they do not support installing plugins with install-plugins.sh
jenkinsci/docker@9b54caa
since then, the operator failed to deploy new Jenkins, with the following error:
Installing plugins required by Operator - begin
[[ -z ‘’ ]]
install-plugins.sh
WARN: install-plugins.sh has been removed, please switch to jenkins-plugin-cli
To Reproduce
Steps to reproduce the behavior.
deploy any new version of jenkins (all version changed in the last 3 days)
Additional information
Kubernetes version: 1.22
Jenkins Operator version: any (0.7.1/0.7.0)
Add error logs about the problem here (operator logs and Kubernetes events).
The text was updated successfully, but these errors were encountered: