I have some configurations in my device. When I try to delete the configurations and load my previous back up using confd_load -D -l -F x configs.xml it cannot delete the existing configs and load the back up.
I get an error as
Error:- “confd_load: 673: maapi_apply_trans_flags(sock, tid, 0, aflags) failed: external error (19): /router-dcl:network/vrf{test}/interface{ppp 2 access}/vrf-if-id: Vrf interface with id 2 already exists”
Suppose, I remove all the configurations manually and then try this
confd_load -D -l -F x configs.xml,
I get another error as:
confdload: 673: maapi_apply_trans_flags(sock, tid, 0, aflags) failed: external error (19): application error_
But, I don’t get this error if we use replace option(confd_load -r -l -F configs.xml). It replaces with the backup but allows only to edit this backup configuration. We cannot make new configurations that are not in the backup. So, we can’t use replace.
Looks like your validation application reported a validation failure.
Check which ones you have registered by doing something like this: $ confd --status | grep -A 10 "validation points"
Hi,
Thank you. But, the validation must also apply to replace option. There are no validation errors when we use replace option. How can it stop here only when we use either -D -l or just -l?
Hi,
I don’t know what or how your validation code/application determine that there is a validation error.
Your validation application should preferably not be written to validate changes/operations (seems like it does and then determines that the validation failed), rather it should validate the resulting changes.
You can point your application validation developer to ConfD UG Chapter 9.5. Validation Logic.
The difference between your two examples is that there is a maapi_delete_all() call before the configuration file is loaded. Use the “-d -d” option with the confd_load tool to get the libconfd trace output.
You can see the difference of the confd_load tool -r and -D flags compared to default behaviour just by typing confd_load -h, or in the confd_load man page, or in the confd_load source code that comes with ConfD:
$ confd_load -h
...
Valid options are (for further details, see the manpage):
-d debug flag
...
-m when loading config, merge [default is delete and replace]
-r when loading config, replace [default is delete and replace]
...
-D do maapi_delete_all(MAAPI_DEL_ALL) before loading