OSError: Path does not exist or is not directory: '/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/'

Question:

I was trying to open RYU topology viewer.

I created a tree topology using these commands:

user@ubuntu:~$ sudo mn --topo tree,3 --controller remote
[sudo] password for user: 
*** Creating network
*** Adding controller
Unable to contact the remote controller at 127.0.0.1:6653
Unable to contact the remote controller at 127.0.0.1:6633
Setting remote controller to 127.0.0.1:6653
*** Adding hosts:
h1 h2 h3 h4 h5 h6 h7 h8 
*** Adding switches:
s1 s2 s3 s4 s5 s6 s7 
*** Adding links:
(s1, s2) (s1, s5) (s2, s3) (s2, s4) (s3, h1) (s3, h2) (s4, h3) (s4, h4) (s5, s6) (s5, s7) (s6, h5) (s6, h6) (s7, h7) (s7, h8) 
*** Configuring hosts
h1 h2 h3 h4 h5 h6 h7 h8 
*** Starting controller
c0 
*** Starting 7 switches
s1 s2 s3 s4 s5 s6 s7 ...
*** Starting CLI:
mininet> 

Then used this command to open RYU topology viewer on another terminal.

user@ubuntu:~$ ryu-manager --observe-links ryu.app.simple_switch ryu.app.gui_topology.gui_topology
loading app ryu.app.simple_switch
loading app ryu.app.gui_topology.gui_topology
loading app ryu.controller.ofp_handler
loading app ryu.app.ws_topology
loading app ryu.app.ofctl_rest
loading app ryu.app.rest_topology
loading app ryu.controller.ofp_handler
creating context wsgi
instantiating app None of Switches
creating context switches
instantiating app None of DPSet
creating context dpset
instantiating app ryu.app.simple_switch of SimpleSwitch
instantiating app ryu.app.gui_topology.gui_topology of GUIServerApp
instantiating app ryu.controller.ofp_handler of OFPHandler
instantiating app ryu.app.ws_topology of WebSocketTopology
instantiating app ryu.app.ofctl_rest of RestStatsApi
instantiating app ryu.app.rest_topology of TopologyAPI
(2903) wsgi starting up on http://0.0.0.0:8080

After that, when I go to 0.0.0.0:8080 from Mozilla i get this error:

error message screenshot

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 490, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 236, in __call__
    return super(wsgify_hack, self).__call__(environ, start_response)
  File "/usr/lib/python3/dist-packages/webob/dec.py", line 131, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python3/dist-packages/webob/dec.py", line 196, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 288, in __call__
    controller = match['controller'](req, link, data, **self.config)
  File "/usr/lib/python3/dist-packages/ryu/app/gui_topology/gui_topology.py", line 57, in __init__
    self.static_app = DirectoryApp(path)
  File "/usr/lib/python3/dist-packages/webob/static.py", line 127, in __init__
    "Path does not exist or is not directory: %r" % self.path)
OSError: Path does not exist or is not directory: '/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/'

The above lines are displayed on browser window.

and instantly the following lines are automatically added in the terminal:

(2903) accepted ('127.0.0.1', 37816)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 490, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 236, in __call__
    return super(wsgify_hack, self).__call__(environ, start_response)
  File "/usr/lib/python3/dist-packages/webob/dec.py", line 131, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python3/dist-packages/webob/dec.py", line 196, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 288, in __call__
    controller = match['controller'](req, link, data, **self.config)
  File "/usr/lib/python3/dist-packages/ryu/app/gui_topology/gui_topology.py", line 57, in __init__
    self.static_app = DirectoryApp(path)
  File "/usr/lib/python3/dist-packages/webob/static.py", line 127, in __init__
    "Path does not exist or is not directory: %r" % self.path)
OSError: Path does not exist or is not directory: '/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/'
127.0.0.1 - - [04/Apr/2023 01:35:50] "GET / HTTP/1.1" 500 1266 0.010402
(2903) accepted ('127.0.0.1', 37832)
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/eventlet/wsgi.py", line 490, in handle_one_response
    result = self.application(self.environ, start_response)
  File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 236, in __call__
    return super(wsgify_hack, self).__call__(environ, start_response)
  File "/usr/lib/python3/dist-packages/webob/dec.py", line 131, in __call__
    resp = self.call_func(req, *args, **self.kwargs)
  File "/usr/lib/python3/dist-packages/webob/dec.py", line 196, in call_func
    return self.func(req, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 288, in __call__
    controller = match['controller'](req, link, data, **self.config)
  File "/usr/lib/python3/dist-packages/ryu/app/gui_topology/gui_topology.py", line 57, in __init__
    self.static_app = DirectoryApp(path)
  File "/usr/lib/python3/dist-packages/webob/static.py", line 127, in __init__
    "Path does not exist or is not directory: %r" % self.path)
OSError: Path does not exist or is not directory: '/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/'
127.0.0.1 - - [04/Apr/2023 01:35:50] "GET /favicon.ico HTTP/1.1" 500 1266 0.000347
packet in 5 02:94:85:bf:6c:28 33:33:00:00:00:02 2
packet in 1 02:94:85:bf:6c:28 33:33:00:00:00:02 2
packet in 6 02:94:85:bf:6c:28 33:33:00:00:00:02 3
packet in 2 02:94:85:bf:6c:28 33:33:00:00:00:02 3

Seeking assistance to resolve this problem

I tried to open the GUI topology viewer of RYU. But getting OSError: Path does not exist or is not directory: '/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/' again and again.

Answers:

You need to be at top of ‘ryu’ directory. Enter the command below

cd /home/user/ryu/

And Run the commands that you mentioned above. Hope this will work. Thank you.

Answered By: Junayed Kader
Categories: questions Tags: , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.