Git-Auto-Deploy icon indicating copy to clipboard operation
Git-Auto-Deploy copied to clipboard

Websocket serving results in UnboundLocalError

Open TilBlechschmidt opened this issue 7 years ago • 2 comments

When setting wss-enabled: true in the config running the server results in the following:

2017-10-16 11:21:51,347 [ERROR]  Exception in thread Thread-3:
2017-10-16 11:21:51,347 [ERROR]  Traceback (most recent call last):
2017-10-16 11:21:51,347 [ERROR]    File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
2017-10-16 11:21:51,347 [ERROR]      self.run()
2017-10-16 11:21:51,347 [ERROR]    File "/usr/lib/python2.7/threading.py", line 754, in run
2017-10-16 11:21:51,347 [ERROR]      self.__target(*self.__args, **self.__kwargs)
2017-10-16 11:21:51,347 [ERROR]    File "gitautodeploy/gitautodeploy.py", line 474, in serve_wss
2017-10-16 11:21:51,347 [ERROR]  UnboundLocalError: local variable 'BindError' referenced before assignment

Apparently that is due to the fact that the Exception type is imported from a package within the try block and the catch block for ImportError comes after the usage of BindError. It should also be noted that the required dependencies for running the websocket are not clearly defined somewhere. I attempted to install autobahn and twisted but there seems to be another dependency somewhere.

TilBlechschmidt avatar Oct 16 '17 09:10 TilBlechschmidt

I am also getting the same error in my logs. Anyway to suppress this?

2019-12-10 04:56:40,075 [INFO ]  Starting Git Auto Deploy in daemon mode
2019-12-10 04:56:40,120 [ERROR]  Exception in thread Thread-3:
2019-12-10 04:56:40,122 [ERROR]  Traceback (most recent call last):
2019-12-10 04:56:40,129 [ERROR]    File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
2019-12-10 04:56:40,129 [ERROR]      self.run()
2019-12-10 04:56:40,130 [ERROR]    File "/usr/lib/python2.7/threading.py", line 754, in run
2019-12-10 04:56:40,130 [ERROR]      self.__target(*self.__args, **self.__kwargs)
2019-12-10 04:56:40,130 [ERROR]    File "gitautodeploy/gitautodeploy.py", line 474, in serve_wss
2019-12-10 04:56:40,131 [ERROR]  UnboundLocalError: local variable 'BindError' referenced before assignment

asimzeeshan avatar Dec 09 '19 23:12 asimzeeshan

I resolver installing pyopenssl twisted and autobahn then I changed all occurrence of "from autobahn.websocket import" to "from autobahn.twister.websocket import"

lvfranz avatar Mar 09 '21 15:03 lvfranz