rancher / old-vm

(OBSOLETE) Package and Run Virtual Machines as Docker Containers
Apache License 2.0
645 stars 133 forks source link

novnc broke #67

Closed errordeveloper closed 5 years ago

errordeveloper commented 8 years ago

I ran docker run -v /var/run:/var/run -p 8080:80 -v /var/lib/rancher/vm:/vm rancher/ranchervm and tried accessing the VNC in the browser. The page on port 8080 failed to render anything useful and I found this in the container logs:

172.16.88.1 - - [14/Jan/2016 15:35:08] CGI script exit status 0x1
172.16.88.1 - - [14/Jan/2016 15:35:37] command: /var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm ""
172.16.88.1 - - [14/Jan/2016 15:35:37] Traceback (most recent call last):
  File "/var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm", line 359, in <module>
    containers = {c.get("Id"): c for c in docker_client.containers(all=True)}
  File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 68, in containers
    res = self._result(self._get(u, params=params), True)
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 146, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 142, in _raise_for_status
    raise errors.APIError(e, response, explanation=explanation)
docker.errors.APIError: 400 Client Error: Bad Request ("client is newer than server (client API version: 1.21, server API version: 1.20)")
fabianbaier commented 8 years ago

I have the same issue too. Running CentOS 7. I was able to fix it by installing 1.9

wget https://get.docker.com/builds/Linux/x86_64/docker-1.9.0 -O /usr/bin/docker19 chmod 755 /usr/bin/docker19 mv /usr/bin/docker /usr/bin/docker18 mv /usr/bin/docker19 /usr/bin/docker service docker stop service docker start

Old:
docker --version
Docker version 1.8.2-el7.centos, build a01dc02/1.8.2

handler exception: [Errno 1] _ssl.c:1429: error:14094418:SSL routines:SSL3_READ_BYTES:tlsv1 alert unknown ca
12.161.175.2 - - [05/Feb/2016 00:24:36] command: /var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm ""
12.161.175.2 - - [05/Feb/2016 00:24:36] Traceback (most recent call last):
  File "/var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm", line 359, in <module>
    containers = {c.get("Id"): c for c in docker_client.containers(all=True)}
  File "/usr/local/lib/python2.7/dist-packages/docker/api/container.py", line 68, in containers
    res = self._result(self._get(u, params=params), True)
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 146, in _result
    self._raise_for_status(response)
  File "/usr/local/lib/python2.7/dist-packages/docker/client.py", line 142, in _raise_for_status
    raise errors.APIError(e, response, explanation=explanation)
docker.errors.APIError: 400 Client Error: Bad Request ("client is newer than server (client API version: 1.21, server API version: 1.20)")

12.161.175.2 - - [05/Feb/2016 00:24:36] CGI script exit status 0x1

New:
[root@localhost ~]# docker version
Client:
 Version:      1.9.0
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   76d6bc9
 Built:        Tue Nov  3 19:20:09 UTC 2015
 OS/Arch:      linux/amd64

Server:
 Version:      1.9.0
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   76d6bc9
 Built:        Tue Nov  3 19:20:09 UTC 2015
 OS/Arch:      linux/amd64
[root@localhost ~]# docker run -v /var/run:/var/run -p 8080:80 -v /var/lib/rancher/vm:/vm rancher/ranchervm
Unable to find image 'rancher/ranchervm:latest' locally
latest: Pulling from rancher/ranchervm
Digest: sha256:fbddf37634318b367f974d17ec194438cb1de597ce5f305687e16048c42378e1
Status: Downloaded newer image for rancher/ranchervm:latest
+ '[' '' = bash ']'
+ RANCHER_HOME=/var/lib/rancher
+ exec python /var/lib/rancher/noVNC-0.0.2/utils/websockify --web /var/lib/rancher/noVNC-0.0.2 --cert /var/lib/rancher/self.pem 80 --unix-target /ranchervm/vm
WebSocket server settings:
  - Listen on :80
  - Flash security policy server
  - Web server. Web root: /var/lib/rancher/noVNC-0.0.2
  - SSL/TLS support
  - proxying from :80 to /ranchervm/vm
WARNING: no 'numpy' module, HyBi protocol will be slower
192.77.237.105 - - [05/Feb/2016 02:28:38] command: /var/lib/rancher/noVNC-0.0.2/cgi-bin/ranchervm ""
192.77.237.105 - - [05/Feb/2016 02:28:38] CGI script exited OK
JonathonReinhart commented 8 years ago

@errordeveloper Did you try updating your version of Docker? I had to do the same thing and it worked fine after that.

LLParse commented 5 years ago

RancherVM runs on Kubernetes now. This issue is no longer relevant.