vmvare虚拟机安装宝塔报错UnicodeError: encoding with 'idna' codec failed (UnicodeError: la

December 09, 2023
测试
测试
测试
测试
5 分钟阅读

今天在vmware虚拟机安装宝塔时报错,没有多想就认为是系统镜像问题,于是重新下载了其他镜像,结果一样报错,报错信息如下:

    self.update_environ()
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/pywsgi.py", line 1558, in update_environ
    name = socket.getfqdn(address[0])
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/_socketcommon.py", line 304, in getfqdn
    hostname, aliases, _ = gethostbyaddr(name)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/_socketcommon.py", line 276, in gethostbyaddr
    return get_hub().resolver.gethostbyaddr(ip_address)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/resolver/thread.py", line 66, in gethostbyaddr
    return self.pool.apply(_socket.gethostbyaddr, args, kwargs)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/pool.py", line 161, in apply
    return self.spawn(func, *args, **kwds).get()
  File "src/gevent/event.py", line 306, in gevent._gevent_cevent.AsyncResult.get
  File "src/gevent/event.py", line 336, in gevent._gevent_cevent.AsyncResult.get
  File "src/gevent/event.py", line 324, in gevent._gevent_cevent.AsyncResult.get
  File "src/gevent/event.py", line 304, in gevent._gevent_cevent.AsyncResult._raise_exception
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/_compat.py", line 65, in reraise
    raise value.with_traceback(tb)
  File "/www/server/panel/pyenv/lib/python3.7/site-packages/gevent/threadpool.py", line 167, in __run_task
    thread_result.set(func(*args, **kwargs))
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)

可以看到gethostbyaddr错误信息,可能是获取系统的主机名失败,我们尝试修改一个主机名

# 修改系统的主机名

hostnamectl set-hostname 主机名

# 重启系统生效

reboot

成功解决问题

继续阅读

更多来自我们博客的帖子

如何安装 BuddyPress
由 测试 December 17, 2023
经过差不多一年的开发,BuddyPress 这个基于 WordPress Mu 的 SNS 插件正式版终于发布了。BuddyPress...
阅读更多
Filter如何工作
由 测试 December 17, 2023
在 web.xml...
阅读更多
如何理解CGAffineTransform
由 测试 December 17, 2023
CGAffineTransform A structure for holding an affine transformation matrix. ...
阅读更多