CAIDA / pybgpstream

Python bindings for BGPStream
https://bgpstream.caida.org
BSD 2-Clause "Simplified" License
28 stars 22 forks source link

ERROR: Failed to parse RIS Live raw data #29

Closed t0gre closed 4 years ago

t0gre commented 4 years ago

I am getting this error: ERROR: Failed to parse RIS Live raw data

I'm running my code inside a container build on caida/bgpstream:2.0.0-rc3

The error message is also accompanied by WARNING: Corrupted RIS Live message:

Any idea what could be causing this? Weirdly, I don't get this error if I run the code on my desktop, which has a slightly older version of bgpstream on it..

The pybgpstream code I'm using is:

stream = pybgpstream.BGPStream(
     from_time=start_time,
     collector="route-views.linx",
     record_type="updates" )

If I run that locally, nothing happens, but there are no error messages.

whereas if I use:

TEST_FILE_PATH = "/home/tomg/Downloads/updates.20200416.0430"
stream = pybgpstream.BGPStream()
stream.set_data_interface("singlefile")
stream.set_data_interface_option("singlefile", "upd-file", TEST_FILE_PATH)
stream.start

Locally, it works fine. In the container (I copied the file in), nothing happens (but no error messages either)

alistairking commented 4 years ago

Hi!

Thanks for reaching out.

I think this is caused by the combination of a "feature", and a bug.

The "feature" is that when you only provide a start time, BGPStream goes into "live" mode which means it will include data from RIS Live. Because we don't have a mechanism for checking which collectors a given live stream (e.g., RIS Live) contains, we are uselessly opening this stream (i.e., the system doesn't know that the RIS Live stream doesn't include data from the route-views.linx collector).

Then, you are hitting a bug with how BGPStream handles the RIS Live stream which causes things to break. (This issue is why v2 is still in a pre-release state.)

I think that if you set

project="routeviews",

in the constructor you should see more sane behavior.

t0gre commented 4 years ago

Thanks very much for the prompt response!

Just to clarify: should I include project=routeviews AND collector=route-views.linx or should I just put project=routeviews and then filter it down to the collector I want in my code? I have to have it both live and for just a single collector or I'm screwed.

Alternatively, could I roll back to an earlier version?

Thanks again

alistairking commented 4 years ago

Yeah, include them both.

t0gre commented 4 years ago

Thanks Alistair,

This code seems to work just fine for me:

stream = pybgpstream.BGPStream(
    from_time=start_time,
    project="routeviews",
    collector="route-views.linx",
    record_type="updates"
)

Shall I close the issue, since my problem is solved for now, or leave it open, since there's an underlying bug in there?

alistairking commented 4 years ago

I think we can go ahead and close it. We're tracking the underlying bug over at https://github.com/CAIDA/libbgpstream/issues/116