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

[BUG] Graphite does not open the default topology file #1186

Closed
pmsobral opened this issue May 14, 2024 · 10 comments
Closed

[BUG] Graphite does not open the default topology file #1186

pmsobral opened this issue May 14, 2024 · 10 comments
Labels
bug Something isn't working

Comments

@pmsobral
Copy link

Describe the bug

Graphite not working as expected

To Reproduce

Deploy the basic OSPF topology presented below :

Expected behavior

Everything works as expected except graphite.
Connecting through the web browser presents an empty graph.

Lab topology

provider: clab
defaults.device: eos
module: [ ospf ]

nodes: [ r1, r2 ]
links: [ r1, r2, r1-r2 ]
tools:
graphite:

Output

redes@RedesVM:~/netlab/basic-OSPF$ netlab create
[CREATED] provider configuration file: clab.yml
[CREATED] transformed topology dump in YAML format in netlab.snapshot.yml
[CREATED] graphite configuration directory
[CREATED] graphite/graphite-default.json rendering "graphite" format
[GROUPS] group_vars for all
[GROUPS] group_vars for modules
[GROUPS] group_vars for eos
[HOSTS] host_vars for r1
[HOSTS] host_vars for r2
[CREATED] minimized Ansible inventory hosts.yml
[CREATED] Ansible configuration file: ansible.cfg

Version

netlab version 1.8.2

Additional context

redes@RedesVM:~/netlab/basic-OSPF$ netlab connect graphite
Traceback (most recent call last):
File "/home/redes/.local/bin/netlab", line 12, in
netsim.cli.lab_commands(file)
File "/home/redes/.local/lib/python3.10/site-packages/netsim/cli/init.py", line 321, in lab_commands
mod.run(sys.argv[arg_start:]) # type: ignore
File "/home/redes/.local/lib/python3.10/site-packages/netsim/cli/connect.py", line 232, in run
connect_to_tool(host,rest,topology,log_level)
File "/home/redes/.local/lib/python3.10/site-packages/netsim/cli/connect.py", line 190, in connect_to_tool
msg = external_commands.get_tool_message(tool,topology)
File "/home/redes/.local/lib/python3.10/site-packages/netsim/cli/external_commands.py", line 261, in get_tool_message
return strings.eval_format(msg,topology)
File "/home/redes/.local/lib/python3.10/site-packages/netsim/utils/strings.py", line 110, in eval_format
return str(eval(ex,dict(data))) # An awful hack to use f-string specified in a string variable
File "", line 1, in
NameError: name 'sys' is not defined

@pmsobral pmsobral added the bug Something isn't working label May 14, 2024
@ipspace
Copy link
Owner

ipspace commented May 14, 2024

Unfortunately, we're in the 'it works for me' territory here :( I pulled down the latest graphite image just to be on the safe side and it works. Here's what Docker has to say about the image:

REPOSITORY            TAG       IMAGE ID       CREATED         SIZE
netreplica/graphite   0.4.2     6d52c47bb623   11 months ago   527MB
netreplica/graphite   latest    6d52c47bb623   11 months ago   527MB

On the odd chance that it might be a browser problem: what browser are you using? I'm on recent Chrome.

Also, what netlab version are you using? The latest versions display the URL to use, so you can just click on it. Make sure the URL ends in graphite, for example http://100.78.59.132:8080/graphite/

As for the netlab connect FUBAR, it's a bug. Opening an issue. Thanks a million for reporting it!

@pmsobral
Copy link
Author

pmsobral commented May 14, 2024

Hello Ivan,

Thank you very much for your answer.
I'm on ubuntu 22.04 with latest netlab version (1.8.2) chrome is updated (124.0.6367.201), netreplica/graphite container is the same.
Captura de ecrã 2024-05-14, às 17 34 39

Keep up the excellent work!

Regards,

Pedro

@ipspace
Copy link
Owner

ipspace commented May 14, 2024

Thank you very much for your answer. I'm on ubuntu 22.04 with latest netlab version (1.8.2) chrome is updated (124.0.6367.201), netreplica/graphite container is the same.

Good. Also, the screen is definitely coming from Graphite, but it looks like its configuration file is broken.

Could you please create a tar archive of the whole directory after the lab is started (tar cvf filename .) and post it? I'd like to see what Graphite configuration file netlab creates.

Thank you!
Ivan

@pmsobral
Copy link
Author

Hello again!

Sure! Here it is.
basic-OSPF.tar.gz

Best Regards,

Pedro

@ipspace
Copy link
Owner

ipspace commented May 14, 2024

Sure! Here it is. basic-OSPF.tar.gz

Thank you. Everything looks normal, the Graphite JSON configuration file is identical to the one I have. I'm stumped...

Let's try to throw some spaghetti at the wall ;) because I have no better idea. Do docker ps to see what containers are running, find the container with graphite in its name (should be basic-OSPF_graphite), and do docker inspect containername to see whether the config file is mapped correctly.

Also, if you do docker exec basic-OSPF_graphite cat /htdocs/default/default.json you should see the configuration file from within the container. That one should match graphite/graphite-default.json.

@pmsobral
Copy link
Author

Hello Ivan,

Thank you for your patience. In fact everything looks ok. The file is correctly mapped on the container as expected. If it is working with your setup...I don't really understand. Just to let you know that I have the same issue on other topologies as well.

Best Regards,

Pedro

@ipspace
Copy link
Owner

ipspace commented May 15, 2024

OK, managed to reproduce the bug: if I run Chrome in incognito mode, I get the same screen. Definitely a Graphite issue, now I have to figure out if we can work around it.

@ipspace ipspace changed the title [BUG] Graphite not working as expected [BUG] Graphite does not open the default topology file May 15, 2024
@ipspace
Copy link
Owner

ipspace commented May 15, 2024

Totally weird: Graphite versions 0.4.x consistently broke, but not until I disabled the browser cache (which is what happened in the incognito mode). As a workaround, I downgraded the netreplica/graphite image to version 0.3.0 until I figure out what's going on. Implemented in e538af9

@ipspace
Copy link
Owner

ipspace commented May 15, 2024

@pmsobral to test this fix, run netlab from a local Git repository. Installation details @ https://netlab.tools/install/clone/

You might have to clear the browser cache as well.

@pmsobral
Copy link
Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants