From a long time, the requisitions ReST API was modified to return a 303 "See Other" with the URL to get the modified entity, after requesting an addition or modification of an existing entity (by entity I mean, requisition, node, interface, monitored-service, assets, categories, etc.).
Almost all the ReST Clients expect a HTTP 200 for a successful response, and if a 303 is sent instead, some could follow the redirect and others don't. Actually, provision.pl has been modified in order to consider a 303 a good response.
Moderns browsers will always going to follow the redirect, and there is no way to change this behavior on the browsers.
When the redirects are follow, the workflow of manipulating the requisitions through the ReST API will brake on the following condition:
"Adding a node to an existing requisition following the redirect, and then import the requisition following the redirect on the PUT request response."
I think this is a race condition due to the fact that each GET request will trigger the generation of the requisition XML file on the pending directory, and at the same time, the ReST API is trying to read the files to send it to the requestor.
The exception generated is the following:
I've created a simple shell script that recreates the problem using curl.
The important thing is that on OpenNMS 14 and Meridian, this is not a problem, but it can be reproduced all the time on OpenNMS 17 Snapshot.
A long time ago, I've modified the requisitions file handling to have a cache in memory to accelerate the Requisitions ReST API:
I left the default "file" enabled for backward compatibility, and the "accelerated" version (i.e. "fastFile") is the recommended option for very large requisitions.
If I enable "fastFile", the problem disappear:
Prior making "fastFile" the new default, I would like to know if the changes related to Apache CXF (or something else) is the responsible for this behavior.
I'm attaching the web.log generated after running the script with the full stack-trace of the exception.