New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method call with a single float type input argument results in exception in node-opcua server #857
Comments
Can you elaborate ? Please show how you have implemented this method in the server. Please provide a gist of a minimum server that reproduce the issue. |
I get this issue even when i don't implement any methods in the top level server application. This is coming directly from the node-opcua |
Which server do you start ? |
Following are the namespaces loaded in the server. Have attached also the nodeset file to load into the server. For instance SetMachSpeed method from namespace 8 causes the above exception. Any method execution from the namespace index 8 leads to the above exception. Namespace[0] = http://opcfoundation.org/UA/ |
Hint : getMethodDeclaration_ArgumentList(addressSpace, objectId, methodId) in callhelpers.js returns a wrong response even though the parameters passed are the correct ones. Seems like the method declaration NodeID is not properly adjusted when the namespace index is changed inside the server. |
The only difference i see from your example to my server code is the nodesets that have been loaded into the server. I had to load the Opc.Ua.Di.NodeSet2.xml also that's why for me the namespace abbtest has moved to 8. I have never assumed the namespace in server to be same as the nodeset file. I always get the namespace from the server after the nodeset is initialised for all the operation. with the below code without any method being binded i always get the problem as stated before for SetMachSpeed. Server code: NODESET_FILENAMES_DI_BASED : [
".\\node_modules\\node-opcua-nodesets\\nodesets\\Opc.Ua.NodeSet2.xml",
".\\node_modules\\node-opcua-nodesets\\nodesets\\Opc.Ua.Di.NodeSet2.xml",
"UaCompanionModel.xml"
],
function createAndInitialiseOpcUaServer() {
// Let create an instance of OPCUAServer
server = new opcua.OPCUAServer({
port: CONFIGURATION_SWITCH.SERVER_LISTENING_PORT, // the port of the listening socket of the server
nodeset_filename: CONFIGURATION_SWITCH.NODESET_FILENAMES_GENERIC,
userCertificateManager: {
allowAnonymous: true,
automaticallyAcceptUnknownCertificate: true
},
buildInfo: {
productName: PRODUCT_NAME,
softwareVersion: SOFTWARE_VERSION,
buildNumber: BUILD_NUMBER,
buildDate: new Date()
}
});
server.serverCertificateManager.automaticallyAcceptUnknownCertificate = true;
// the server needs to be initialized first. During initialisation,
// the server will construct its default namespace.
server.initialize(appInit);
} When i changed the Nodeset load to only standard nodeset and the companionmodel nodeset see below i get the following error NODESET_FILENAMES_GENERIC : [
".\\node_modules\\node-opcua-nodesets\\nodesets\\Opc.Ua.NodeSet2.xml",
"UaCompanionModel.xml"
],
Node-OpcUa stack version : ^2.13.0
OPC UA Server is initialized.Starting App initialisation
Namespace[0] = http://opcfoundation.org/UA/
Namespace[1] = urn:NodeOPCUA-Server-default
Namespace[2] = http://fdi-cooperation.com/OPCUA/FDI5/
Namespace[3] = http://fdi-cooperation.com/OPCUA/FDI7/
Namespace[4] = http://opcfoundation.org/UA/ADI/
Namespace[5] = http://opcfoundation.org/UA/PackML
Namespace[6] = http://opcfoundation.org/UA/schemas/FDT/1.0/
Namespace[7] = http://abbminden.org/uacompanionmodelabbtest/
Namespace[8] = http://opcfoundation.org/UA/DI/
C:\Users\degarao\Desktop\JSBooks\Project\JavascriptApplication\node_modules\node-opcua-address-space\dist\src\ua_variable.js:879
throw new Error("cannot find dataType " + this.dataType.toString());
^
Error: cannot find dataType ns=8;i=6244
at UAVariable.getDataTypeNode (C:\Users\degarao\Desktop\JSBooks\Project\JavascriptApplication\node_modules\node-opcua-address-space\dist\src\ua_variable.js:879:19)
at UAVariable.get dataTypeObj [as dataTypeObj] (C:\Users\degarao\Desktop\JSBooks\Project\JavascriptApplication\node_modules\node-opcua-address-space\dist\src\ua_variable.js:884:21)
at C:\Users\degarao\Desktop\JSBooks\Project\JavascriptApplication\OpcUaServer.js:238:279
at Array.forEach (<anonymous>)
at installValueChangeTrigger (C:\Users\degarao\Desktop\JSBooks\Project\JavascriptApplication\OpcUaServer.js:231:19)
at appInit (C:\Users\degarao\Desktop\JSBooks\Project\JavascriptApplication\OpcUaServer.js:451:5)
at Immediate.<anonymous> (C:\Users\degarao\Desktop\JSBooks\Project\JavascriptApplication\node_modules\node-opcua-server\dist\opcua_server.js:593:25)
at processImmediate (internal/timers.js:456:21) |
We seem to be diverging from the original issue: nodeset
investigating Error: cannot find dataType ns=8;i=6244
So ns=8;i=6244 is a VariableType not a DataType and I guess that the error tell us exactly this.
Can you provide this code ? |
http://abbminden.org/uacompanionmodelabbtest/ is the namespace which contains object instances whose types are from different companion model namespaces. I think this is intended and the nodeset file generated is complete. Now the question is if I load standard noset and DI nodeset along with companion model nodeset i get the issue ````methodDeclaration.getInputArguments is not a function```. Is it intentional? However if I dont load the DI nodeset then i don't see this issue at least. Can you please throw light on this? |
a typical example looks like const server = new OPCUAServer({
nodeset_filename: [
nodesets.standard,
nodesets.di,
nodesets.adi,
nodesets.fti,
nodesets.machineVision,
nodesets.robotics,
"./MyOwnObjetTypeThatMayReferToDiandADIModel.xml",
"./MyOwnObjectInstances.xml",
]
}); Note:
I hope this will help. |
Thanks. That was indeed clear. Now coming to the other problem Error: cannot find dataType ns=8;i=6244 |
I was able to reprduce the behavior you described with this server
a translation of namespace was missing on the XML MethodDefinitionId attributes |
will this change solve Error: cannot find dataType ns=8;i=6244 issue as well? Please see my comment above |
Yes sure. |
it should be now fixed in node-opcua@2.14.0. please confirm |
I still get the Error: cannot find dataType ns=8;i=6244 issue Error: cannot find dataType ns=8;i=6244 |
getMethodDeclaration_ArgumentList(addressSpace, objectId, methodId) is resolved in 2.14.0 But for this I need to load the di nodeset as well along with companion model xml file. |
Yes, this is expected as the UaCompanionModel.xml contains many namespaces but not the DI, for this reason the DI must be explicitly loaded ( see my previous gist) |
@Graos Please confirmat that adding the di model helped you to get the expected behavior |
I can confirm that when i used di model in the namespace the above described issue is not seen. |
Thank you. |
Current behavior
Describe the bug
Method call with a single float type input argument results in exception in node-opcua server
To Reproduce
Steps to reproduce the behavior:
3.......
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
Exception dump
Gist
gist:
( ) my request is related to node-opcua acting as a OPCUA SERVER
( ) I have installed node-opcua as a package ( using npm install )
Device: _____
OS version: _____
Description of the other OPCUA system I am trying to connect to:
node-opcua version: :
node --version
= 2.13.0The text was updated successfully, but these errors were encountered: