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

Running datastore is not applied to the system after starting the Plugin #58

Open
randomcontainers opened this issue Oct 23, 2023 · 0 comments

Comments

@randomcontainers
Copy link

Hi,

I am currently tying to use the interfaces plugin, to configure ip addresses through sysrepo. In my system, all ip addresses are lost when the system is shut down, so I want to uses the startup datastore to store ip addresses and reenable them after booting.

My problem is that when I start the interfaces plugin after booting, I would expect it to use the current configuration of the running datastore and configure the system accordingly. (The startup datastore is copied into the running datastore when sysrepo is first used.)

I see the output of Line 314 in plugin.c "Checking running datastore against system data" but the actual function that does this seems to be disabled in the line afterwards.
I then went ahead and enabled that function. Sadly, that ends in other errors.

[INF] ietf-interfaces-plugin: Checking running datastore against system data
[INF] ietf-interfaces-plugin: Checking interface list data
[INF] ietf-interfaces-plugin: Storing interface list
[ERR] srpc: /src/src/interfaces/src/plugin/api/interfaces/store.c:143 rtnl_addr_add(sk, link_ipv4_addr, 0) error (-6)
[ERR] ietf-interfaces-plugin: nl_geterror(): -6 = Object exists
[ERR] srpc: /src/src/interfaces/src/plugin/running/store.c:94 interfaces_store_interface(ctx, if_hash) error (-1)
[ERR] ietf-interfaces-plugin: Startup store callback failed for value /ietf-interfaces:interfaces/interface[name='%s']
[ERR] srpc: /src/src/interfaces/src/plugin.c:317 interfaces_running_store(ctx, running_session) error (-1)
[ERR] ietf-interfaces-plugin: Error occured while initializing the plugin (-1)
[ERR] ietf-interfaces-plugin: sr_plugin_init_cb error
[INF] No datastore changes to apply.

An alternative approach seems to be to use the SR_SUBSCR_ENABLED flag when registering the callback in Line 328. That also doesn't work. It seems like nothing is done at all. I am not even sure if the callback is triggered at all (directly after the start of the plugin).

Do you have any ideas on how to resolve this issue?
Or is the interfaces plugin only intended for systems that keep interface configurations persistent?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant