首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >netbox nextbox-ui插件拓扑查看器为空

netbox nextbox-ui插件拓扑查看器为空
EN

Stack Overflow用户
提问于 2022-02-08 06:49:42
回答 1查看 723关注 0票数 0

netbox 534a7d1fe0bf (v3.1.6)

插件0.9.2

我是码头编剧和netbox的新手。现在,我正在尝试使用一个名为nextbox-ui插件的插件来显示我们的交换机和路由器的拓扑。我在一个码头环境中安装了netbox,并安装了插件,类似于用于码头安装的文档。我有一些连接的设备,但是拓扑查看器是空的。我试着找问题。

在我的linux服务器上显示了大约403个错误

代码语言:javascript
复制
netbox-docker-netbox-1 | 2022/02/07 08:14:26 [error] 18#20 *7 open("/opt/netbox/netbox/static/nextbox_ui_plugin/next_sources/js/next.js") failed (13: Permission denied) 
netbox-docker-netbox-1 | 2022/02/07 08:14:26 [error] 18#20 *6 open("/opt/netbox/netbox/static/nextbox_ui_plugin/next_sources/css/next.css") failed (13: Permission denied) 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/next_sources/js/next.js HTTP/1.1" 403 54 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43" 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/next_sources/css/next.css HTTP/1.1" 403 54 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43" 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/button_utils.js HTTP/1.1" 200 1504 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43" 
netbox-docker-netbox-1 | 2022/02/07 08:14:26 [error] 18#20 *6 open("/opt/netbox/netbox/static/nextbox_ui_plugin/jquery/jquery-3.4.1.min.js") failed (13: Permission denied) 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/next_app.js HTTP/1.1" 200 14227 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43" 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/jquery/jquery-3.4.1.min.js HTTP/1.1" 403 54 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43" 
netbox-docker-netbox-1 | 2022/02/07 08:14:26 [error] 18#20 *7 open("/opt/netbox/netbox/static/nextbox_ui_plugin/jquery/jquery-3.5.1.min.js") failed (13: Permission denied) 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/jquery/jquery-3.5.1.min.js HTTP/1.1" 403 54 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43" 
netbox-docker-netbox-1 | 2022/02/07 08:14:26 [error] 18#20 *5 open("/opt/netbox/netbox/static/nextbox_ui_plugin/next_sources/js/next.js") failed (13: Permission denied) 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/next_sources/js/next.js HTTP/1.1" 403 54 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43" 
netbox-docker-netbox-1 | 2022/02/07 08:14:26 [error] 18#20 *5 open("/opt/netbox/netbox/static/nextbox_ui_plugin/next_sources/css/next.css") failed (13: Permission denied) 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/next_sources/css/next.css HTTP/1.1" 403 54 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43" 
netbox-docker-netbox-1 | 2022/02/07 08:14:26 [error] 18#20 *5 open("/opt/netbox/netbox/static/nextbox_ui_plugin/jquery/jquery-3.4.1.min.js") failed (13: Permission denied) 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/jquery/jquery-3.4.1.min.js HTTP/1.1" 403 54 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43" 
netbox-docker-netbox-1 | 2022/02/07 08:14:26 [error] 18#20 *5 open("/opt/netbox/netbox/static/nextbox_ui_plugin/jquery/jquery-3.5.1.min.js") failed (13: Permission denied) 
netbox-docker-netbox-1 | 192.168.146.1 - - [07/Feb/2022:08:14:26 +0000] "GET /static/nextbox_ui_plugin/jquery/jquery-3.5.1.min.js HTTP/1.1" 403 54 "http://192.168.146.143:8000/plugins/nextbox-ui/topology/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.80 Safari/537.36 Edg/98.0.1108.43"

看来我的许可失败了。相似的解决问题帮不了我。(#68#86)它们都在Dockerfile中显示出问题。

Dockerfile

代码语言:javascript
复制
ARG FROM_IMAGE=netboxcommunity/netbox
ARG FROM_TAG=latest-ldap
ARG FROM=${FROM_IMAGE}:${FROM_TAG}
FROM ${FROM}

ENV VIRTUAL_ENV=/opt/netbox/venv
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
COPY ./nextbox_ui_plugin /source/nextbox-ui-plugin/nextbox_ui_plugin/
COPY ./setup.py /source/nextbox-ui-plugin/
COPY ./MANIFEST.in /source/nextbox-ui-plugin/
COPY ./README.md /source/nextbox-ui-plugin/
COPY (blank) ./nextbox_ui_plugin/static/nextbox_ui_plugin /opt/netbox/netbox/static/nextbox_ui_plugin
RUN pip3 install --no-cache-dir nextbox-ui-plugin  

我被告知COPY --chown=1000:1000 (--chmod 755) ./nextbox_ui_plugin/static/nextbox_ui_plugin /opt/netbox/netbox/static/nextbox_ui_plugin可以完成我的噩梦。但是,无论我在空白中写了什么,我都不能将/opt/netbox/netbox/static/nextbox_ui_plugin中的文档权限更改为644或755或777。

关于许可

代码语言:javascript
复制
[root@localhost ~]# docker exec -it 534a7d1fe0bf /bin/bash
bash-5.1$ ls -al
total 12
drwxr-xr-x 1 root root 20 Jan 18 05:54 .
drwxr-xr-x 1 root root 18 Jan 18 05:54 ..
drwxr-xr-x 1 root root 39 Jan 18 05:55 circuits
drwxr-xr-x 1 root root 39 Jan 18 05:55 dcim
drwxr-xr-x 1 root root 63 Jan 18 05:55 extras
-rwxr-xr-x 1 root root 277 Jan 18 05:51 generate_secret_key.py
drwxr-xr-x 1 root root 39 Jan 18 05:55 ipam
-rwxr-xr-x 1 root root 249 Jan 18 05:51 manage.py
drwxrwxr-x 4 unit root 56 Jan 24 02:03 media
drwxr-xr-x 1 root root 28 Jan 18 05:55 netbox
drwxr-xr-x 1 root root 18 Jan 18 05:51 project-static
drwxr-xr-x 2 root root 25 Jan 18 05:51 reports
drwxr-xr-x 2 root root 25 Jan 18 05:51 scripts
drwxr-xr-x 1 root root 31 Jan 24 01:23 static
drwxr-xr-x 17 root root 4096 Jan 18 05:51 templates
drwxr-xr-x 1 root root 39 Jan 18 05:55 tenancy
drwxr-xr-x 1 root root 38 Jan 18 05:55 users
drwxr-xr-x 1 root root 38 Jan 18 05:55 utilities
drwxr-xr-x 1 root root 25 Jan 18 05:55 virtualization
drwxr-xr-x 1 root root 25 Jan 18 05:55 wireless
bash-5.1$ cd ./static
bash-5.1$ ls -al
total 7680
drwxr-xr-x 1 root root 31 Jan 24 01:23 .
drwxr-xr-x 1 root root 20 Jan 18 05:54 ..
drwxr-xr-x 6 root root 51 Jan 18 05:55 admin
-rw-r--r-- 1 root root 1133 Jan 18 05:55 cable_trace.css
-rw-r--r-- 1 root root 108636 Jan 18 05:55 config.js
-rw-r--r-- 1 root root 105872 Jan 18 05:55 config.js.map
drwxr-xr-x 4 root root 27 Jan 18 05:55 debug_toolbar
drwxr-xr-x 3 root root 41 Jan 18 05:55 django_tables2
drwxr-xr-x 18 root root 4096 Jan 18 05:55 docs
drwxr-xr-x 5 root root 193 Jan 18 05:55 drf-yasg
drwxr-xr-x 2 root root 25 Jan 18 05:55 graphene_django
-rw-r--r-- 1 root root 27564 Jan 18 05:55 graphiql.css
-rw-r--r-- 1 root root 960413 Jan 18 05:55 graphiql.js
-rw-r--r-- 1 root root 914093 Jan 18 05:55 graphiql.js.map
drwxr-xr-x 3 root root 16 Jan 18 05:55 graphiql_debug_toolbar
-rw-r--r-- 1 root root 1235 Jan 18 05:55 graphql.ico
-rw-r--r-- 1 root root 109291 Jan 18 05:55 lldp.js
-rw-r--r-- 1 root root 106584 Jan 18 05:55 lldp.js.map
-rw-r--r-- 1 root root 465188 Jan 18 05:55 materialdesignicons-webfont-2ZY4X5WS.woff
-rw-r--r-- 1 root root 1026176 Jan 18 05:55 materialdesignicons-webfont-EH3JD4GG.ttf
-rw-r--r-- 1 root root 325244 Jan 18 05:55 materialdesignicons-webfont-KSYPMDN6.woff2
-rw-r--r-- 1 root root 1026396 Jan 18 05:55 materialdesignicons-webfont-LWDVGUDX.eot
drwxr-xr-x 2 root root 4096 Jan 18 05:55 mptt
-rw-r--r-- 1 root root 374410 Jan 18 05:55 netbox-dark.css
-rw-r--r-- 1 root root 286568 Jan 18 05:55 netbox-external.css
-rw-r--r-- 1 root root 232175 Jan 18 05:55 netbox-light.css
-rw-r--r-- 1 root root 727867 Jan 18 05:55 netbox-print.css
-rw-r--r-- 1 root root 1174 Jan 18 05:55 netbox.ico
-rw-r--r-- 1 root root 374821 Jan 18 05:55 netbox.js
-rw-r--r-- 1 root root 344331 Jan 18 05:55 netbox.js.map
-rw-r--r-- 1 root root 835 Jan 18 05:55 netbox_icon.svg
-rw-r--r-- 1 root root 2257 Jan 18 05:55 netbox_logo.png
-rw-r--r-- 1 root root 4719 Jan 18 05:55 netbox_logo.svg
-rw-r--r-- 1 root root 4054 Jan 18 05:55 netbox_touch-icon-180.png
drwxr-xr-x 6 1000 1000 173 Jan 24 01:23 nextbox_ui_plugin
-rw-r--r-- 1 root root 1511 Jan 18 05:55 rack_elevation.css
-rw-r--r-- 1 root root 878 Jan 18 05:55 rest-api.ico
drwxr-xr-x 7 root root 63 Jan 18 05:55 rest_framework
-rw-r--r-- 1 root root 129226 Jan 18 05:55 status.js
-rw-r--r-- 1 root root 128409 Jan 18 05:55 status.js.map
-rw-r--r-- 1 root root 109 Jan 18 05:55 tint_20.png
bash-5.1$ cd ./nextbox_ui_plugin
bash-5.1$ dir
bash: dir: command not found
bash-5.1$ ls -al
total 256
drwxr-xr-x 6 1000 1000 173 Jan 24 01:23 .
drwxr-xr-x 1 root root 31 Jan 24 01:23 ..
-rw-r--r-- 1 1000 1000 81084 Jan 24 01:14 bootstrap.bundle.min.js
-rw-r--r-- 1 1000 1000 155758 Jan 24 01:14 bootstrap.min.css
-rw-r--r-- 1 1000 1000 1504 Jan 24 01:14 button_utils.js
drw-r--r-- 2 1000 1000 27 Jan 24 01:23 img
drw-r--r-- 2 1000 1000 33 Jan 24 01:23 jquery
drw-r--r-- 2 1000 1000 30 Jan 24 01:23 jquery-ui-1.12.1
-rw-r--r-- 1 1000 1000 14227 Jan 24 01:14 next_app.js
drw-r--r-- 6 1000 1000 70 Jan 24 01:23 next_sources
bash-5.1$ chmod 755 ./next_app.js
chmod: ./next_app.js: Operation not permitted
bash-5.1$ sudo chmod 755 ./next_app.js
bash: sudo: command not found

当涉及到收集静态文件时,我会因为权限而遇到另一个失败。

收集静态文件

代码语言:javascript
复制
[root@localhost ~]# docker exec -it 534a7d1fe0bf /bin/bash
bash-5.1$ /opt/netbox/venv/bin/python3 manage.py collectstatic
loaded config '/etc/netbox/config/configuration.py'
loaded config '/etc/netbox/config/extra.py'
loaded config '/etc/netbox/config/logging.py'
loaded config '/etc/netbox/config/plugins.py'

You have requested to collect static files at the destination
location as specified in your settings:

/opt/netbox/netbox/static
This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "/opt/netbox/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/init.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 187, in handle
collected = self.collect()
File "/opt/netbox/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
handler(path, prefixed_path, storage)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 338, in copy_file
if not self.delete_file(path, prefixed_path, source_storage):
File "/opt/netbox/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 291, in delete_file
self.storage.delete(prefixed_path)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/files/storage.py", line 318, in delete
os.remove(name)
PermissionError: [Errno 13] Permission denied: '/opt/netbox/netbox/static/nextbox_ui_plugin/bootstrap.bundle.min.js'`

bash-5.1$ cd /opt/netbox/netbox/
bash-5.1$ python3 manage.py collectstatic
loaded config '/etc/netbox/config/configuration.py'
loaded config '/etc/netbox/config/extra.py'
loaded config '/etc/netbox/config/logging.py'
loaded config '/etc/netbox/config/plugins.py'

You have requested to collect static files at the destination
location as specified in your settings:

/opt/netbox/netbox/static
This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "/opt/netbox/netbox/manage.py", line 10, in
execute_from_command_line(sys.argv)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/init.py", line 419, in execute_from_command_line
utility.execute()
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/init.py", line 413, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
self.execute(*args, **cmd_options)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
output = self.handle(*args, **options)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 187, in handle
collected = self.collect()
File "/opt/netbox/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 114, in collect
handler(path, prefixed_path, storage)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 338, in copy_file
if not self.delete_file(path, prefixed_path, source_storage):
File "/opt/netbox/venv/lib/python3.9/site-packages/django/contrib/staticfiles/management/commands/collectstatic.py", line 291, in delete_file
self.storage.delete(prefixed_path)
File "/opt/netbox/venv/lib/python3.9/site-packages/django/core/files/storage.py", line 318, in delete
os.remove(name)
PermissionError: [Errno 13] Permission denied: '/opt/netbox/netbox/static/nextbox_ui_plugin/bootstrap.bundle.min.js

如您所见,复制未能更改nextbox_ui_plugin中文档的权限,我想这是关键问题,但我无法找到答案。

在我搜索了堆栈溢出之后,我发现netbox没有任何答案,而且它与docker的参与插件也很少见。我不知道如何改变他们的许可再试一次。现在什么都没用了。

你能帮忙吗?

很多Thx :)

EN

回答 1

Stack Overflow用户

发布于 2022-02-15 21:53:44

尝试删除DOckerfile中该行的chown和chmod

复制./nextbox_ui_plugin/静态/nextbox_ui_plugin/opt/netbox/netbox/静态/nextbox_ui_plugin

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71029625

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档