netenglabs / suzieq

Using network observability to operate and design healthier networks
https://www.stardustsystems.net/
Apache License 2.0
775 stars 105 forks source link

[Bug]: AttributeError: 'DataFrame' object has no attribute 'ifState' when loading default dashboard #929

Closed beufanet closed 3 months ago

beufanet commented 3 months ago

Suzieq version

0.22.0

Install Type

container

Python version

whatever is bundled with your container

Impacted component

suzieq-gui

Steps to Reproduce

When you have no OSPF tables, when opening first dashboard of the GUI, I have errors :

AttributeError: 'DataFrame' object has no attribute 'ifState'
Traceback:

File "/usr/local/lib/python3.8/site-packages/streamlit/scriptrunner/script_runner.py", line 557, in _run_script
    exec(code, module.__dict__)
File "/usr/local/lib/python3.8/site-packages/suzieq/gui/stlit/suzieq-gui.py", line 245, in <module>
    apprun()
File "/usr/local/lib/python3.8/site-packages/suzieq/gui/stlit/suzieq-gui.py", line 241, in apprun
    state.pages[page].build()
File "/usr/local/lib/python3.8/site-packages/suzieq/gui/stlit/status.py", line 33, in build
    self._render(layout)
File "/usr/local/lib/python3.8/site-packages/suzieq/gui/stlit/status.py", line 109, in _render
    self._chart_ospf(layout, ns_list)
File "/usr/local/lib/python3.8/site-packages/suzieq/gui/stlit/status.py", line 210, in _chart_ospf
    ospf_df['state'] = np.where(ospf_df.ifState == "adminDown",
File "/usr/local/lib/python3.8/site-packages/pandas/core/generic.py", line 5902, in __getattr__
    return object.__getattribute__(self, name)

Expected Behavior

Perhaps we should have a way to disable OSPF tables either in the Poller or the GUI ?

Observed Behavior

This error is not shown when there is some passive OSPF interfaces configured (and so the OSPF table is not empty), that's why I'm thinking it comes from OSPF state.

Screenshots

Additional Context

ddutt commented 3 months ago

Closed via PR #933