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

Non-obvious behavior of clixon_snmp after snmpset command when transaction validation returns an error #375

Closed
vvsosed opened this issue Oct 5, 2022 · 3 comments

Comments

@vvsosed
Copy link
Contributor

vvsosed commented Oct 5, 2022

If we try to change the value using the snmpset command with the value that causes tgcad_clixon_plugin_validate returns an error then the operation is declined. However, after this operation, the clixon backend stores the wrong value in the candidate database. So following well-formed snmpset command after the wrong one fails too. I think it happens because following transaction data is concatenated with the previous bad transaction in the candidate database. As it seems to me now, we cannot reset the candidate database through snmp in any way, so I consider that any other snmpset command will be blocked.
The only way to fix this now is to call discard via the netconf interface. But I don't see any way how to overcome this issue through snmp only.
To solve the problem, I suggest automatically clearing the candidate database in case if the ongoing change was received from snmp and causes tgcad_clixon_plugin_validate returns an error.

@olofhagsand olofhagsand added the bug label Oct 5, 2022
olofhagsand added a commit that referenced this issue Oct 8, 2022
…hen transaction validation returns an error](#375)

* Changed `clicon_rpc_commit()` and `clicon_rpc_validate`: Added three-value return.
@olofhagsand
Copy link
Member

Fixed by discarding candidate if commit fails

@vvsosed
Copy link
Contributor Author

vvsosed commented Oct 21, 2022

As a whole, the problem was fixed, but one annoying issue still exists.
In case when "snmpset" command was declined in clixon by validation procedure I think that an appropriate error message should be printed. But, unfortunately, now it is absent. I think that such behavior will entangle because currently, the error output writes only in the log file, and for someone who used snmpset the result of execution will seem successful for this case.

olofhagsand added a commit that referenced this issue Oct 25, 2022
…hen transaction validation returns an error](#375)

  * Fixed by validating writes on ACTION instead of COMMIT since libnetsnmp seems not to accept commit errors
@olofhagsand
Copy link
Member

Fixed by validating writes on ACTION instead of COMMIT since libnetsnmp seems not to accept commit errors

@vvsosed vvsosed closed this as completed Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants