十一出门,走的时候断电直接拉了电闸(不是x,回来之后,宝塔面板进不去了!
打开网站,一切正常,都能进去。网站的redis,mysql都是正常的。后台bt命令也正常,只是唯独宝塔面板地址显示——127.0.0.1拒绝了我们的连接请求。
。于是群里求助,群友说大概率是端口没开放,于是使用命令netstat -ntlp
查看端口,没有8888
端口!紧接着就去百度搜解决方法了。
运行bt
打开宝塔菜单,查看一下错误日志——22
,显示以下错误:
monkey.patch_all()
File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/monkey.py", line 966, in patch_all
_notify_patch(events.GeventWillPatchAllEvent(modules_to_patch, kwargs), _warnings)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/monkey.py", line 168, in _notify_patch
notify_and_call_entry_points(event)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/events.py", line 111, in notify_and_call_entry_points
for plugin in iter_entry_points(event.ENTRY_POINT_NAME):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 641, in <genexpr>
for entry in dist.get_entry_map(group).values()
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2854, in get_entry_map
self._get_metadata('entry_points.txt'), self
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2534, in parse_map
for group, lines in data:
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3190, in split_sections
for line in yield_lines(s):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2394, in yield_lines
for ss in strs:
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2765, in _get_metadata
for line in self.get_metadata_lines(name):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1417, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1407, in get_metadata
value = self._get(path)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1612, in _get
return stream.read()
OSError: [Errno 5] Input/output error
Traceback (most recent call last):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2851, in get_entry_map
ep_map = self._ep_map
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2813, in __getattr__
raise AttributeError(attr)
AttributeError: _ep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/www/server/panel/BT-Panel", line 11, in <module>
monkey.patch_all()
File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/monkey.py", line 966, in patch_all
_notify_patch(events.GeventWillPatchAllEvent(modules_to_patch, kwargs), _warnings)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/monkey.py", line 168, in _notify_patch
notify_and_call_entry_points(event)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/events.py", line 111, in notify_and_call_entry_points
for plugin in iter_entry_points(event.ENTRY_POINT_NAME):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 641, in <genexpr>
for entry in dist.get_entry_map(group).values()
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2854, in get_entry_map
self._get_metadata('entry_points.txt'), self
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2534, in parse_map
for group, lines in data:
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3190, in split_sections
for line in yield_lines(s):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2394, in yield_lines
for ss in strs:
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2765, in _get_metadata
for line in self.get_metadata_lines(name):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1417, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1407, in get_metadata
value = self._get(path)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1612, in _get
return stream.read()
OSError: [Errno 5] Input/output error
Traceback (most recent call last):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2851, in get_entry_map
ep_map = self._ep_map
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2813, in __getattr__
raise AttributeError(attr)
AttributeError: _ep_map
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/www/server/panel/BT-Panel", line 11, in <module>
monkey.patch_all()
File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/monkey.py", line 966, in patch_all
_notify_patch(events.GeventWillPatchAllEvent(modules_to_patch, kwargs), _warnings)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/monkey.py", line 168, in _notify_patch
notify_and_call_entry_points(event)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/events.py", line 111, in notify_and_call_entry_points
for plugin in iter_entry_points(event.ENTRY_POINT_NAME):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 641, in <genexpr>
for entry in dist.get_entry_map(group).values()
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2854, in get_entry_map
self._get_metadata('entry_points.txt'), self
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2534, in parse_map
for group, lines in data:
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 3190, in split_sections
for line in yield_lines(s):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2394, in yield_lines
for ss in strs:
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2765, in _get_metadata
for line in self.get_metadata_lines(name):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1417, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1407, in get_metadata
value = self._get(path)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pkg_resources/__init__.py", line 1612, in _get
return stream.read()
OSError: [Errno 5] Input/output error
不行啊,这么长的一片,完全看不懂,紧接着使用修复命令——16
,显示以下错误:
ERROR: Exception:
Traceback (most recent call last):
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
status = self.run(options, args)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 179, in run
self.output_package_listing(packages, options)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 255, in output_package_listing
data, header = format_for_columns(packages, options)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pip/_internal/commands/list.py", line 307, in format_for_columns
row = [proj.raw_name, str(proj.version)]
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pip/_internal/metadata/base.py", line 163, in raw_name
retu rn self.metadata.get("Name", self.canonical_name)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pip/_internal/metadata/pkg_resources.py", line 96, in metadata
return get_metadata(self._dist)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pip/_internal/utils/packaging.py", line 48, in get_metadata
metadata = dist.get_metadata(metadata_name)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1420, in get_metadata
value = self._get(path)
File "/www/server/panel/pyenv/lib/python3.7/site-packages/pip/_vendor/pkg_resources/__init__.py", line 1617, in _get
return stream.read()
OSError: [Errno 5] Input/output error
这个短,看出来是在/www/server/panel/pyenv/lib/python3.7/
路径下出了问题。在宝塔论坛 发帖求助 也没人搭理。只好强硬的来尝试修复了——
- 直接重命名
/www/server/panel/pyenv/
文件夹 - 使用官方安装命令覆盖安装宝塔面板,修复python环境
在安装了108分钟之后,顺利的进入到了后台,这时查看netstat -ntlp
,也能看到8888
端口了,一切正常了!!
爽啊啊啊啊~~