当前情况
OpenStack train 4.0.2
报错信息:
cat /var/log/nova/nova-novncproxy.log
code 400, message Client must support 'binary' or 'base64' protocol
查看当前版本:
[root@controller ~]# nova-novncproxy --version
20.6.0
[root@controller ~]# yum list | grep novnc
novnc.noarch 1.3.0-5.el7 @epel
openstack-nova-novncproxy.noarch 1:20.6.0-1.el7 @train
[root@controller ~]# rpm -qa | grep websockify
python36-websockify-0.6.0-5.el7.noarch
python2-websockify-0.8.0-13.el7.noarch
解决办法
网上普遍的一个解决办法,尝试编辑文件/usr/share/novnc/core/websock.js
,将
open(uri, protocols) {
this.attach(new WebSocket(uri, protocols));
}
替换为
open(uri, protocols) {
this.attach(new WebSocket(uri, ['binary', 'base64']));
}
重启服务
systemctl restart openstack-nova-conductor.service openstack-nova-novncproxy.service openstack-nova-scheduler.service
验证是否解决(注意:需要重新生成带 token 的 noVNC 链接)
[root@controller ~]# openstack console url show testVM1
+-------+-------------------------------------------------------------------------------------------+
| Field | Value |
+-------+-------------------------------------------------------------------------------------------+
| type | novnc |
| url | http://controller:6080/vnc_auto.html?path=%3Ftoken%3Da8692891-aca3-40d8-aa67-e10483e3995b |
+-------+-------------------------------------------------------------------------------------------+
评论区