clicon / clixon-controller

Clixon network controller
Apache License 2.0
12 stars 4 forks source link

Backend may exit with assertion if the device return warnings #77

Closed krihal closed 6 months ago

krihal commented 6 months ago
Dec 12 11:08:33: device_state_recv_config
Dec 12 11:08:33: yang_mount_get /ctrl:devices/ctrl:device[ctrl:name='ptx']/ctrl:config 0x556a7ab4ae60
Dec 12 11:08:33: Reading datastore /usr/local/var/controller/device-ptx-TRANSIENT_db using xml
Dec 12 11:08:33: yang_mount_get /ctrl:devices/ctrl:device[ctrl:name='ptx']/ctrl:config 0x556a7ab4ae60
Dec 12 11:08:33: Send [ptx]: <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5"><edit-config><target><candidate/></target><default-operation>none</default-operation><config><configuration xmlns="http://yang.juniper.net/junos/conf/root"><interfaces xmlns="http://yang.juniper.net/junos/conf/interfaces"><interface><name>et-0/2/0</name><unit nc:operation="merge"><name>0</name></unit></interface></interfaces></configuration></config></edit-config></rpc>]]>]]>
Dec 12 11:08:33: device_handle_conn_state_set ptx: PUSH-CHECK -> PUSH-EDIT
Dec 12 11:08:33: Recv [ptx]:
<nc:rpc-reply  xmlns:junos="http://xml.juniper.net/junos/22.4R0/junos"  xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="5">
<nc:ok/>
</nc:rpc-reply>

Dec 12 11:08:33: device_send_rpc <validate><source><candidate/></source></validate>
Dec 12 11:08:33: Send [ptx]: <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="7"><validate><source><candidate/></source></validate></rpc>]]>]]>
Dec 12 11:08:33: device_handle_conn_state_set ptx: PUSH-EDIT -> PUSH-VALIDATE
Dec 12 11:08:34: Recv [ptx]:
<nc:rpc-reply xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:junos="http://xml.juniper.net/junos/22.4R0/junos"  message-id="7">
<nc:rpc-error>
<nc:error-severity>warning</nc:error-severity>
<nc:error-path>[edit routing-instances CPE-LU protocols]</nc:error-path>
<nc:error-message>mustd: requires 'bgp' license</nc:error-message>
<nc:error-info>
<nc:bad-element>bgp</nc:bad-element>
</nc:error-info>
</nc:rpc-error>
<nc:rpc-error>
<nc:error-severity>warning</nc:error-severity>
<nc:error-path>[edit routing-instances CPE-LU protocols]</nc:error-path>
<nc:error-message>mustd: requires 'ospf' license</nc:error-message>
<nc:error-info>
<nc:bad-element>ospf</nc:bad-element>
</nc:error-info>
</nc:rpc-error>
<nc:rpc-error>
<nc:error-type>application</nc:error-type>
<nc:error-tag>invalid-value</nc:error-tag>
<nc:error-severity>error</nc:error-severity>
<nc:error-path>[edit interfaces et-0/2/0]</nc:error-path>
<nc:error-message>mustd: VLAN-ID must be specified on tagged ethernet interfaces</nc:error-message>
<nc:error-info>
<nc:bad-element>unit 0</nc:bad-element>
</nc:error-info>
</nc:rpc-error>
<nc:rpc-error>
<nc:error-type>protocol</nc:error-type>
<nc:error-tag>operation-failed</nc:error-tag>
<nc:error-severity>error</nc:error-severity>
<nc:error-message>
configuration check-out failed: (validation hook evaluation failed)
</nc:error-message>
</nc:rpc-error>
</nc:rpc-reply>

clixon_backend: clixon_handle.c:209: clicon_data: Assertion `clicon_handle_check(h)==0' failed.
Aborted
olofhagsand commented 6 months ago

clixon_backend: clixon_handle.c:209: clicon_data: Assertionclicon_handle_check(h)==0' failed.` is low-level and is a sanity check. Such a failure could be a memory error. A stack would be nice. Especially to know if the error happens in device_state_recv_ok() and if so which linenr.

krihal commented 6 months ago
(gdb) where
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7cf0537 in __GI_abort () at abort.c:79
#2  0x00007ffff7cf040f in __assert_fail_base (
    fmt=0x7ffff7e67688 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n",
    assertion=0x7ffff7f970b7 "clicon_handle_check(h)==0", file=0x7ffff7f970a7 "clixon_handle.c", line=209,
    function=<optimized out>) at assert.c:92
#3  0x00007ffff7cff662 in __GI___assert_fail (assertion=0x7ffff7f970b7 "clicon_handle_check(h)==0",
    file=0x7ffff7f970a7 "clixon_handle.c", line=209,
    function=0x7ffff7f97128 <__PRETTY_FUNCTION__.4> "clicon_data") at assert.c:101
#4  0x00007ffff7f2cbf9 in clicon_data (h=0x555555732710) at clixon_handle.c:209
#5  0x00007ffff7f60f7e in plugin_module_struct_get (h=0x555555732710) at clixon_plugin.c:131
#6  0x00007ffff7f61062 in clixon_plugin_each (h=0x555555732710, cpprev=0x0) at clixon_plugin.c:213
#7  0x00007ffff7f62f7d in clixon_plugin_netconf_errmsg_all (h=0x555555732710, xerr=0x5556242ed0d0,
    cberr=0x555623e09430) at clixon_plugin.c:1219
#8  0x00007ffff7f7c960 in netconf_err2cb (h=0x555555732710, xerr=0x5556242ed0d0, cberr=0x555623e09430)
    at clixon_netconf_lib.c:1778
#9  0x00007ffff7ca0440 in device_state_recv_ok (dh=0x555555732710, xmsg=0x5556242ed150,
    rpcname=0x555623ddd270 "rpc-reply", conn_state=CS_PUSH_VALIDATE, cberr=0x7fffffffc100)
    at controller_device_recv.c:598
#10 0x00007ffff7c9acf5 in device_state_handler (h=0x55555556d2a0, dh=0x555555732710, s=8,
    xmsg=0x5556242ed150) at controller_device_state.c:1265
#11 0x00007ffff7c986d1 in device_input_cb (s=8, arg=0x555555732710) at controller_device_state.c:298
#12 0x00007ffff7f29849 in clixon_event_loop (h=0x55555556d2a0) at clixon_event.c:449
#13 0x000055555555d970 in main (argc=0, argv=0x7fffffffe610) at backend_main.c:1098
(gdb)