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

no function clause matching xmerl_lib:expand_element #356

Open
budnyjj opened this issue Mar 19, 2015 · 1 comment
Open

no function clause matching xmerl_lib:expand_element #356

budnyjj opened this issue Mar 19, 2015 · 1 comment

Comments

@budnyjj
Copy link

budnyjj commented Mar 19, 2015

Hello! I'm trying to tie up LINC and Ryu with OFConfig protocol.

I work with latest version of LINC (master branch), Ryu (3.19) and Erlang (R17, installed from erlang package from erlang solutions), guided by test-of-conig-with-linc doc.

I run LINC with following configuration:

[{linc,
     [{of_config,enabled},
      {capable_switch_ports,
          [{port,1,[{interface,"linc-port"}]},
           {port,2,[{interface,"linc-port2"}]},
           {port,3,[{interface,"linc-port3"}]},
           {port,4,[{interface,"linc-port4"}]}]},
      {capable_switch_queues,
          [
            {queue,991,[{min_rate,10},{max_rate,120}]},
            {queue,992,[{min_rate,10},{max_rate,130}]},
            {queue,993,[{min_rate,200},{max_rate,300}]},
            {queue,994,[{min_rate,400},{max_rate,900}]}
            ]},
      {logical_switches,
          [{switch,0,
               [{backend,linc_us4},
                {controllers,[{"Switch0-Default-Controller","127.0.0.1",6633,tcp}]},
                {controllers_listener,{"127.0.0.1",9998,tcp}},
                {queues_status,enabled},
                {ports,[{port,1,{queues,[]}},{port,2,{queues,[991,992]}}]}]}
                ,
           {switch,7,
               [{backend,linc_us3},
                {controllers,[{"Switch7-Controller","127.0.0.1",6633,tcp}]},
                {controllers_listener,disabled},
                {queues_status,enabled},
                {ports,[{port,4,{queues,[]}},{port,3,{queues,[993,994]}}]}]}
        ]}]},
 {enetconf,
     [{capabilities,
          [{base,{1,0}},
           {base,{1,1}},
           {startup,{1,0}},
           {'writable-running',{1,0}}]},
      {callback_module,linc_ofconfig},
      {sshd_ip,{127,0,0,1}},
      {sshd_port,1830},
      {sshd_user_passwords,[{"linc","linc"}]}]},
 {lager,
     [{handlers,
          [{lager_console_backend,debug},
           {lager_file_backend,
               [{"log/error.log",error,10485760,"$D0",5},
                {"log/console.log",info,10485760,"$D0",5}]}]}]},
 {sasl,
     [{sasl_error_logger,{file,"log/sasl-error.log"}},
      {errlog_type,error},
      {error_logger_mf_dir,"log/sasl"},
      {error_logger_mf_maxbytes,10485760},
      {error_logger_mf_maxfiles,5}]},
 {sync,[{excluded_modules,[procket]}]}].

and use this script as basic connectivity test:

from ryu.base import app_manager
from ryu.lib import hub
from ryu.lib.of_config import capable_switch

HOST = '127.0.0.1'
PORT = 1830
USERNAME = 'linc'
PASSWORD = 'linc'

class OFConfigClient(app_manager.RyuApp):
        def __init__(self, *args, **kwargs):
                super(OFConfigClient, self).__init__(*args, **kwargs)
                self.switch = capable_switch.OFCapableSwitch(
                        host=HOST, port=PORT, username=USERNAME, password=PASSWORD,
                        unknown_host_cb=lambda host, fingerprint: True)

        def get(self):
                data_xml = self.switch.get()
                print data_xml

if __name__ == '__main__':
        client = OFConfigClient()
        client.get()

Unfortunately, instead of correct response I get following message:

2:32:46.599 [debug] Supervisor {<0.22248.0>,ssh_subsystem_sup} started ssh_channel_sup:start_link([{address,{127,0,0,1}},{port,1830},{role,server},{socket_opts,[inet,inet,{ip,{127,0,0,1}}]},{ssh_opts,...}]) at pid <0.22249.0>
12:32:46.599 [debug] Supervisor {<0.22248.0>,ssh_subsystem_sup} started ssh_connection_sup:start_link([{address,{127,0,0,1}},{port,1830},{role,server},{socket_opts,[inet,inet,{ip,{127,0,0,1}}]},{ssh_opts,...}]) at pid <0.22250.0>
12:32:46.599 [debug] Supervisor 'ssh_system_{127,0,0,1}_1830_sup' started ssh_subsystem_sup:start_link([{address,{127,0,0,1}},{port,1830},{role,server},{socket_opts,[inet,inet,{ip,{127,0,0,1}}]},{ssh_opts,...}]) at pid <0.22248.0>
12:32:46.622 [debug] Supervisor {<0.22249.0>,ssh_channel_sup} started ssh_channel:start_link(<0.22251.0>, 0, enetconf_ssh, [], undefined) at pid <0.22252.0>
12:32:46.768 [info] Received: <<"<?xml version='1.0' encoding='UTF-8'?>\n<nc:rpc xmlns:nc=\"urn:ietf:params:xml:ns:netconf:base:1.0\" message-id=\"urn:uuid:e566c126-d2d1-11e4-9847-525400cf93cf\"><nc:get /></nc:rpc>">>

12:32:46.771 [info] SSH connection with subsystem: enetconf_ssh terminated with state: {state,<0.22251.0>,0,15,enetconf_fm_eom,{eom_parser,<<>>},linc_ofconfig}
12:32:46.771 [error] gen_server <0.22252.0> terminated with reason: no function clause matching xmerl_lib:expand_element(2, 1, [{port,3},{queue,5},{resources,2},{'capable-switch',1},{data,1},{'rpc-reply',1}], false) line 151
12:32:46.771 [error] CRASH REPORT Process <0.22252.0> with 0 neighbours exited with reason: no function clause matching xmerl_lib:expand_element(2, 1, [{port,3},{queue,5},{resources,2},{'capable-switch',1},{data,1},{'rpc-reply',1}], false) line 151 in gen_server:terminate/7 line 804
12:32:46.771 [error] Supervisor {<0.22249.0>,ssh_channel_sup} had child #Ref<0.0.0.6924> started with {ssh_channel,start_link,undefined} at <0.22252.0> exit with reason no function clause matching xmerl_lib:expand_element(2, 1, [{port,3},{queue,5},{resources,2},{'capable-switch',1},{data,1},{'rpc-reply',1}], false) line 151 in context child_terminated

on the LINC side, and following message

Traceback (most recent call last):
  File "test_linc_ofconfig.py", line 43, in <module>
    client.get()
  File "test_linc_ofconfig.py", line 18, in get
    data_xml = self.switch.get()
  File "/home/budnyjj/ryu/ryu/lib/of_config/capable_switch.py", line 111, in get
    return ofc.OFCapableSwitchType.from_xml(self.raw_get(), self.namespace)
  File "/home/budnyjj/ryu/ryu/lib/of_config/capable_switch.py", line 98, in raw_get
    reply = self.netconf.get(filter)
  File "/home/budnyjj/ryu/ryu/contrib/ncclient/manager.py", line 78, in wrapper
    return self.execute(op_cls, *args, **kwds)
  File "/home/budnyjj/ryu/ryu/contrib/ncclient/manager.py", line 132, in execute
    raise_mode=self._raise_mode).request(*args, **kwds)
  File "/home/budnyjj/ryu/ryu/contrib/ncclient/operations/retrieve.py", line 65, in request
    return self._request(node)
  File "/home/budnyjj/ryu/ryu/contrib/ncclient/operations/rpc.py", line 284, in _request
    raise self._error
ncclient.transport.errors.SessionCloseError: Unexpected session close

on the Ryu side.

@budnyjj budnyjj closed this as completed Mar 25, 2015
@budnyjj budnyjj reopened this Mar 25, 2015
@budnyjj
Copy link
Author

budnyjj commented Mar 25, 2015

Update code to reproduce bug.

@budnyjj budnyjj closed this as completed Mar 25, 2015
@budnyjj budnyjj reopened this Mar 25, 2015
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