[JIRA] [jobconfighistory-plugin] (JENKINS-25456) POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'

2014-11-10 Thread j_carl...@apple.com (JIRA)














































Jake Carlson
 commented on  JENKINS-25456


POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'















We've finally resolved the issue. TL;DR: Include a value in the 'name' node when POSTing config.xml to update a job. Not including it when creating the job will work just fine.

Here's what was happening:

We weren't setting a value for the 'name' node in the config.xml on initial job creation or job update. The job name is passed in via a GET parameter on job creation, and presumably Jenkins uses that parameter to set the name of the job (make sense). However, when updating the config.xml for a job, the absence of the 'name' node value in the config.xml caused Jenkins to rename the job to 'jobs'.

We have quite a few jobs and so the job being silently renamed was not noticed. When we rebooted Jenkins, we noticed that the renamed jobs magically appeared. I started following some discussions about job configs not being loaded back into memory without issuing a 'reload' command. Sure enough, issuing the reload command 'restored' (or so we thought at the time) the job's config in memory. (What appears really to have been happening is that Jenkins was silently autocorrecting the job names based the directory name and ignoring the blank 'name' node in the job's config.xml.)

We did a clean install of Jenkins without all the existing jobs and POSTed an update to a job config.xml directly in cURL and were finally able to notice that Jenkins was actually renaming the job to 'jobs.' That put us on to the trail of troubleshooting the 'name' node and on a hunch we included a value even though creating a job worked fine in its absence. And the update worked just fine.

So this is not a bug per se with Jenkins but IMO the error checking could definitely be improved upon. IMO POSTing an updated config.xml should throw an error if the 'name' node doesn't exist OR if the 'name' node doesn't match the actual path to the config.xml being POSTed to. And renaming the job to 'jobs' kind of came out of left field (not sure WTF that is about).



























This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira







-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [jobconfighistory-plugin] (JENKINS-25456) POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'

2014-11-10 Thread j_carl...@apple.com (JIRA)















































Jake Carlson
 resolved  JENKINS-25456 as Fixed


POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'
















Change By:


Jake Carlson
(10/Nov/14 5:04 PM)




Status:


Open
Resolved





Resolution:


Fixed



























This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira







-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [jobconfighistory-plugin] (JENKINS-25456) POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'

2014-11-08 Thread dan...@beckweb.net (JIRA)














































Daniel Beck
 commented on  JENKINS-25456


POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'















Jake: What happens on a pristine instance without Job Config History? Does the config.xml for the job exist before and after you POST?



























This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira







-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [jobconfighistory-plugin] (JENKINS-25456) POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'

2014-11-06 Thread j_carl...@apple.com (JIRA)














































Jake Carlson
 commented on  JENKINS-25456


POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'















Is this perhaps related to https://github.com/jenkinsci/jenkins/commit/2b9cfe3a475cc5851fe91d33a917f3db1e33ef23 ? I have attempted to use a Groovy script in Jenkins console. I can retrieve the job by calling 'hudson.model.Hudson.instance.getItem('my-job');'. But once I update the job config.xml I can no longer do so without reloading all configuration files from disk (which isn't feasible for us). It seems that the removal of doReload in AbstractItem.updateByXml is causing Jenkins to purge the job from memory?



























This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira







-- 
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[JIRA] [jobconfighistory-plugin] (JENKINS-25456) POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'

2014-11-05 Thread j_carl...@apple.com (JIRA)














































Jake Carlson
 commented on  JENKINS-25456


POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'















I'm seeing this in the Jenkins system logs after the failed API call to edit a job's configuration.

Nov 05, 2014 12:19:39 PM WARNING hudson.plugins.jobConfigHistory.FileHistoryDao hasDuplicateHistory
unable to check for duplicate previous history file: /data/jenkins/config-history/jobs/jobs/2014-11-05_12-12-22/config.xml
java.io.FileNotFoundException: /data/jenkins/jobs/jobs/config.xml (No such file or directory)
Nov 05, 2014 12:19:39 PM WARNING hudson.model.listeners.SaveableListener fireOnChange
null
java.lang.RuntimeException: Unable to copy /data/jenkins/jobs/jobs/config.xml
	at hudson.plugins.jobConfigHistory.FileHistoryDao.createNewHistoryEntryAndCopyConfig(FileHistoryDao.java:252)
	at hudson.plugins.jobConfigHistory.FileHistoryDao.saveItem(FileHistoryDao.java:264)
	at hudson.plugins.jobConfigHistory.JobConfigHistorySaveableListener.onChange(JobConfigHistorySaveableListener.java:29)
	at hudson.model.listeners.SaveableListener.fireOnChange(SaveableListener.java:80)
	at hudson.model.AbstractItem.updateByXml(AbstractItem.java:669)
	at hudson.model.AbstractItem.doConfigDotXml(AbstractItem.java:613)
	at sun.reflect.GeneratedMethodAccessor308.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:622)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:249)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
	at com.cloudbees.jenkins.support.slowrequest.SlowRequestFilter.doFilter(SlowRequestFilter.java:37)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
	at jenkins.metrics.impl.MetricsFilter.doFilter(MetricsFilter.java:117)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:99)
	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.BasicHeaderProcessor.success(BasicHeaderProcessor.java:95)
	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:75)
	at hudson.security.ChainedServletFi

[JIRA] [jobconfighistory-plugin] (JENKINS-25456) POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'

2014-11-05 Thread j_carl...@apple.com (JIRA)














































Jake Carlson
 created  JENKINS-25456


POSTing to existing job config.xml results in 'java.io.IOException: Failed to persist config.xml'















Issue Type:


Bug



Assignee:


Mirko Friedenhagen



Components:


jobconfighistory-plugin



Created:


05/Nov/14 5:33 PM



Description:


When POSTing to an already existing job's config.xml to edit the job's configuration, I'm getting the following error:

java.io.IOException: Failed to persist config.xml
	at hudson.model.AbstractItem.updateByXml(AbstractItem.java:648)
	at hudson.model.AbstractItem.doConfigDotXml(AbstractItem.java:613)
	at sun.reflect.GeneratedMethodAccessor308.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:622)
	at org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:298)
	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:161)
	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:96)
	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:121)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
	at org.kohsuke.stapler.MetaClass$6.doDispatch(MetaClass.java:249)
	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:53)
	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:746)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:876)
	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:649)
	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:686)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1494)
	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:96)
	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:88)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:48)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at jenkins.security.BasicHeaderProcessor.success(BasicHeaderProcessor.java:95)
	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:75)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:76)
	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:164)
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1482)
	at org.kohsuke.stapler.comp