Skip to content
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

Wrong error thrown "BadTooManyArguments" instead of "BadNotImplemented" #3032

Open
2 of 5 tasks
raserle opened this issue Mar 6, 2025 · 2 comments
Open
2 of 5 tasks
Assignees
Labels
compliance An issue was found which is not compliant with the OPC UA specification.

Comments

@raserle
Copy link

raserle commented Mar 6, 2025

Type of issue

  • Bug
  • Enhancement
  • Compliance
  • Question
  • Help wanted

Current Behavior

@romanett
In Bug you see the error "BadTooManyArguments" on call the method.
If you have a "NodeManager:CustomNodeManager2" with Call method
Image

and call the base
Image

you end in MethodState
Image
and on line 653 is the return. That is what happen wenn no method implemented.

The correct check what we need, comes in this call.
Image

That is a test for implementation of method, and this could return NotImplemented. But with the checks before we never reach this.
Image

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- OS:
- Environment:
- Runtime:
- Nuget Version:
- Component:
- Server:
- Client:

Anything else?

No response

@romanett romanett self-assigned this Mar 6, 2025
@romanett
Copy link
Contributor

romanett commented Mar 6, 2025

@raserle Thanks for bringing this up
MethodState is initialized with (User)Exectuable true.
And I don`t think we can change it without breaking existing implementations.
So not shure if this StatusCode would ever be thrown, even if we put the check before the input arguments validation.

@raserle
Copy link
Author

raserle commented Mar 6, 2025

Thats the body of the second Call Method, that get called after check input/output params

GenericMethodCalledEventHandler2 onCallMethod2 = OnCallMethod2;
if (onCallMethod2 != null)
{
    return onCallMethod2(context, this, objectId, inputArguments, outputArguments);
}
GenericMethodCalledEventHandler onCallMethod = this.OnCallMethod;
if (onCallMethod != null)
{
    return onCallMethod(context, this, inputArguments, outputArguments);
}
if (Executable && UserExecutable)
{
    return StatusCodes.BadNotImplemented;
}
return StatusCodes.BadUserAccessDenied;

Is it possible to test, before run argument tests?

GenericMethodCalledEventHandler2 onCallMethod2 = OnCallMethod2;
GenericMethodCalledEventHandler onCallMethod = this.OnCallMethod;

if (onCallMethod2 == null && onCallMethod == null) return NotImplemented....

@romanett romanett added the compliance An issue was found which is not compliant with the OPC UA specification. label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compliance An issue was found which is not compliant with the OPC UA specification.
Projects
None yet
Development

No branches or pull requests

2 participants