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

huangapple go评论51阅读模式
英文:

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

问题

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 = this call_func(req, *args, **self.kwargs)
  File "/usr/libpython3/dist-packages/webob/dec.py", line 196, in call_func
    return this 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__
    this 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" % this 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 the 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 = this application(this environ, start_response)
  File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 236, in __call__
    return this super(wsgify_hack, this).__call__(environ, start_response)
  File "/usr/lib/python3/dist-packages/webob/dec.py", line 131, in __call__
    resp = this call_func(req, *args, **self.kwargs)
  File "/usr/lib/python3/dist-packages/webob/dec.py", line 196, in call_func
    return this 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__
    this 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" % this 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 = this application(this environ, start_response)
  File "/usr/lib/python3/dist-packages/ryu/app/wsgi.py", line 236, in __call__
    return this super(wsgify_hack, this).__call__(environ, start_response)
  File "/usr/lib/python3/dist-packages/webob/dec.py", line 131, in __call__
    resp = this call_func(req, *args, **self

<details>
<summary>英文:</summary>

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](https://i.stack.imgur.com/vttnw.png)

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: &#39;/usr/lib/python3/dist-packages/ryu/app/gui_topology/html/&#39;` again and again.

</details>


# 答案1
**得分**: 0

需要在 'ryu' 目录的顶层。输入以下命令:

    cd /home/user/ryu/

然后运行你之前提到的命令。希望这能够正常工作。谢谢。

<details>
<summary>英文:</summary>

You need to be at top of &#39;ryu&#39; directory. Enter the command below

    cd /home/user/ryu/

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


</details>



huangapple
  • 本文由 发表于 2023年4月4日 17:09:30
  • 转载请务必保留本文链接:https://go.coder-hub.com/75927516.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定