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

P4 table entry insert from p4runtime docker container shell is broken in advanced branch #91

Open
ysanjeevreddy opened this issue Nov 15, 2021 · 3 comments

Comments

@ysanjeevreddy
Copy link

Hi,
I see the following error when i call insert() on a table_enrty object created on p4runtime shell in advanced branch. Any help in this regard is much appreciated.
Please look at the following logs

P4Runtime sh >>> te = table_entry["IngressPipeImpl.l2_exact_table"](action = "IngressPipeImpl.set_egress_port")

P4Runtime sh >>> te.match["hdr.ethernet.dst_addr"] = ("00:00:00:00:00:1B")
field_id: 1
exact {
value: "\033"
}
P4Runtime sh >>> te.action["port_num"] = ("4")
param_id: 1
value: "\004"

P4Runtime sh >>> te
Out[4]:
table_id: 33605373 ("IngressPipeImpl.l2_exact_table")
match {
field_id: 1 ("hdr.ethernet.dst_addr")
exact {
value: "\x1b"
}
}
action {
action {
action_id: 16812802 ("IngressPipeImpl.set_egress_port")
params {
param_id: 1 ("port_num")
value: "\x04"
}
}
}

P4Runtime sh >>> te.insert() --verbose
DEBUG:root:Inserting entry

P4RuntimeWriteException Traceback (most recent call last)
in
----> 1 te.insert() --verbose

/p4runtime-sh/venv/lib/python3.8/site-packages/p4runtime_shell-0.0.2-py3.8.egg/p4runtime_sh/shell.py in insert(self)
680 raise NotImplementedError("Insert not supported for {}".format(self._entity_type.name))
681 logging.debug("Inserting entry")
--> 682 self._write(p4runtime_pb2.Update.INSERT)
683
684 def delete(self):

/p4runtime-sh/venv/lib/python3.8/site-packages/p4runtime_shell-0.0.2-py3.8.egg/p4runtime_sh/shell.py in write(self, type)
674 update.type = type_
675 getattr(update.entity, self._entity_type.name).CopyFrom(self._entry)
--> 676 client.write_update(update)
677
678 def insert(self):

/p4runtime-sh/venv/lib/python3.8/site-packages/p4runtime_shell-0.0.2-py3.8.egg/p4runtime_sh/p4runtime.py in handle(*args, **kwargs)
121 if e.code() != grpc.StatusCode.UNKNOWN:
122 raise e
--> 123 raise P4RuntimeWriteException(e) from None
124 return handle
125

P4RuntimeWriteException: Error(s) during Write:
* At index 0: INVALID_ARGUMENT, 'Invalid bytestring format'

P4Runtime sh >>>

Thank you for your help in advance.

@Xiaodao-chen
Copy link

so did you solve this problem ? I have meet this one

@ysanjeevreddy
Copy link
Author

ysanjeevreddy commented Apr 25, 2022 via email

@LavanyaMalakalapalli
Copy link

P4Runtime sh >>> global_options["canonical_bytestrings"] = False

P4Runtime sh >>> te.insert()

P4RuntimeWriteException Traceback (most recent call last)
in
----> 1 te.insert()

/p4runtime-sh/venv/lib/python3.10/site-packages/p4runtime_sh/shell.py in insert(self)
697 raise NotImplementedError("Insert not supported for {}".format(self._entity_type.name))
698 logging.debug("Inserting entry")
--> 699 self._write(p4runtime_pb2.Update.INSERT)
700
701 def delete(self):

/p4runtime-sh/venv/lib/python3.10/site-packages/p4runtime_sh/shell.py in write(self, type)
691 update.type = type_
692 getattr(update.entity, self._entity_type.name).CopyFrom(self._entry)
--> 693 client.write_update(update)
694
695 def insert(self):

/p4runtime-sh/venv/lib/python3.10/site-packages/p4runtime_sh/p4runtime.py in handle(*args, **kwargs)
122 if e.code() != grpc.StatusCode.UNKNOWN:
123 raise e
--> 124 raise P4RuntimeWriteException(e) from None
125 return handle
126

P4RuntimeWriteException: Error(s) during Write:
* At index 0: INVALID_ARGUMENT, 'Invalid bytestring format'

P4Runtime sh >>>

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

3 participants