vSPC.py icon indicating copy to clipboard operation
vSPC.py copied to clipboard

KeyError when timout reached after disconnecting the VSP

Open matya opened this issue 6 years ago • 0 comments

Hi,

I am only connecting the VSP ondemand to a vSPC based on this project (commit 7fd4ca9), I follow this procedure:

  • Connect VSP within vCenter to vSPC -> Connection is established and showing up in the logs (over telnets) => OK
  • Connecting to local vSPC daemon via the local vSPC client via the Admin-Port => OK
  • Disconnecting the local vSPC Client => OK
  • Disconnecting the VSP via vCenter from the vSPC -> Connection is terminated => OK
  • After the timout is reached and a new vSPC client connection is tried (again locally over the admin port), the server throws this backtrace and the local client hangs until ctrl+C-d:
Feb 17 15:40:50 vSPCsrv vSPCServer[9174]: ** Starting Server with opts: --stdout --no-fork --backend Logging --logdir /srv/vspc/logs --ssl --cert /srv/vspc/tls/crt --key /srv/vspc/tls/key --no-vm-ports --vm-expire-time 60 --admin-port 6780 --proxy-port 6778 --mode 640
Feb 17 15:40:50 vSPCsrv vSPCServer[9174]: INFO:root:Starting vSPC on proxy iface 0.0.0.0 port 6778, admin iface 127.0.0.1 port 6780
Feb 17 15:41:37 vSPCsrv vSPCServer[9174]: INFO:root:VM linux012.my.corp (uuid 50302d754410d8f7-17ddffbaf375b458) connected, listening on port None
Feb 17 15:42:26 vSPCsrv vSPCServer[9174]: INFO:root:Client disconnected from linux012.my.corp (uuid 50302d754410d8f7-17ddffbaf375b458), 0 active clients
Feb 17 15:42:36 vSPCsrv vSPCServer[9174]: INFO:root:VM linux012.my.corp (uuid 50302d754410d8f7-17ddffbaf375b458) disconnected
Feb 17 15:43:00 vSPCsrv vSPCServer[9174]: INFO:root:Client disconnected from linux012.my.corp (uuid 50302d754410d8f7-17ddffbaf375b458), 0 active clients
Feb 17 15:43:08 vSPCsrv vSPCServer[9174]: INFO:root:Client disconnected from linux012.my.corp (uuid 50302d754410d8f7-17ddffbaf375b458), 0 active clients
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]: ERROR:root:Worker exception caught
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]: Traceback (most recent call last):
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:   File "/srv/vspc/usr/lib/python2.7/site-packages/vSPC/server.py", line 130, in _queue_run
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:     queue.get()()
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:   File "/srv/vspc/usr/lib/python2.7/site-packages/vSPC/server.py", line 478, in <lambda>
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:     self.task_queue.put(lambda: self.new_admin_connection(sock))
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:   File "/srv/vspc/usr/lib/python2.7/site-packages/vSPC/server.py", line 466, in new_admin_connection
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:     self.collect_orphans()
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:   File "/srv/vspc/usr/lib/python2.7/site-packages/vSPC/server.py", line 512, in collect_orphans
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:     self.expire_orphan(vm)
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:   File "/srv/vspc/usr/lib/python2.7/site-packages/vSPC/server.py", line 541, in expire_orphan
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:     self.delete_stream(vm)
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:   File "/srv/vspc/usr/lib/python2.7/site-packages/vSPC/poll.py", line 181, in delete_stream
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:     self.unsafe_remove_fd(stream)
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:   File "/srv/vspc/usr/lib/python2.7/site-packages/vSPC/poll.py", line 190, in unsafe_remove_fd
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]:     pes = self.event_sources_by_stream[fd]
Feb 17 15:45:00 vSPCsrv vSPCServer[9174]: KeyError: <vSPC.server.Vm instance at 0x7f1190b26878>

Any ideas on how to debug it further or resolve it? thanks, -- J

matya avatar Feb 17 '20 15:02 matya