Updating config.xml via HTTP API fails

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Updating config.xml via HTTP API fails

Will Gorman
I'm running Hudson 1.389 in Tomcat and getting an exception when attempting to update the configuration for projects by POSTing an updated config.xml via the HTTP API.  The exception from the logs seems to indicate that it was unable to delete the config.xml for the project but I'm not sure why.  I've attached the stack trace from the exception.  I don't have any issues when updating the project configuration through the browser interface, and I can delete the file if I log in to the machine running Hudson so I don't think that it's locked.  I'm pretty sure the config.xml I'm sending is valid because I can see the changes reflected if I view the project in the browser but once Hudson reloads the changes are lost since they weren't saved to the file.  Does anyone know anything else I should check?


exception.txt (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Updating config.xml via HTTP API fails

Jesse Glick-2
On Jan 19, 7:43 pm, Will Gorman <[hidden email]> wrote:
> The exception from the logs seems to indicate that it was
> unable to delete the config.xml for the project but I'm not sure why.  I've
> attached the stack trace from the exception.

        if(destFile.exists() && !destFile.delete()) {
            tmpFile.delete();
            throw new IOException("Unable to delete "+destFile);
        }

Unfortunately File.delete gives no indication of cause.
http://download.oracle.com/javase/7/docs/api/java/nio/file/Path.html#delete%28%29
might provide better diagnostics such as a Windows error code; Hudson
would have to refer to this JDK 7 class reflectively, though.