Skip to content

AttributeError: 'NoneType' object has no attribute 'port_down'  #3566

Closed

Description

@shivarammysore

Testing dot1x functionality causes Faucet fatality. Using faucet/faucet:1.9.36

May 22 05:22:55 faucet.valve INFO     DPID 63431407396 (0xec4ce7724) ovs-qotom-sfcloud table ID 2 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 32 table_id: 2 vlan_port_scale: 4.1
May 22 05:22:55 faucet.valve INFO     DPID 63431407396 (0xec4ce7724) ovs-qotom-sfcloud table ID 3 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 32 table_id: 3 vlan_scale: 16
(1) wsgi starting up on http://0.0.0.0:9302

May 22 05:27:59 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Cold start configuring DP
May 22 05:27:59 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 1 (Trunk Port) configured
May 22 05:27:59 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 2 (NFV SW Port) configured
May 22 05:27:59 faucet.exception ERROR    Unhandled exception, killing RYU
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
    func(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
    valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
  File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
    return valve.datapath_connect(now, discovered_up_ports)
  File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 753, in datapath_connect
    ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
  File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 422, in _add_ports_and_vlans
    all_up_port_nos, cold_start=True, log_msg='configured'))
  File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 895, in ports_add
    self.dp.dp_id, self.dp.dot1x_ports(), nfv_sw_port))
  File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 180, in nfv_sw_port_up
    self._dot1x_speaker.port_down(
AttributeError: 'NoneType' object has no attribute 'port_down'
May 22 05:27:59 faucet.exception ERROR    Unhandled exception, killing RYU
Traceback (most recent call last):
  File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
    func(*args, **kwargs)
  File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
    valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
  File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
    return valve.datapath_connect(now, discovered_up_ports)
  File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 753, in datapath_connect
    ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
  File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 422, in _add_ports_and_vlans
    all_up_port_nos, cold_start=True, log_msg='configured'))
  File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 895, in ports_add
    self.dp.dp_id, self.dp.dot1x_ports(), nfv_sw_port))
  File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 180, in nfv_sw_port_up
    self._dot1x_speaker.port_down(
AttributeError: 'NoneType' object has no attribute 'port_down'
version:2
acls:
  pre_auth:
  - rule:
     dl_type: 0x800  # A
     ip_proto: 1
     actions:
      allow: False
  post_auth:
  - rule:
     actions:
      allow: True
dps:
  ovs-qotom-allbirds-1:
    dp_id: 63431404909
    dot1x:
      radius_ip: "10.20.5.7"
      radius_port: 1812
      radius_secret: "SECRET"
      nfv_intf: "eno2"
      nfv_sw_port: 2
      auth_acl: "post_auth"
      noauth_acl: "pre_auth"
    hardware: Open vSwitch
    interfaces:
      1:
        description: "Trunk Port"
        name: "trunk"
        tagged_vlans: [office,home]
      2:
        description: "NFV SW Port"
        name: "802.1x"
        output_only: true
      3:
        description: "Office NW Laptop"
        native_vlan: office
        acls_in: [pre_auth, post_auth]
    name: ovs-qotom-allbirds-1
vlans:
  office:
    description: office network
    name: office
    vid: 150
  home:
    vid: 151
    description: "home network"

Activity

  1. shivarammysore commented on May 22, 2020

    @shivarammysore
    ContributorAuthor

    I also think that https://github.com/faucetsdn/faucet/blob/master/faucet/faucet_dot1x.py#L186 should be PORT_DOWN - in the log entry.

  2. gizmoguy commented on May 22, 2020

    @gizmoguy
    Member

    Can you try the latest version of faucet, and provide a reproduction case (i.e what you did to cause the crash).

  3. shivarammysore commented on May 23, 2020

    @shivarammysore
    ContributorAuthor

    Used the latest version of faucet. Same errors.
    How to reproduce?
    Follow the setup per https://docs.faucet.nz/en/latest/configuration.html?highlight=check_faucet_config#x-dp
    In my setup, eth1 is eno2. Also, the "Faucet" box consists of 3 containers:

    1. faucet/faucet:1.9.42
    2. Chewie - built from https://github.com/faucetsdn/chewie/blob/master/Dockerfile.chewie but, I get the git repo also into the container
    3. Radius - built from https://github.com/faucetsdn/chewie/blob/master/Dockerfile.freeradius

    My Laptop is connected to port 3 and port 2 is connected to eno2 of the "Faucet + Chewie + Radius" box

    Run CMD for each container:

    1. faucet: --network="host -e "FAUCET_EVENT_SOCK=0" -e "FAUCET_CONFIG_STAT_RELOAD=true" -e "FAUCET_LOG=STDOUT" -e "FAUCET_EXCEPTION_LOG=STDERR" --volume=${PWD}/faucet/:/etc/faucet/ faucet/faucet:1.9.42 faucet --ryu-ofp-tcp-listen-port=6653 faucet/faucet:1.9.42 faucet --ryu-ofp-tcp-listen-port=6653
    2. Chewie: chewie:latest chewie --interface eno2 --radius_ip 127.0.0.1 --radius_secret $SECRET
    3. Radius Docker file set to: CMD ["freeradius", "-fxx", "-l", "stdout"]

    All the 3 containers are running. My laptop is still not connected to the "host" port.

    Below are my Chewie & Radius logs. Note the "000ec4ce6d6e" . This is the MAC address of nfv_sw_port. Faucet has already crashed on with the logs already recorded in the earlier part of this report.

    Chewie Logs

    2020-05-23 02:47:17,125 - CHEWIE.Chewie - INFO - Received DHCP packet for MAB. packed_message: b'\xff\xff\xff\xff\xff\xff\x00\x0e\xc4\xcemn\x08\x00E\xc0\x01>\x00\x00\x00\x00@\x11x\xf0\x00\x00\x00\x00\xff\xff\xff\xff\x00D\x00C\x01*\xd2G\x01\x01\x06\x00T\xf2\xf9\x18Z\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\xc4\xcemn\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00c\x82Sc5\x01\x01=\x13\xff\xcb9\n\xc7\x00\x02\x00\x00\xab\x11q\xe4\xdb\x04q1s\t7\t\x01\x03\x0c\x0f\x06\x1a!y*9\x02\x02@\x0c\x08allbirds\xff'
    2020-05-23 02:47:17,126 - CHEWIE.Chewie - INFO - Sending MAC to MAB State Machine: 00:0e:c4:ce:6d:6e
    2020-05-23 02:47:17,126 - CHEWIE.Chewie - INFO - Port based state machines are as follows: {'00:0e:c4:ce:6d:6e': <chewie.state_machines.mab_state_machine.MacAuthenticationBypassStateMachine object at 0x7f5403f44190>}
    2020-05-23 02:47:17,126 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Received event: <class 'chewie.event.EventMessageReceived'> with starting state: AAA_FAILURE
    2020-05-23 02:47:17,126 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering eth_received_state
    2020-05-23 02:47:17,126 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering aaa_request_state
    2020-05-23 02:47:17,127 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering aaa_idle_state
    2020-05-23 02:47:17,127 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - end state: AAA_IDLE
    2020-05-23 02:47:17,127 - CHEWIE.Chewie - INFO - Sending Radius Packet. Mac <class 'chewie.mac_address.MacAddress'> 00:0e:c4:ce:6d:6e, Username: 00:0e:c4:ce:6d:6e 
    Enterting outbound mab request
    2020-05-23 02:47:17,127 - CHEWIE.Chewie - INFO - Sending MAB to RADIUS: 00:0e:c4:ce:6d:6e
    2020-05-23 02:47:17,128 - CHEWIE.Chewie - INFO - sent radius message.
    2020-05-23 02:47:17,128 - CHEWIE.Chewie - INFO - waiting for MAB activity.
    2020-05-23 02:47:18,130 - CHEWIE.Chewie - INFO - Received RADIUS message: <chewie.radius.RadiusAccessReject object at 0x7f5403a37990>
    2020-05-23 02:47:18,130 - CHEWIE.Chewie - INFO - Radius packet event being built: <chewie.radius.RadiusAccessReject object at 0x7f5403a37990>
    2020-05-23 02:47:18,130 - CHEWIE.Chewie - INFO - Port based state machines are as follows: {'00:0e:c4:ce:6d:6e': <chewie.state_machines.mab_state_machine.MacAuthenticationBypassStateMachine object at 0x7f5403f44190>}
    2020-05-23 02:47:18,131 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Received event: <class 'chewie.event.EventRadiusMessageReceived'> with starting state: AAA_IDLE
    2020-05-23 02:47:18,131 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering aaa_received_state
    2020-05-23 02:47:18,131 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering aaa_failure_state
    2020-05-23 02:47:18,131 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Authentication Failed: MAC is not approved for MAB 00:0e:c4:ce:6d:6e
    2020-05-23 02:47:18,131 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Failed MAB Authentication. Running Failure Handler
    failure of address 00:0e:c4:ce:6d:6e on port ff:ff:ff:ff:ff:ff
    2020-05-23 02:47:18,132 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - end state: AAA_FAILURE
    2020-05-23 02:47:18,132 - CHEWIE.Chewie - INFO - waiting for radius.
    

    Radius Logs

    Thread 3 got semaphore
    Thread 3 handling request 779, (156 handled so far)
    (779) Received Access-Request Id 194 from 127.0.0.1:36845 to 127.0.0.1:1812 length 95
    (779)   User-Name = "000ec4ce6d6e"
    (779)   Calling-Station-Id = "00-0e-c4-ce-6d-6e"
    (779)   NAS-Port = 16777215
    (779)   User-Password = "000ec4ce6d6e"
    (779)   Message-Authenticator = 0xf00e355b6d34302e437b804b65cefb87
    (779) # Executing section authorize from file /etc/freeradius/3.0/sites-enabled/default
    (779)   authorize {
    (779)     policy filter_username {
    (779)       if (&User-Name) {
    (779)       if (&User-Name)  -> TRUE
    (779)       if (&User-Name)  {
    (779)         if (&User-Name =~ / /) {
    (779)         if (&User-Name =~ / /)  -> FALSE
    (779)         if (&User-Name =~ /@[^@]*@/ ) {
    (779)         if (&User-Name =~ /@[^@]*@/ )  -> FALSE
    (779)         if (&User-Name =~ /\.\./ ) {
    (779)         if (&User-Name =~ /\.\./ )  -> FALSE
    (779)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))  {
    (779)         if ((&User-Name =~ /@/) && (&User-Name !~ /@(.+)\.(.+)$/))   -> FALSE
    (779)         if (&User-Name =~ /\.$/)  {
    (779)         if (&User-Name =~ /\.$/)   -> FALSE
    (779)         if (&User-Name =~ /@\./)  {
    (779)         if (&User-Name =~ /@\./)   -> FALSE
    (779)       } # if (&User-Name)  = notfound
    (779)     } # policy filter_username = notfound
    (779)     [preprocess] = ok
    (779)     [chap] = noop
    (779)     [mschap] = noop
    (779)     [digest] = noop
    (779) suffix: Checking for suffix after "@"
    (779) suffix: No '@' in User-Name = "000ec4ce6d6e", looking up realm NULL
    (779) suffix: No such realm "NULL"
    (779)     [suffix] = noop
    (779) eap: No EAP-Message, not doing EAP
    (779)     [eap] = noop
    (779)     [files] = noop
    (779)     [expiration] = noop
    (779)     [logintime] = noop
    (779) pap: WARNING: No "known good" password found for the user.  Not setting Auth-Type
    (779) pap: WARNING: Authentication will fail unless a "known good" password is available
    (779)     [pap] = noop
    (779)   } # authorize = ok
    (779) ERROR: No Auth-Type found: rejecting the user via Post-Auth-Type = Reject
    (779) Failed to authenticate the user
    (779) Using Post-Auth-Type Reject
    (779) # Executing group from file /etc/freeradius/3.0/sites-enabled/default
    (779)   Post-Auth-Type REJECT {
    (779) attr_filter.access_reject: EXPAND %{User-Name}
    (779) attr_filter.access_reject:    --> 000ec4ce6d6e
    (779) attr_filter.access_reject: Matched entry DEFAULT at line 11
    (779)     [attr_filter.access_reject] = updated
    (779)     [eap] = noop
    (779)     policy remove_reply_message_if_eap {
    (779)       if (&reply:EAP-Message && &reply:Reply-Message) {
    (779)       if (&reply:EAP-Message && &reply:Reply-Message)  -> FALSE
    (779)       else {
    (779)         [noop] = noop
    (779)       } # else = noop
    (779)     } # policy remove_reply_message_if_eap = noop
    (779)   } # Post-Auth-Type REJECT = updated
    (779) Delaying response for 1.000000 seconds
    Thread 3 waiting to be assigned a request
    Waking up in 0.6 seconds.
    (779) Sending delayed response
    (779) Sent Access-Reject Id 194 from 127.0.0.1:1812 to 127.0.0.1:36845 length 20
    Waking up in 3.9 seconds.
    (779) Cleaning up request packet ID 194 with timestamp +162079
    Ready to process requests
    
  4. shivarammysore commented on May 23, 2020

    @shivarammysore
    ContributorAuthor

    I was able to address one issue - username 000ec4ce6d6e which is the MAC address of nfv_sw_port. I did that by adding a line similar to https://github.com/faucetsdn/chewie/blob/master/etc/freeradius/users#L22 in users file.
    Not sure if this is the correct way of doing things.

    Faucet still bombs with the same kind of log:

    May 23 05:41:57 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Cold start configuring DP
    May 23 05:41:57 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 1 (Trunk Port) configured
    May 23 05:41:57 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 2 (NFV SW Port) configured
    May 23 05:41:57 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    May 23 05:41:57 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    
  5. gizmoguy commented on May 23, 2020

    @gizmoguy
    Member

    We don't support external chewie containers at the moment, so you can't run an external one in a docker.

    Run chewie with faucet and I imagine this crash will go away.

  6. shivarammysore commented on May 23, 2020

    @shivarammysore
    ContributorAuthor

    used supervisor to start both faucet and chewie in the same container. Still same error:

    (10) wsgi starting up on http://0.0.0.0:9302
    May 23 15:57:45 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Cold start configuring DP
    May 23 15:57:45 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 1 (Trunk Port) configured
    May 23 15:57:45 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 2 (NFV SW Port) configured
    May 23 15:57:45 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    May 23 15:57:45 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    2020-05-23 15:57:45,081 INFO exited: faucet (terminated by SIGTERM; not expected)
    2020-05-23 15:58:18,729 - CHEWIE.Chewie - INFO - Received DHCP packet for MAB. packed_message: b'\xff\xff\xff\xff\xff\xff\x00\x0e\xc4\xcemn\x08\x00E\xc0\x01>\x00\x00\x00\x00@\x11x\xf0\x00\x00\x00\x00\xff\xff\xff\xff\x00D\x00C\x01*\x18\xe2\x01\x01\x06\x00T\xf2\xf9\x18\x13\xee\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\xc4\xcemn\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00c\x82Sc5\x01\x01=\x13\xff\xcb9\n\xc7\x00\x02\x00\x00\xab\x11q\xe4\xdb\x04q1s\t7\t\x01\x03\x0c\x0f\x06\x1a!y*9\x02\x02@\x0c\x08allbirds\xff'
    2020-05-23 15:58:18,729 - CHEWIE.Chewie - INFO - Sending MAC to MAB State Machine: 00:0e:c4:ce:6d:6e
    2020-05-23 15:58:18,730 - CHEWIE.Chewie - INFO - Port based state machines are as follows: {}
    2020-05-23 15:58:18,730 - CHEWIE.Chewie - INFO - Creating MAB State Machine
    2020-05-23 15:58:18,731 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Received event: <class 'chewie.event.EventMessageReceived'> with starting state: DISABLED
    2020-05-23 15:58:18,732 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering eth_received_state
    2020-05-23 15:58:18,732 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering aaa_request_state
    2020-05-23 15:58:18,732 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering aaa_idle_state
    2020-05-23 15:58:18,733 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - end state: AAA_IDLE
    2020-05-23 15:58:18,733 - CHEWIE.Chewie - INFO - Sending Radius Packet. Mac <class 'chewie.mac_address.MacAddress'> 00:0e:c4:ce:6d:6e, Username: 00:0e:c4:ce:6d:6e 
    Enterting outbound mab request
    2020-05-23 15:58:18,733 - CHEWIE.Chewie - INFO - Sending MAB to RADIUS: 00:0e:c4:ce:6d:6e
    2020-05-23 15:58:18,734 - CHEWIE.Chewie - INFO - sent radius message.
    2020-05-23 15:58:18,734 - CHEWIE.Chewie - INFO - waiting for MAB activity.
    2020-05-23 15:58:18,736 - CHEWIE.Chewie - INFO - Received RADIUS message: <chewie.radius.RadiusAccessAccept object at 0x7f52f7a5e9d0>
    2020-05-23 15:58:18,736 - CHEWIE.Chewie - INFO - Radius packet event being built: <chewie.radius.RadiusAccessAccept object at 0x7f52f7a5e9d0>
    2020-05-23 15:58:18,736 - CHEWIE.Chewie - INFO - Port based state machines are as follows: {'00:0e:c4:ce:6d:6e': <chewie.state_machines.mab_state_machine.MacAuthenticationBypassStateMachine object at 0x7f52f85909d0>}
    2020-05-23 15:58:18,736 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Received event: <class 'chewie.event.EventRadiusMessageReceived'> with starting state: AAA_IDLE
    2020-05-23 15:58:18,736 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering aaa_received_state
    2020-05-23 15:58:18,737 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Entering aaa_success_state
    2020-05-23 15:58:18,737 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Authentication Passed: MAC is approved for MAB 00:0e:c4:ce:6d:6e
    2020-05-23 15:58:18,737 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - Successful MAB Authentication. Running Auth Handler
    2020-05-23 15:58:18,737 - CHEWIE - INFO - Authentication successful for address 00:0e:c4:ce:6d:6e on port ff:ff:ff:ff:ff:ff
    2020-05-23 15:58:18,737 - CHEWIE - INFO - Arguments passed from Chewie to Faucet: 
    *args:({'NAS-Filter-Rule': b'deny in tcp from any to any'},)
    **kwargs{}
    2020-05-23 15:58:18,737 - CHEWIE.Chewie - DEBUG - submitted job reauth_port expire in 3600, args: (MacAddress.from_string("00:0e:c4:ce:6d:6e"), 'ff:ff:ff:ff:ff:ff')
    2020-05-23 15:58:18,738 - CHEWIE.Chewie.SM - port: ff:ff:ff:ff:ff:ff, client: 00:0e:c4:ce:6d:6e - INFO - end state: AAA_SUCCESS
    2020-05-23 15:58:18,738 - CHEWIE.Chewie - INFO - waiting for radius.
    
  7. shivarammysore commented on May 23, 2020

    @shivarammysore
    ContributorAuthor

    I did another experiment to start chewie first and then faucet. Still same error:

    (10) wsgi starting up on http://0.0.0.0:9302
    May 23 20:45:05 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Cold start configuring DP
    May 23 20:45:05 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 1 (Trunk Port) configured
    May 23 20:45:05 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 2 (NFV SW Port) configured
    May 23 20:45:05 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    May 23 20:45:05 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    2020-05-23 20:45:05,078 INFO exited: faucet (terminated by SIGTERM; not expected)
    
  8. gizmoguy commented on May 23, 2020

    @gizmoguy
    Member

    No, what I mean is that chewie can't be separate to faucet at all, it runs inside the faucet process as a python module.

    Running inside the same container is not sufficient.

  9. shivarammysore commented on May 24, 2020

    @shivarammysore
    ContributorAuthor

    Thanks @gizmoguy
    Still same error ... Just run Faucet with the previously provided faucet.yaml ...

    May 24 02:56:02 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 2 (NFV SW Port) configured
    May 24 02:56:02 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    May 24 02:56:02 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    
  10. gizmoguy commented on May 24, 2020

    @gizmoguy
    Member

    Could you please share your entire faucet log so I can see the chewie log entries to see if it had a healthy startup?

  11. shivarammysore commented on May 24, 2020

    @shivarammysore
    ContributorAuthor

    Here it is ..

    Starting with UID=0 GID=0
    loading app faucet.faucet
    loading app ryu.controller.ofp_handler
    instantiating app None of DPSet
    creating context dpset
    creating context faucet_experimental_api
    instantiating app faucet.faucet of Faucet
    instantiating app ryu.controller.ofp_handler of OFPHandler
    May 24 03:30:17 faucet INFO     version 1.9.42
    May 24 03:30:17 faucet INFO     Reloading configuration
    May 24 03:30:17 faucet INFO     configuration /etc/faucet/faucet.yaml changed, analyzing differences
    May 24 03:30:17 faucet INFO     Add new datapath DPID 130593846913 (0x1e67fff681)
    May 24 03:30:17 faucet.valve INFO     DPID 130593846913 (0x1e67fff681) ovs-intelsdn-2 table ID 0 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 vlan_port_scale: 1.5
    May 24 03:30:17 faucet.valve INFO     DPID 130593846913 (0x1e67fff681) ovs-intelsdn-2 table ID 1 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 64 table_id: 1 vlan_port_scale: 4.1
    May 24 03:30:17 faucet.valve INFO     DPID 130593846913 (0x1e67fff681) ovs-intelsdn-2 table ID 2 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 64 table_id: 2 vlan_port_scale: 4.1
    May 24 03:30:17 faucet.valve INFO     DPID 130593846913 (0x1e67fff681) ovs-intelsdn-2 table ID 3 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 32 table_id: 3 vlan_scale: 16
    May 24 03:30:17 faucet INFO     Add new datapath DPID 63431404909 (0xec4ce6d6d)
    May 24 03:30:17 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 0 table config match_types: (('eth_src', False), ('eth_type', False), ('in_port', False), ('ip_proto', False), ('udp_dst', False), ('udp_src', False)) name: port_acl next_tables: ['vlan', 'eth_dst', 'flood'] output: True set_fields: ('eth_dst', 'eth_src') size: 32
    May 24 03:30:17 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 1 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 table_id: 1 vlan_port_scale: 1.5
    May 24 03:30:17 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 2 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 32 table_id: 2 vlan_port_scale: 4.1
    May 24 03:30:17 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 3 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 32 table_id: 3 vlan_port_scale: 4.1
    May 24 03:30:17 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 4 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 64 table_id: 4 vlan_scale: 16
    May 24 03:30:17 faucet INFO     Add new datapath DPID 63431407397 (0xec4ce7725)
    May 24 03:30:17 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 0 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 vlan_port_scale: 1.5
    May 24 03:30:17 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 1 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 32 table_id: 1 vlan_port_scale: 4.1
    May 24 03:30:17 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 2 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 32 table_id: 2 vlan_port_scale: 4.1
    May 24 03:30:17 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 3 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 32 table_id: 3 vlan_scale: 16
    (1) wsgi starting up on http://0.0.0.0:9302
    May 24 03:30:21 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Cold start configuring DP
    May 24 03:30:21 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 1 (Trunk Port) configured
    May 24 03:30:21 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 2 (NFV SW Port) configured
    May 24 03:30:21 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    May 24 03:30:21 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    
  12. gizmoguy commented on May 24, 2020

    @gizmoguy
    Member

    Okay the issue is that chewie is not starting up, here is the example of a healthy log:

    May 24 03:07:14 faucet INFO     version 1.9.42
    May 24 03:07:14 faucet INFO     Reloading configuration
    May 24 03:07:14 faucet INFO     configuration /etc/faucet/faucet.yaml changed, analyzing differences
    May 24 03:07:14 faucet INFO     Add new datapath DPID 1 (0x1)
    May 24 03:07:14 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 0 table config match_types: (('eth_src', False), ('eth_type', False), ('in_port', False), ('ip_proto', False), ('udp_dst', False), ('udp_src', False)) name: port_acl next_tables: ['vlan', 'eth_dst', 'flood'] output: True set_fields: ('eth_dst', 'eth_src') size: 32
    May 24 03:07:14 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 1 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 table_id: 1 vlan_port_scale: 1.5
    May 24 03:07:14 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 2 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 64 table_id: 2 vlan_port_scale: 4.1
    May 24 03:07:14 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 3 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 64 table_id: 3 vlan_port_scale: 4.1
    May 24 03:07:14 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 4 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 64 table_id: 4 vlan_scale: 16
    May 24 03:07:14 faucet INFO     dot1x enabled on sw1 (0) port Port 1, NFV interface tap0
    May 24 03:07:14 faucet.Chewie INFO     Starting
    May 24 03:07:14 faucet.Chewie.EapSocket INFO     Setting up socket on interface: tap0
    May 24 03:07:14 faucet.Chewie.MabSocket INFO     Setting up socket on interface: tap0
    May 24 03:07:14 faucet.Chewie.RadiusSocket INFO     Setting up radius socket.
    May 24 03:07:14 faucet.Chewie INFO     Radius Listening on 0.0.0.0:0
    May 24 03:07:14 faucet.Chewie INFO     waiting for eap.
    May 24 03:07:14 faucet.Chewie INFO     waiting for MAB activity.
    May 24 03:07:14 faucet.Chewie INFO     waiting for radius.
    May 24 03:07:18 faucet.valve INFO     DPID 1 (0x1) sw1 Cold start configuring DP
    

    Could you try using faucet outside of docker (e.g the faucet apt packages) and see if that makes chewie start up? That is the only difference I can think between my setup and yours.

  13. shivarammysore commented on May 24, 2020

    @shivarammysore
    ContributorAuthor

    Sure - will try that.
    One other difference is that I am using eno2 - physical interface as compared to tap0

  14. gizmoguy commented on May 24, 2020

    @gizmoguy
    Member

    Interface name doesn't matter - but it does need to exist, I assume you have an eno2 inside your docker container?

  15. shivarammysore commented on May 24, 2020

    @shivarammysore
    ContributorAuthor

    Yes -

    sudo docker exec -it faucet-cntr bash
    
    bash-5.0# ifconfig eno2
    eno2      Link encap:Ethernet  HWaddr 00:1E:67:FF:F6:81  
              inet6 addr: cafe:babe::21e:67ff:feff:f681/64 Scope:Global
              inet6 addr: fe80::21e:67ff:feff:f681/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:11182060 errors:0 dropped:0 overruns:0 frame:0
              TX packets:5925388 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:7882542708 (7.3 GiB)  TX bytes:5236604083 (4.8 GiB)
    bash-5.0# 
    
    
  16. shivarammysore commented on May 24, 2020

    @shivarammysore
    ContributorAuthor

    Using Ubuntu 20.04

    # apt-cache show faucet
    Package: faucet
    Priority: optional
    Section: python
    Installed-Size: 41
    Maintainer: Faucet Maintainers <maintainers@faucet.nz>
    Architecture: all
    Version: 1.9.42
    Depends: adduser, python3-faucet (>= 1.9.0)
    ...
    
    # ip a show eno2
    13: eno2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether 00:1e:67:ff:f6:81 brd ff:ff:ff:ff:ff:ff
        inet 10.20.30.205/16 brd 10.20.255.255 scope global dynamic eno2
           valid_lft 3337sec preferred_lft 3337sec
        inet6 cafe:babe::21e:67ff:feff:f681/64 scope global dynamic mngtmpaddr noprefixroute 
           valid_lft 85948sec preferred_lft 13948sec
        inet6 fe80::21e:67ff:feff:f681/64 scope link 
           valid_lft forever preferred_lft forever
    
    # tail -f /var/log/faucet/faucet.log 
    May 24 17:54:01 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 0 table config match_types: (('eth_src', False), ('eth_type', False), ('in_port', False), ('ip_proto', False), ('udp_dst', False), ('udp_src', False)) name: port_acl next_tables: ['vlan', 'eth_dst', 'flood'] output: True set_fields: ('eth_dst', 'eth_src') size: 32
    May 24 17:54:01 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 1 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 table_id: 1 vlan_port_scale: 1.5
    May 24 17:54:01 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 2 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 32 table_id: 2 vlan_port_scale: 4.1
    May 24 17:54:01 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 3 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 32 table_id: 3 vlan_port_scale: 4.1
    May 24 17:54:01 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 4 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 64 table_id: 4 vlan_scale: 16
    May 24 17:54:01 faucet INFO     Add new datapath DPID 63431407397 (0xec4ce7725)
    May 24 17:54:01 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 0 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 vlan_port_scale: 1.5
    May 24 17:54:01 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 1 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 32 table_id: 1 vlan_port_scale: 4.1
    May 24 17:54:01 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 2 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 32 table_id: 2 vlan_port_scale: 4.1
    May 24 17:54:01 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 3 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 32 table_id: 3 vlan_scale: 16
    May 24 17:54:08 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Cold start configuring DP
    May 24 17:54:08 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 1 (Trunk Port) configured
    May 24 17:54:08 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 2 (NFV SW Port) configured
    May 24 17:54:08 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3/dist-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3/dist-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3/dist-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3/dist-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3/dist-packages/faucet/valve.py", line 430, in _add_ports_and_vlans
        ofmsgs.extend(self.ports_add(
      File "/usr/lib/python3/dist-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3/dist-packages/faucet/valve.py", line 59, in add_port
        ofmsgs.extend(self.dot1x.nfv_sw_port_up(
      File "/usr/lib/python3/dist-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    May 24 17:54:09 faucet INFO     version 1.9.42
    May 24 17:54:09 faucet INFO     Reloading configuration
    May 24 17:54:09 faucet INFO     configuration /etc/faucet/faucet.yaml changed, analyzing differences
    May 24 17:54:09 faucet INFO     Add new datapath DPID 130593846913 (0x1e67fff681)
    May 24 17:54:09 faucet.valve INFO     DPID 130593846913 (0x1e67fff681) ovs-intelsdn-2 table ID 0 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 vlan_port_scale: 1.5
    May 24 17:54:09 faucet.valve INFO     DPID 130593846913 (0x1e67fff681) ovs-intelsdn-2 table ID 1 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 64 table_id: 1 vlan_port_scale: 4.1
    May 24 17:54:09 faucet.valve INFO     DPID 130593846913 (0x1e67fff681) ovs-intelsdn-2 table ID 2 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 64 table_id: 2 vlan_port_scale: 4.1
    May 24 17:54:09 faucet.valve INFO     DPID 130593846913 (0x1e67fff681) ovs-intelsdn-2 table ID 3 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 32 table_id: 3 vlan_scale: 16
    May 24 17:54:09 faucet INFO     Add new datapath DPID 63431404909 (0xec4ce6d6d)
    May 24 17:54:09 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 0 table config match_types: (('eth_src', False), ('eth_type', False), ('in_port', False), ('ip_proto', False), ('udp_dst', False), ('udp_src', False)) name: port_acl next_tables: ['vlan', 'eth_dst', 'flood'] output: True set_fields: ('eth_dst', 'eth_src') size: 32
    May 24 17:54:09 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 1 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 table_id: 1 vlan_port_scale: 1.5
    May 24 17:54:09 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 2 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 32 table_id: 2 vlan_port_scale: 4.1
    May 24 17:54:09 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 3 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 32 table_id: 3 vlan_port_scale: 4.1
    May 24 17:54:09 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 4 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 64 table_id: 4 vlan_scale: 16
    May 24 17:54:09 faucet INFO     Add new datapath DPID 63431407397 (0xec4ce7725)
    May 24 17:54:09 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 0 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 vlan_port_scale: 1.5
    May 24 17:54:09 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 1 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 32 table_id: 1 vlan_port_scale: 4.1
    May 24 17:54:09 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 2 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 32 table_id: 2 vlan_port_scale: 4.1
    May 24 17:54:09 faucet.valve INFO     DPID 63431407397 (0xec4ce7725) ovs-qotom-cloud-1 table ID 3 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 32 table_id: 3 vlan_scale: 16
    
  17. gizmoguy commented on May 24, 2020

    @gizmoguy
    Member

    Starting to run out of ideas as I have been unable to reproduce your problem.

    Only thing I can think of: are you running faucet as root? When chewie is enabled faucet must be run as root so it can open a raw socket to listen for EAPoL packets.

  18. shivarammysore commented on May 24, 2020

    @shivarammysore
    ContributorAuthor

    I even changed /lib/systemd/system/faucet.service to say user/group as root/root from faucet/faucet. Still same error message :-(

  19. gizmoguy commented on May 24, 2020

    @gizmoguy
    Member

    Without a proper reproduction case there isn't a whole lot I can do for you.

    Could you use my known working configs and environment from this github comment and let me know if that works for you:

    faucetsdn/chewie#213 (comment)

  20. shivarammysore commented on May 24, 2020

    @shivarammysore
    ContributorAuthor

    @gizmoguy I think I may figured out how to create this error:
    To the WPA Supplicant host port, don't connect the host. But, start Faucet to see the error. If you connect the WPA Supplicant host to the port and then start Faucet, you will not see the error. It does not matter whether the host tries to authenticate or not.

    In my case, I just connected (not authenticated) a Raspberry Pi to the host port and left it. It has been over 3 hours and I have not seen an error.

    Hope this helps.

  21. gizmoguy commented on May 24, 2020

    @gizmoguy
    Member

    Unable to reproduce, I have taken down all my host ports:

    brad@faucet-sandbox:~$ sudo ovs-ofctl show br0
    OFPT_FEATURES_REPLY (xid=0x2): dpid:0000000000000001
    n_tables:254, n_buffers:0
    capabilities: FLOW_STATS TABLE_STATS PORT_STATS QUEUE_STATS ARP_MATCH_IP
    actions: output enqueue set_vlan_vid set_vlan_pcp strip_vlan mod_dl_src mod_dl_dst mod_nw_src mod_nw_dst mod_nw_tos mod_tp_src mod_tp_dst
     1(veth-n2): addr:b6:67:53:15:20:6f
         config:     0
         state:      LINK_DOWN
         current:    10GB-FD COPPER
         speed: 10000 Mbps now, 0 Mbps max
     2(veth-n3): addr:7a:3d:19:34:34:4c
         config:     0
         state:      LINK_DOWN
         current:    10GB-FD COPPER
         speed: 10000 Mbps now, 0 Mbps max
     3(veth-n4): addr:fe:50:cd:cd:ef:2c
         config:     0
         state:      LINK_DOWN
         current:    10GB-FD COPPER
         speed: 10000 Mbps now, 0 Mbps max
     4(veth-n5): addr:d6:53:c8:fd:df:32
         config:     0
         state:      LINK_DOWN
         current:    10GB-FD COPPER
         speed: 10000 Mbps now, 0 Mbps max
     6(tap1): addr:92:0e:c0:4f:d3:63
         config:     0
         state:      0
         current:    10GB-FD COPPER
         speed: 10000 Mbps now, 0 Mbps max
     LOCAL(br0): addr:2a:ef:33:3d:ee:41
         config:     PORT_DOWN
         state:      LINK_DOWN
         speed: 0 Mbps now, 0 Mbps max
    

    And then I restart faucet, which works fine:

    May 24 23:50:43 faucet INFO     version 1.9.42
    May 24 23:50:43 faucet INFO     Reloading configuration
    May 24 23:50:43 faucet INFO     configuration /etc/faucet/faucet.yaml changed, analyzing differences
    May 24 23:50:43 faucet INFO     Add new datapath DPID 1 (0x1)
    May 24 23:50:43 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 0 table config match_types: (('eth_src', False), ('eth_type', False), ('in_port', False), ('ip_proto', False), ('udp_dst', False), ('udp_src', False)) name: port_acl next_tables: ['vlan', 'eth_dst', 'flood'] output: True set_fields: ('eth_dst', 'eth_src') size: 32
    May 24 23:50:43 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 1 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 table_id: 1 vlan_port_scale: 1.5
    May 24 23:50:43 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 2 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 64 table_id: 2 vlan_port_scale: 4.1
    May 24 23:50:43 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 3 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 64 table_id: 3 vlan_port_scale: 4.1
    May 24 23:50:43 faucet.valve INFO     DPID 1 (0x1) sw1 table ID 4 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 64 table_id: 4 vlan_scale: 16
    May 24 23:50:43 faucet INFO     dot1x enabled on sw1 (0) port Port 1, NFV interface tap0
    May 24 23:50:43 faucet.Chewie INFO     Starting
    May 24 23:50:43 faucet.Chewie.EapSocket INFO     Setting up socket on interface: tap0
    May 24 23:50:43 faucet.Chewie.MabSocket INFO     Setting up socket on interface: tap0
    May 24 23:50:43 faucet.Chewie.RadiusSocket INFO     Setting up radius socket.
    May 24 23:50:43 faucet.Chewie INFO     Radius Listening on 0.0.0.0:0
    May 24 23:50:43 faucet.Chewie INFO     waiting for eap.
    May 24 23:50:43 faucet.Chewie INFO     waiting for MAB activity.
    May 24 23:50:43 faucet.Chewie INFO     waiting for radius.
    May 24 23:50:45 faucet.valve INFO     DPID 1 (0x1) sw1 Cold start configuring DP
    May 24 23:50:45 faucet.valve INFO     DPID 1 (0x1) sw1 Port 6 (802.1x) configured
    May 24 23:50:45 faucet.valve INFO     DPID 1 (0x1) sw1 Configuring VLAN office vid:100 tagged: Port 5 untagged: Port 1,Port 3
    May 24 23:50:45 faucet.valve INFO     DPID 1 (0x1) sw1 Configuring VLAN home vid:101 tagged: Port 5 untagged: Port 2,Port 
    
  22. shivarammysore commented on May 25, 2020

    @shivarammysore
    ContributorAuthor

    @gizmoguy Thanks!
    I have replicated your setup and can confirm that it works for me. I am running latest faucet and freeradius as containers. OVS is local to the machine with configuration as you provided.

    Now, I will try to trace back the issue with my setup.

  23. shivarammysore commented on May 26, 2020

    @shivarammysore
    ContributorAuthor

    Now with OVS running on hardware with Faucet similar to the one that works with "golden" setup on a container. Note that this uses tap as in "golden" setup. Both the "golden" and my setup are running on Ubuntu 20.04 LTS and OVS 2.13 with Faucet 1.9.42

    $ sudo ovs-vsctl show
    b28c1134-b04b-495e-b676-f1fff99a3fc2
        Bridge ovs-br0
            Controller "tcp:127.0.0.1:6653"
                is_connected: true
            fail_mode: secure
            Port enp2s0
                Interface enp2s0
            Port enp5s0
                Interface enp5s0
            Port tap1
                Interface tap1
            Port ovs-br0
                Interface ovs-br0
                    type: internal
        ovs_version: "2.13.0"
    
    $ sudo ovs-vsctl --format=table --columns=name,ofport,ifIndex,link_state,options,type,link_speed list Interface
    name    ofport ifindex link_state options type     link_speed
    ------- ------ ------- ---------- ------- -------- -----------
    ovs-br0 65534  8       down       {}      internal []
    enp5s0  3      5       up         {}      ""       100000000
    tap1    2      9       up         {}      ""       10000000000
    enp2s0  1      3       up         {}      ""       1000000000
    
    $ ip a show tap0
    10: tap0@tap1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
        link/ether 56:33:ce:d0:ee:db brd ff:ff:ff:ff:ff:ff
        inet6 fe80::5433:ceff:fed0:eedb/64 scope link 
           valid_lft forever preferred_lft forever
    
    $ ip a show tap1
    9: tap1@tap0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master ovs-system state UP group default qlen 1000
        link/ether c2:ec:17:9a:40:69 brd ff:ff:ff:ff:ff:ff
        inet6 fe80::c0ec:17ff:fe9a:4069/64 scope link 
           valid_lft forever preferred_lft forever
    
    $ sudo docker logs -f faucet
    Starting with UID=0 GID=0
    loading app faucet.faucet
    loading app ryu.controller.ofp_handler
    instantiating app None of DPSet
    creating context dpset
    creating context faucet_experimental_api
    instantiating app faucet.faucet of Faucet
    instantiating app ryu.controller.ofp_handler of OFPHandler
    May 26 05:43:15 faucet INFO     version 1.9.42
    May 26 05:43:15 faucet INFO     Reloading configuration
    May 26 05:43:15 faucet INFO     configuration /etc/faucet/faucet.yaml changed, analyzing differences
    May 26 05:43:15 faucet INFO     Add new datapath DPID 63431404909 (0xec4ce6d6d)
    May 26 05:43:15 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 0 table config match_types: (('eth_src', False), ('eth_type', False), ('in_port', False), ('ip_proto', False), ('udp_dst', False), ('udp_src', False)) name: port_acl next_tables: ['vlan', 'eth_dst', 'flood'] output: True set_fields: ('eth_dst', 'eth_src') size: 32
    May 26 05:43:15 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 1 table config match_types: (('eth_dst', True), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) name: vlan next_tables: ['eth_src'] output: True set_fields: ('vlan_vid',) size: 32 table_id: 1 vlan_port_scale: 1.5
    May 26 05:43:15 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 2 table config match_types: (('eth_dst', True), ('eth_src', False), ('eth_type', False), ('in_port', False), ('vlan_vid', False)) miss_goto: eth_dst name: eth_src next_tables: ['eth_dst', 'flood'] output: True set_fields: ('vlan_vid', 'eth_dst') size: 32 table_id: 2 vlan_port_scale: 4.1
    May 26 05:43:15 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 3 table config exact_match: True match_types: (('eth_dst', False), ('vlan_vid', False)) miss_goto: flood name: eth_dst output: True size: 32 table_id: 3 vlan_port_scale: 4.1
    May 26 05:43:15 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 table ID 4 table config match_types: (('eth_dst', True), ('in_port', False), ('vlan_vid', False)) name: flood output: True size: 64 table_id: 4 vlan_scale: 16
    (1) wsgi starting up on http://0.0.0.0:9302
    May 26 05:43:15 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Cold start configuring DP
    May 26 05:43:15 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 1 (Uplink Port) configured
    May 26 05:43:15 faucet.valve INFO     DPID 63431404909 (0xec4ce6d6d) ovs-qotom-allbirds-1 Port 2 (NFV SW Port) configured
    May 26 05:43:15 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    May 26 05:43:15 faucet.exception ERROR    Unhandled exception, killing RYU
    Traceback (most recent call last):
      File "/usr/lib/python3.7/site-packages/faucet/valve_util.py", line 34, in __koe
        func(*args, **kwargs)
      File "/usr/lib/python3.7/site-packages/faucet/faucet.py", line 289, in _datapath_connect
        valve, self.valves_manager.datapath_connect(now, valve, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valves_manager.py", line 366, in datapath_connect
        return valve.datapath_connect(now, discovered_up_ports)
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 755, in datapath_connect
        ofmsgs.extend(self._add_ports_and_vlans(now, discovered_up_ports))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 431, in _add_ports_and_vlans
        all_up_port_nos, cold_start=True, log_msg='configured'))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 820, in ports_add
        ofmsgs.extend(self._dot1x_manager.add_port(port))
      File "/usr/lib/python3.7/site-packages/faucet/valve.py", line 60, in add_port
        self.dp_id, self.dot1x_ports(), self.nfv_sw_port))
      File "/usr/lib/python3.7/site-packages/faucet/faucet_dot1x.py", line 182, in nfv_sw_port_up
        self._dot1x_speaker.port_down(
    AttributeError: 'NoneType' object has no attribute 'port_down'
    ^C
    
  24. shivarammysore commented on May 26, 2020

    @shivarammysore
    ContributorAuthor
    $ more faucet/faucet.yaml 
    acls:
      pre_auth:
      - rule:
         dl_type: 0x800  # Allow ICMP / IPv4
         ip_proto: 1
         actions:
          allow: False
      post_auth:
      - rule:
         actions:
          allow: True
    dps:
      ovs-qotom-allbirds-1:
        dp_id: 63431404909
        dot1x:
          radius_ip: "10.20.5.7"
          radius_port: 1812
          radius_secret: "SECRET"
          nfv_intf: "tap0"
          nfv_sw_port: 2
          #auth_acl: "post_auth"
          #noauth_acl: "pre_auth"
        hardware: Open vSwitch
        interfaces:
          1:
            description: "Uplink Port"
            name: "uplink"
            tagged_vlans: [office,home]
          2:
            description: "NFV SW Port"
            name: "802.1x"
            output_only: true
          3:
            description: "Shivaram Office NW Laptop"
            native_vlan: office
            acls_in: [pre_auth, post_auth]
        name: ovs-qotom-allbirds-1
    version: 2
    vlans:
      office:
        description: office network
        name: office
        vid: 150
      home:
        vid: 151
        description: "home network"
  25. gizmoguy commented on May 26, 2020

    @gizmoguy
    Member

    In order to track the problem down it would help me greatly to get a reproduction case.

    If I am understanding it correctly you got my setup working fine, then you changed some number of variables and now the setup is broken.

    If I could get the steps on how you broke it that would be very very helpful.

  26. shivarammysore commented on May 26, 2020

    @shivarammysore
    ContributorAuthor

    Golden Setup

    1. Setup a brand new Ubuntu 20.04 OS with OpenSSH server
    2. Run the below commands:
    apt-get update
    apt-get install --yes apt-transport-https \
    	ca-certificates \
    	curl \
    	gnupg-agent \
    	software-properties-common \
    	openvswitch-common \
    	openvswitch-switch \
    	python3-openvswitch \
    	openvswitch-pki \
    	wpasupplicant
    systemctl enable openvswitch-switch
    systemctl start openvswitch-switch
    systemctl status openvswitch-switch
    ovs-vsctl show
    
    # Run command inside network namespace
    as_ns () {
        NAME=$1
        NETNS=faucet-${NAME}
        shift
        sudo ip netns exec ${NETNS} $@
    }
    
    # Create network namespace
    create_ns () {
        NAME=$1
        IP=$2
        NETNS=faucet-${NAME}
        sudo ip netns add ${NETNS}
        sudo ip link add dev veth-${NAME} type veth peer name veth0 netns ${NETNS}
        sudo ip link set dev veth-${NAME} up
        as_ns ${NAME} ip link set dev lo up
        [ -n "${IP}" ] && as_ns ${NAME} ip addr add dev veth0 ${IP}
        as_ns ${NAME} ip link set dev veth0 up
    }
    
    echo "Creating namespaces ..."
    
    create_ns n2 10.0.0.1/24
    create_ns n3 10.0.0.2/24
    create_ns n4 10.0.0.3/24
    create_ns n5 10.0.0.4/24
    sudo ip link add tap0 type veth peer name tap1
    sudo ip link set tap0 up
    sudo ip link set tap1 up
    echo "Listing namespaces ..."
    sudo ip netns list | sort -n
    
    echo "Creating OVS bridge br0 and add interfaces ..."
    sudo ovs-vsctl add-br br0 -- set bridge br0 other-config:datapath-id=0000000000000001 \
        -- set bridge br0 other-config:disable-in-band=true \
        -- set bridge br0 fail_mode=secure \
        -- add-port br0 veth-n2 -- set interface veth-n2 ofport_request=1 \
        -- add-port br0 veth-n3 -- set interface veth-n3 ofport_request=2 \
        -- add-port br0 veth-n4 -- set interface veth-n4 ofport_request=3 \
        -- add-port br0 veth-n5 -- set interface veth-n5 ofport_request=4 \
        -- add-port br0 tap1 -- set interface tap1 ofport_request=6 \
        -- set-controller br0 tcp:127.0.0.1:6653 tcp:127.0.0.1:6654
    sudo ovs-vsctl show
    sudo ovs-vsctl --format=table --columns=name,ofport,ifIndex,link_state,options,type,link_speed list Interface
    1. Now run faucet and radius containers locally on the same machine

    My Setup

    1. Setup a brand new Ubuntu 20.04 OS with OpenSSH server
    2. Add the system packages for openvswitch as in Golden setup
    3. Run the below commands to setup OVS bridge with physical interfaces for ports. enp2s0 is connected to TOR as uplink port:
    sudo bash -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
    sudo ip link add tap0 type veth peer name tap1
    sudo ip link set tap0 up
    sudo ip link set tap1 up
    sudo ovs-vsctl --may-exist --no-wait add-br ovs-br0 -- set bridge ovs-br0 other-config:datapath-id=0xec4ce6d6d \
        -- set bridge ovs-br0 other-config:disable-in-band=true \
        -- set bridge ovs-br0 fail_mode=secure \
        -- add-port ovs-br0 enp2s0 -- set interface enp2s0 ofport_request=1 \
        -- add-port ovs-br0 tap1 -- set interface tap1 ofport_request=2 \
        -- add-port ovs-br0 enp5s0 -- set interface enp5s0 ofport_request=3 \
        -- set-controller ovs-br0 tcp:127.0.0.1:6653
    1. To run Faucet, use command (same for Golden setup too) (I also have too many capabilities - but, they are probably not needed) :
    sudo docker run -d -t \
      --name faucet \
      --network="host" \
      --cap-add=NET_RAW \
      --cap-add=NET_ADMIN \
      --cap-add=NET_BIND_SERVICE \
      --cap-add=MAC_ADMIN \
      --cap-add=SYS_ADMIN \
      --cap-add=SYS_MODULE \
      --cap-add=SYS_NICE \
      --privileged \
      -e "FAUCET_EVENT_SOCK=0" \
      -e "FAUCET_CONFIG_STAT_RELOAD=true" \
      -e "FAUCET_LOG=STDOUT" \
      -e "FAUCET_EXCEPTION_LOG=STDERR" \
      --volume=/lib/modules:/lib/modules \
      --volume=${PWD}/faucet/:/etc/faucet/ \
      faucet/faucet:1.9.42 faucet --ryu-ofp-tcp-listen-port=6653
    1. Use the faucet.yaml previously provided.

    In Summary
    The main differences between Golden Setup and mysetup are the use of physical interfaces on OVS and no use of namespaces.

  27. gizmoguy commented on May 26, 2020

    @gizmoguy
    Member

    Hi @shivarammysore

    I found your actual issue, you are forgetting to enable dot1x on any client ports (dot1x: True). Apparently this triggers a faucet bug which I have fixed in #3572.

  28. shivarammysore commented on May 26, 2020

    @shivarammysore
    ContributorAuthor

    Thanks @gizmoguy for the fix and identifying the error. Much appreciated. My setup works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions