Closed mboehm666 closed 1 month ago
Every model needs the OPC UA model as a dependency. The OPC UA model URI is always index 0 and is NOT listed in the NamespaceUris. Both of these errors could explain the problem and have nothing do with the transitive model issue. You should NOT need to include all included models from the parent NodeSet in the child NodeSet.
What version of the OPC Foundation Nodeset did you upload? If its not the exact or higher version of the one referenced in the parent it will cause this error. Line 166 is fine because the errorMessage is deleted in line 188 if there are no more entry in the MissingModels in the _results.
Sorry for the confusion. The problem is not related to the foundation nodeset. I should not have used it in the example.
Any other RequiredModel of the parent
that is not listed in the child
causes the described behavior.
I just tested with the current main
branch and the behavior is unchanged for me.
@muenchris I am afraid I cannot follow. Line 188 in UANodeSetCacheManager
looks like this:
static List<ModelValue> OrderByDependencies(List<ModelValue> models)
(its the start of a new method).
I am not seeing any code that sets _results.ErrorMessage = ""
or similar, except in line 97.
Maybe you are looking at some other branch than main
?
Just for completeness: I was uploading OPC Foundation Nodeset version 1.04.10 (but, as stated above, it should not matter).
Sorry, my bad. The fix for this is in the PR waiting for approval for quite some time. If you look into my branch CM-NodeSetValidator2, you can see that there is the fix in line 188. I hope to get the PR approved in the next couple days. Until then, I recommend you using the source from my latest branch.
Here is the pull request Chris mentioned: https://github.com/cesmii/CESMII-NodeSet-Utilities/pull/40.
Now I understand, thanks for clarification.
I can confirm that the issue is fixed in 1.0.2. Thanks for your support!
Problem
When uploading a nodeset that has transitive dependencies which are not explicitly listed as RequiredModel (i.e. a RequiredModel that is listed depends on one that is not listed), the indexing fails.
Steps to Reproduce
Here is a stripped-down example. It uses 2 minimal nodesets: Parent.xml:
child.xml:
The relevant thing to notice is that the child nodeset depends on the parent which, in turn, depends on the UA nodeset. The UA nodeset is not listed as a RequiredModel in child.
The error message is:
Expected behavior
The indexing should succeed, since all required models are known and available.
Analysis
The error seems to happen in
CESMII.OpcUa.NodeSetImporter.UANodeSetCacheManager.ImportNodeSets()
.The problem there is that in the first loop execution only
child
andparent
are resolved andUA
is still missing. Thusresults.ErrorMessage
is set (line 166). The next loop iteration resolves alsoUA
(there are no more_results.MIssingModels
, but since there is already an error message set the final result also has an error message, which in the end fails the indexing, even though all models are available and actually found.Possible solution
Set the error message for missing models after the loop, not within (not sure, though, how this interacts with a
_nodeSetResolver
.Comment
We are aware that the underlying problem likely originates in the CESMII code. However, we experienced the problem in the CloudLibrary and we are not sure how the collaboration with CESMII works, so we decided to file an issue here. Please advise if we should report it in a different way.