-
Bug
-
Resolution: Fixed
-
Blocker
-
None
-
Jenkins ver. 1.589, 1.590
Latest Plugins
Solaris 10
Firefox + Chrome
Maven Build Job
-
Powered by SuggestiMate
The host parameters for "Restrict where this project can be run" are removed/disabled after Save/Apply of Job Configuration !!!
The builds are running on any host not at the specified ones
- is duplicated by
-
JENKINS-25767 Build location restrictions are not stored with 1.590
-
- Resolved
-
- is related to
-
JENKINS-25372 No nodes under "Restrict nodes"
-
- Resolved
-
[JENKINS-25533] "Restrict where this project can be run" removed/disabled after Save/Apply of Job Configuration
I've updated from Jenkins ver. 1.585 to 1.589 - before this update everything was OK!
We updated from 1.588 and see this behaviour with the newest version. Downgrade will take another hour....
We upgraded from 1.588 to 1.589 and see this behaviour with the newest version. A downgrade to 1.588 solves the problem.
The "newline" of my config.xml is removed and alse the parameters assignedNode + canRoam ...
$ diff config.xml config.ok
Warning: missing newline at end of file config.xml
57c57,58
< <canRoam>true</canRoam>
—
> <assignedNode>master</assignedNode>
> <canRoam>false</canRoam>
197c198
< </maven2-moduleset>
—
> </maven2-moduleset>
podskalsky: Jenkins does not add trailing newlines to XML files, I assume those are yours? (JENKINS-25628)
The trailing newlines are not the problem (I've checked it) but the changed xml tag canRoam and the removed tag assignedNode !!!
podskalsky: You edited your comment to include that information, so it seemed you considered that important for some reason.
I cannot reproduce this on a pristine Jenkins 1.592 SNAPSHOT (current development version) with either freestyle or Maven projects. Adding the restriction works, and subsequent edits of the form keep it unmodified. I can see no changes between 1.590 and my version.
Any further information you could provide under what circumstances the issue appears? Could someone maybe capture the form submit HTTP request of their browsr when configuring a test project, and provide the submitted form JSON?
I tested with Jenkins 1590 and the problem is still not solved (as indicated by Andreas above). Here are the logs in case the job configuration is saved:
Nov 22, 2014 10:34:06 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.tasks.LogRotator
Nov 22, 2014 10:34:06 AM hudson.model.AbstractProject submit
WARNING: label assignment is using legacy '_.assignedLabelString'
Nov 22, 2014 10:34:06 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.plugins.build_timeout.impl.AbsoluteTimeOutStrategy
Nov 22, 2014 10:34:06 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.plugins.build_timeout.operations.FailOperation
Nov 22, 2014 10:34:06 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.tasks.Shell
Nov 22, 2014 10:34:06 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.plugins.warnings.WarningsPublisher
Nov 22, 2014 10:34:06 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.tasks.Mailer
Any other information I could provide to track down the issue?
An here are the logs if I do the same operation with Jenkins 1588 (problem does not occur):
Nov 22, 2014 10:51:00 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.tasks.LogRotator
Nov 22, 2014 10:51:00 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.plugins.build_timeout.impl.AbsoluteTimeOutStrategy
Nov 22, 2014 10:51:00 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.plugins.build_timeout.operations.FailOperation
Nov 22, 2014 10:51:00 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.tasks.Shell
Nov 22, 2014 10:51:00 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.plugins.warnings.WarningsPublisher
Nov 22, 2014 10:51:00 AM org.kohsuke.stapler.RequestImpl$TypePair convertJSON
WARNING: 'stapler-class' is deprecated: hudson.tasks.Mailer
Nov 22, 2014 10:52:07 AM hudson.slaves.SlaveComputer tryReconnect
mbeller: What kind of project (Freestyle, Maven, Matrix/multiconfig, MultiJob, Build Flow, Workflow, ...) is that?
I now tried it on a regular instance with 1.590. Still cannot reproduce it with freestyle projects.
I could reproduce the issue with a Freestyle test project. Here is the submitted JSON (Firefox 33.1.1):
{"name": "MBeTest", "description": "", "": ["", "0"], "logrotate": false, "buildDiscarder": {"stapler-class": "hudson.tasks.LogRotator", "daysToKeepStr": "", "numToKeepStr": "", "artifactDaysToKeepStr": "", "artifactNumToKeepStr": ""}, "properties": {"stapler-class-bag": "true", "hudson-model-ParametersDefinitionProperty": {}, "org-jenkinsci-plugins-envinject-EnvInjectJobProperty": {}}, "disable": false, "concurrentBuild": false, "hasSlaveAffinity": true, "label": "buildServer", "hasCustomQuietPeriod": false, "quiet_period": "5", "hasCustomScmCheckoutRetryCount": false, "scmCheckoutRetryCount": "0", "blockBuildWhenUpstreamBuilding": false, "blockBuildWhenDownstreamBuilding": false, "hasCustomWorkspace": false, "customWorkspace": "", "displayNameOrNull": "", "scm": {"value": "0"}, "core:apply": "true"}
To clarify, after you submit this, you click "Configure", and "Restrict where" is not checked, and/or the label expression is empty? And submitting the form results in the warning?
Still cannot reproduce this (on ~1.592 again). My JSON is identical except for the presumably bogus "": ["", "0"] element, I even installed env-inject to get the empty property.
Daniel Beck: Please find attached the screenshot MBeTest Config [Jenkins].png before I press the Save or Apply button. The result is the WARNING: label assignment is using legacy '_.assignedLabelString' and the config.xml of the related job is not updated properly.
@Martin: thank you for your additional input and log files.
On my server I've downgraded to 1.588. So I'm not not able to generate these log files.
As I wrote above, I'm sending almost exactly the same data, and it's processed correctly on the server, despite using 1.590. Uploading another screenshot of the same form field doesn't help (or I don't understand what it signifies, in that case, please explain).
Is anyone able to reproduce this issue on a pristine Jenkins instance? How about after installing all the plugins you have on your prod instance (in the same versions)? If it works out of the box but installing plugins results in a problem, try to determine which plugin is responsible by disabling/enabling them until you find the culprit.
@Daniel:
- Do you get the same Warning (label assignment is using legacy '_.assignedLabelString') when pressing the Save/Apply button?
- Did you verify that the config.xml file of the related job is updated properly:
<assignedNode>buildServer</assignedNode> <canRoam>false</canRoam>
I see the same issue after upgrading from 1.588 to 1.590
I have the same plugins in both versions and it works with 1.588 and is broken in 1.590
Can I suggest that people who have this problem give a list of the plugins that they have.
Thanks
I did quite a bit of testing an narrowed it down. The issue occurs in Jenkins versions 1.589 or greater when the ClearCase plugin is installed. I didn't test all of the plugins rkarbas had installed, but I first noticed it with the ClearCase plugin. Here are some steps to reproduce:
- Install Jenkins 1.589 or higher
- Configure a node (Ex. master) with a label of "test"
- Create a new Freestyle job and restrict it to the "test" node label
- Save the job
- Reopen the job's configure page and notice the node label restriction is gone.
Great find Brian!
Could the watchers please chime in?
- Do you have the ClearCase plugin installed?
- Does the issue disappear with the plugin disabled (if unused)?
- Please provide the list of plugins (+versions) if not.
I can confirm that we use the ClearCase plugin in latest version 1.5.3.
I can reproduce the problem on a newly set up instance. Disable all bundled plugins, install ClearCase plugin, restart, and there it is.
label assignment is using legacy '_.assignedLabelString'
And here's the problem:
https://github.com/jenkinsci/clearcase-plugin/blob/4e1ac05ac09f17326e1fab4d6af7aa5fda297f94/src/main/resources/hudson/plugins/clearcase/viewstorage/ServerViewStorage/config.jelly#L28
I can confirm that the ClearCase plugin is the problem.
I've uninstalled this plugin (I don't need it) and saving data is now OK.
Core needs to be more resilient wrt form field names by plugins, so core should be fixed IMO. ClearCase did nothing wrong, just bad interaction.
I am also observing this issue, using Jenkins 1.591 and Clearcase plugin. It's a major bug to me, as our projects are kept in Clearcase and any edit of job configuration removes target assignments. I appreciate long-term solution for core to be more resilient, but I would also make use of a short-term fix.
I'd posit the "fix" is transposing these two predicates in my prior PR:
if(req.hasParameter("_.assignedLabelString")) {
// Workaround forJENKINS-25372while plugin is being updated.
LOGGER.log(Level.WARNING, "label assignment is using legacy '_.assignedLabelString'");
assignedNode = Util.fixEmptyAndTrim(req.getParameter("_.assignedLabelString"));
} else if(json.optBoolean("hasSlaveAffinity", json.has("label"))) {
assignedNode = Util.fixEmptyAndTrim(json.optString("label"));
(read: prefer the new way)
Frankly, prior to my original change in PR 1414, the resolution of "assignedLabelString" for the project was kind of a crap shoot with this plugin installed because the project used:
if(req.getParameter("hasSlaveAffinity")!=null) {
assignedNode = Util.fixEmptyAndTrim(req.getParameter("_.assignedLabelString"));
Since both AbstractProject and ClearCase submit "_.assignedLabelString", which one gets picked when accessed through the request is likely undefined...
I'll try and find some time to make this change this week and test it with some of the cases affected in 25372 to make sure those don't regress with the conditions transposed.
Sorry for the delayed response, still catching up from the holiday weekend.
Integrated in jenkins_main_trunk #3866
JENKINS-25533 Noting merge of #1477. (Revision 97bc2dd44416ae45e604e634b4d5fcfa839ab2aa)
Result = SUCCESS
jesse glick : 97bc2dd44416ae45e604e634b4d5fcfa839ab2aa
Files :
- changelog.html
Code changed in jenkins
User: Matt Moore
Path:
core/src/main/java/hudson/model/AbstractProject.java
http://jenkins-ci.org/commit/jenkins/15a24dd637392f32b98fe76e53db8c7be429ce7d
Log:
Favor the new style of form submission over the legacy form to fix: JENKINS-25533
Code changed in jenkins
User: Jesse Glick
Path:
core/src/main/java/hudson/model/AbstractProject.java
http://jenkins-ci.org/commit/jenkins/a59cf9f37f47a9820a5f5859aa82424c039eb1a6
Log:
Merge pull request #1477 from mattmoor/JENKINS-25533
[FIXED JENKINS-25533] Favor the new style of form submission over the legacy form
Compare: https://github.com/jenkinsci/jenkins/compare/ed891f6bc0a9...a59cf9f37f47
Code changed in jenkins
User: nilleb
Path:
src/main/resources/hudson/plugins/mstest/mstest-to-junit.xsl
src/test/java/hudson/plugins/mstest/MSTestReportConverterTest.java
src/test/resources/hudson/plugins/mstest/JENKINS-25533+19384.trx
src/test/resources/hudson/plugins/mstest/JENKINS-25533+19384.xml
src/test/resources/hudson/plugins/mstest/nilleb_HOST18468 2015-03-18 08_03_36.xml
http://jenkins-ci.org/commit/mstest-plugin/2b6797a0cc004d7756bcb6d13fbba465389bdac2
Log:
[FIXED JENKINS-25533][FIXED JENKINS-19384] support for output/stdout messages
Related to
JENKINS-25372, which has been caused by https://github.com/jenkinsci/jenkins/pull/1414. There were new fixes in 1.589.Have you seen the issue on the previous versions? (it would be great to know this version)