Status code · Address space

BadNodeClassInvalid

BadNodeClass

BadNodeClassInvalid means the node exists but is the wrong kind of node for what you asked. Calling a node that is not a Method, subscribing to events on a node that is not an event notifier, or adding a node with a class that does not match its definition all land here. Read the NodeClass attribute and correct the target.

Defined behaviour: The node class is not valid for the requested operation. (our description of the condition this code reports)

What you actually see

One specific operation fails against a node that browses and reads perfectly well, most often a method Call or an event subscription.

Why it happens

  • Object and Method NodeIds swapped in a CallThe Call service takes both an objectId - the Object that owns the method - and a methodId. Passing the method as the object, or the object as the method, is the most frequent cause of this code by a wide margin. The two are adjacent in most APIs and easy to transpose.
  • Calling something that is not a MethodA Variable holding a command word, or an Object that represents a command in the vendor's documentation, is not a Method node. Browse for HasComponent children with NodeClass Method to find what is actually callable.
  • Event monitoring on a node that is not an event notifierEvent monitored items must target a node whose EventNotifier attribute marks it as a notifier - typically the Server object, i=2253, or an area object. Pointing an event filter at an ordinary Variable is a class error, not a filter error.
  • Node management with a mismatched classAddNodes carries the NodeClass alongside the type definition and attributes. A request whose class contradicts the supplied attributes or the intended type definition is rejected here rather than as a bad argument.
  • A type node used where an instance is requiredReading the ObjectType or VariableType from a companion specification and then trying to call, write or subscribe to it. Type nodes describe instances; they are not the instances. This happens constantly when someone browses the Types folder first.

How to fix it

In diagnostic order: work down, do not skip ahead.

  1. Read NodeClass on the exact node you are targetingOne Read settles it. If the class is not Method and you are calling, or not Object or View and you are subscribing to events, you have your answer without further investigation.
  2. For Call, browse the object for its methodsBrowse the owning Object with a NodeClassMask limited to Method. Pass that Object as objectId and the method node you found as methodId. The method must be reachable from the object, usually through HasComponent.
  3. Check EventNotifier before creating event itemsRead the EventNotifier attribute on the intended source. If it does not indicate that the node produces events, subscribe on the Server object instead, which is where most servers surface plant-wide events.
  4. Work on instances, not on typesConfirm you are under the Objects folder, i=85, rather than the Types folder, i=86. Use HasTypeDefinition from an instance to reach its type when you need the model, and go back to the instance to act on data.
  5. Log the class alongside the NodeId in your clientInclude NodeClass in the error message your client emits. It converts a puzzling class error into a self-explanatory one and pays for itself the first time a vendor renames a command node.

Where it shows up, by tool and stack

Tool / stackWhat to do there
UaExpertThe Call dialog appears only for nodes UaExpert recognises as Methods, so if you cannot invoke it there, the node is not a Method. The Attributes pane confirms the class directly.
asyncua (Python)parent.call_method(method, *args) takes the owning object as the receiver, which is why calling on the wrong node produces this status. node.get_methods() lists what is actually callable.
node-opcuasession.call takes objectId and methodId explicitly, so a transposition is silent until the server rejects it. Log both ids when a call fails.
open62541 (C)UA_Client_call takes the object NodeId and the method NodeId as separate parameters in that order. Swapping them compiles cleanly and fails only at the server.
Eclipse MiloThe demo server at opc.tcp://milo.digitalpetri.com:62541/milo exposes methods under objects, which makes it a convenient place to practise the object-plus-method call pattern before doing it on a machine.
Beckhoff TwinCATPLC methods exposed over OPC UA appear as Method nodes under the object representing the function block instance. Command variables written by value are not Methods, even when the documentation calls them commands.

What it looks like in the log

Call failed: BadNodeClassInvalid (objectId=ns=4;i=1200, methodId=ns=4;i=1200)
CreateMonitoredItems: event filter requested on NodeClass Variable
Node ns=2;i=3005 has NodeClass ObjectType; expected Object

Confirm the fix

Read NodeClass on both ids you pass to Call and confirm Object and Method respectively, then execute the call and check the output arguments come back with a Good status.

Stop it happening again

Discover methods and event sources by browsing with a NodeClassMask rather than by copying ids from documentation, and include NodeClass in every configuration entry so mismatches are visible before runtime.

Stuck on more than one of these? The troubleshooting clinic works through broken configurations end to end, on camera.

Troubleshooting clinic →

Last verified 7 September 2026 against OPC UA 1.05.07. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.

Free download
OPC UA Status Code Diagnostic Tree
A 15-page diagnostic reference grouping every normative status code by what actually went wrong: with the first action for each, and the four questions that resolve most faults before you read a single code.
Get the free diagnostic tree →
Free, no course, no login