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

make test error #6

Open
haoyusong opened this issue Nov 6, 2014 · 3 comments
Open

make test error #6

haoyusong opened this issue Nov 6, 2014 · 3 comments

Comments

@haoyusong
Copy link

Ubuntu14.04/Python 2.7.6

make test error:

Traceback (most recent call last):
File "iri/parsed_packet.py", line 408, in
(exp_mac_val, mac_val))
TypeError: %x format: a number is required, not NoneType

@weirongj
Copy link

Ubuntu14.04/Python 2.7.6. Got the similar error when "make start-l3". It took varying time for the error to occur.

Exception in thread ichiban:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/home/sdn/air_iri/iri/switch.py", line 64, in run
self.instance.process_packet(port_num, pkt)
File "/home/sdn/air_iri/iri/instance.py", line 222, in process_packet
self.first_processor.process(parsed_packet)
File "/home/sdn/air_iri/iri/parser.py", line 214, in process
self.next_processor.process(parsed_packet)
File "/home/sdn/air_iri/iri/pipeline.py", line 124, in process
(hit, action) = current_table.process_packet(parsed_packet)
File "/home/sdn/air_iri/iri/table.py", line 74, in process_packet
self.action_map[action_ref].eval(parsed_packet, params)
File "/home/sdn/air_iri/iri/action.py", line 186, in eval
prim.eval(parsed_packet, values)
File "/home/sdn/air_iri/iri/action.py", line 111, in eval
logging.debug("Old value: %d" % value)
TypeError: %d format: a number is required, not NoneType

@bmackcrane
Copy link
Contributor

I have seen the same error -- It appears to be an IPv6 packet being
received by the simulated datapath. I don't know where this packet is
coming from; however, the l3.yml datapath does not handle IPv6 and the
current IRI does not handle parsing errors well.

I am running Ubuntu 12.04 with Python 2.7.3

Regards,
Ben

On 03/25/2015 02:56 PM, weirongj wrote:

Ubuntu14.04/Python 2.7.6. Got the similar error when "make start-l3".
It took varying time for the error to occur.

Exception in thread ichiban:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
self.run()
File "/home/sdn/air_iri/iri/switch.py", line 64, in run
self.instance.process_packet(port_num, pkt)
File "/home/sdn/air_iri/iri/instance.py", line 222, in process_packet
self.first_processor.process(parsed_packet)
File "/home/sdn/air_iri/iri/parser.py", line 214, in process
self.next_processor.process(parsed_packet)
File "/home/sdn/air_iri/iri/pipeline.py", line 124, in process
(hit, action) = current_table.process_packet(parsed_packet)
File "/home/sdn/air_iri/iri/table.py", line 74, in process_packet
self.action_map[action_ref].eval(parsed_packet, params)
File "/home/sdn/air_iri/iri/action.py", line 186, in eval
prim.eval(parsed_packet, values)
File "/home/sdn/air_iri/iri/action.py", line 111, in eval
logging.debug("Old value: %d" % value)
TypeError: %d format: a number is required, not NoneType


Reply to this email directly or view it on GitHub
#6 (comment).

@bmackcrane
Copy link
Contributor

With regard to the problem reported by Haoyu, my guess is that on 64bit machines the MAC address is an ‘int’ and on 32bit machines it is a ‘long’ and there is code that checks for type. Here is the fix I used:

In header.py

def set_field(self, field_name, value, width=None):

    if type(value) not in [int, bytearray]:
        return None

replaced with

    if type(value) not in [int, long, bytearray]:
        return None

The other problem I had was in field.py

    # Easy cases:
    if bit_offset == 0:
        base = byte_offset
        if width == 8:
            self.value = struct.unpack("!B", buf[base:base+1])[0]
            return self.value

where Johann suggested the following fix (needed here and 3 lines closely following):

            self.value = struct.unpack("!B", buffer(buf[base:base+1]))[0]

I think Johann mentioned he had another fix that might be better but I don’t recall what that was.

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

No branches or pull requests

3 participants