I was unable to duplicate the issue. I attempted to duplicate the issue by defining a Jenkins 2.263.4 installation with credentials plugin 2.4.1 (the most recent version that does not include isUsernameSecret). The list of precise plugin versions that I used are attached as plugins.txt
. The commands I used to create the running Jenkins were:
$ mkdir plugins
$ java -jar ../jenkins-plugin-manager-2.11.0.jar --jenkins-version 2.263.4 --latest false --plugin-download-directory plugins --plugin-file plugins.txt
$ JENKINS_HOME=. java -jar ../jenkins-2.263.4.war
I chose to install no other plugins through the installation wizard, then defined a username / password credential with id 'mwaite-not-a-valid-password'. I defined a declarative Pipeline like this:
pipeline {
agent any
stages {
stage('Hello with credentials';) {
steps {
withCredentials([usernamePassword(credentialsId: 'mwaite-not-a-valid-password',
passwordVariable: 'PASSWORD_VARIABLE',
usernameVariable: 'USERNAME_VARIABLE')]) {
echo 'Hello World from user name ' + USERNAME_VARIABLE + ' with password ' + PASSWORD_VARIABLE
}
}
}
}
}
I ran that job twice to confirm that the output displayed the redacted username as '****' and same for the password.
I stopped Jenkins 2.263.4 and ran Jenkins 2.319.1 in that same directory with the command:
$ JENKINS_HOME=. java -jar ../jenkins-2.319.1.war
Ran the job and saw the expected output. Modified the job configuration and ran the job again still seeing the expected output.
Updated to the most recent versions of all plugins, restarted Jenkins, ran the job, and saw the expected output.
That sequence of steps was not able to duplicate the bug. I'm not doubting it is a real bug, but I don't know the steps to duplicate it.
Same steps but running with Jenkins 2.289.2 in the final stage had the same results. Can't duplicate the bug from scratch with that path.
Same steps but starting with credentials plugin 2.3.14 as described in the list of installed plugins that are part of the original description of the issue, still unable to duplicate the problem.
WORKAROUND: