2. The node "testsrv.local" has been added 3 times, by executing the following command: ./provision.pl --username admin --password admin node add Test-01 2003 testsrv.local
This is expected because provision.pl uses the REST interface to manipulate requisitions.
Final comment: Through WebUI, I can't modify the foreign-id. It always forces me to use the generated one.
The curious thing is that I made a JUnit test to validate the correct implementation of the method "putNode" from Requisition.java, and it works as expected, so if you check the method "addOrReplaceNode" from RequisitionRestService.java, I think the problem could live on getActiveRequisition or m_pendingForeignSourceRepository.save() (but I'm not sure about that).
Code was looking in cache to determine if node existed but the cache was not properly seeded
Benjamin Reed June 9, 2011 at 12:34 PM
I thought I had backported it to 1.8 snapshot when I did the work... The UI will let you add a duplicate, but you can't save/done it, IIRC. I couldn't figure out how to make the crazy spring web stuff show an error message.
Alejandro Galue June 6, 2011 at 6:49 PM
Is the issue the one you are talking about?
The fix has not been committed yet, right? That's because I just recompiled 1.8 (just to be sure) and the problem still exists.
Benjamin Reed June 6, 2011 at 6:12 PM
This is a duplicate, although I'm not sure where the original is. It should be fixed in 1.8.13 with my JAXB changes and the addition of a "validate" method to the requisition object which is called by the requisition dao.
Alejandro Galue June 6, 2011 at 11:09 AM
I just validate that the problem also exists on latest snapshot of the branch 1.10
As you can see on the attached image, you will see two sets of duplicated nodes:
1. The node "my-test-router" has been added twice using REST Interface through the command:
curl -v -H 'Content-Type: application/xml' -d @node.xml "http://admin:admin@localhost:8980/opennms/rest/requisitions/Test-01/nodes"
where node.xml contains:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<node xmlns="http://xmlns.opennms.org/xsd/config/model-import" node-label="my-test-router" foreign-id="20002" building="Test-01">
<interface status="1" snmp-primary="P" ip-addr="11.1.0.254" descr="Fa0/1"/>
<category name="Production"/>
<category name="Routers"/>
</node>
2. The node "testsrv.local" has been added 3 times, by executing the following command:
./provision.pl --username admin --password admin node add Test-01 2003 testsrv.local
This is expected because provision.pl uses the REST interface to manipulate requisitions.
Final comment:
Through WebUI, I can't modify the foreign-id. It always forces me to use the generated one.
The curious thing is that I made a JUnit test to validate the correct implementation of the method "putNode" from Requisition.java, and it works as expected, so if you check the method "addOrReplaceNode" from RequisitionRestService.java, I think the problem could live on getActiveRequisition or m_pendingForeignSourceRepository.save() (but I'm not sure about that).