-
Notifications
You must be signed in to change notification settings - Fork 255
Can't start rtmbot in bash on ubuntu on windows with virtualenv #63
Comments
I second Matt's conclusion. I have been attempting the exact same thing. I can get the slack bot running fine on my windows machine, but when i attempt a vm host using ubuntu 14 and 16, i get the same error. |
Make sure your config file is in the right permissions for rtmbot to load it. Also what happens if you do this? python rtmbot.py -c /path/to/rtmbot.conf |
The config file is located in the same directory. Running: python rtmbot.py -c /path/to/rtmbot.conf gives the exact same error. It might be possible that this has to do with how bash on ubuntu on windows works. But I am not 100% sure. |
Possibly. The reason why I asked this is because that exact python exception happens when the websocket creation failed. For example the token is invalid. The token is in the config file in this case. |
yeah I have tested using normal powershell mode with python and that works just fine. but there could be a problem with sockets and how bash on ubuntu on windows works. This might be fixed in the 16.04 preview but I do not have access to that for testing unfortunately. |
I've tested it with the following and it works fine; OS: Ubuntu 14.04.5 LTS (on top of virtualbox mac) @nmat Example related issue: slackapi/python-slack-sdk#101 In any case, make sure your network interface is properly setup for example must be able to connect to the internet do a test perhaps. |
@pepedocs However checking for interfaces in /sbin/ifconfig using WSL shows nothing. Could this be the issue where the system does not really hold any interface where the socket can be bound? WSL is still in preview however it would be good to know if it actually is that which is causing the problems. |
You may try the following to get more info about possible errors when creating the socket;
You should get a json response with at least the following key and values; Check for errors here.
Type "python" in terminal
The last line with the "bound" string is the one being referred in the above exception in your first post. Here as you noticed the websocket is created properly and it was able to create "recv" method as well. In your case "ws" did not exist thus the error. |
I have looked a bit on the upcoming release of bash on ubuntu on windows though and there is quite a few changes coming in regarding connections and more for sockets. But like I said I can't test it since I am not on the insider preview. :( |
Hi @nmat, Have you tried the test I described above? I don't think there is a problem in bash or ubuntu. Bash doesn't have anything to do with sockets. |
@nmat If that stack trace you've just posted is the output of the test I described (please add more info), then it looks like the error is some sort of python incompatibility. Can you please try the test I described both for py 2.7 and 3.4? |
I'm also experiencing OP's issue on Ubuntu 14.04: Python version 2.7.12 Error in question: The tests you list earlier seem to function properly for me, at least for python 2.7:
I'd be happy to provide any further information if needed. |
Hi, I also had troubles starting the bot on python 3.5. I traced the error to the websocket client, got this exact error websocket-client/websocket-client#227. After applying this (quick and dirty) fix I got everything working:
|
It's interesting... I just started seeing this error this morning (12/29) on both OS X and Ubuntu. However, the error appears to be intermittent. I'm seeing this on version 0.3.0 of the rtmbot, with python 3.5. |
I was receiving this same error on CentOS 6 with Python 2.7.8; errors suggested issues with SNI. Upgrading Python to the newer 2.7.13 branch resolved the issue, I suspect it's because Python's 3.4 SSL module has been backported in 2.7.9 and above. |
Hi @vladan ! Did you ever submit that as a PR to websocket-client/websocket-client ? I still get the errors every now and then for some reason... (I haven't tried the patch, but will the next time I encounter the issue. |
Hey @mikegrima, I didn't submit a PR because the error is the way slackclient uses websocket-client, I just saw what needs to be done in slackclient to get it running with python3, which slackclient officialy doesn't support :( If I find more time to get busy with slackclient I could help with the python3 support, for now I'll use this dirty thing I patched. |
I apologize if this is too simplistic or not directly related to this thread, but after cloning the github files I don't see rtmbot.py anywhere. Is this file supposed to be created from the cloning process or is there a command to generate it? |
Funny thing, I had the same error. Found solution here, in the comments, after I did |
This issue should be fixed when using slackclient 1.2.0+ |
Description
Reproducible in:
RTMBot version: git
Python version: 3.4.3/2.7.6
OS Version: Windows 10 Version 1607 (OS Build 14393.321)
Steps to reproduce:
Expected result:
Actual result:
Attachments:
Traceback (most recent call last): File "rtmbot.py", line 26, in <module> bot.start() File "/home/xxx/git/python-rtmbot/rtmbot/core.py", line 78, in start self._start() File "/home/xxx/git/python-rtmbot/rtmbot/core.py", line 65, in _start for reply in self.slack_client.rtm_read(): File "/home/xxx/virtualenv/slack-environment/local/lib/python2.7/site-packages/slackclient/_client.py", line 120, in rtm_read json_data = self.server.websocket_safe_read() File "/home/xxx/virtualenv/slack-environment/local/lib/python2.7/site-packages/slackclient/_server.py", line 138, in websocket_safe_read data += "{0}\n".format(self.websocket.recv()) AttributeError: 'NoneType' object has no attribute 'recv'
Traceback (most recent call last): File "./rtmbot.py", line 26, in <module> bot.start() File "/home/xxx/bottest/python-rtmbot/rtmbot/core.py", line 78, in start self._start() File "/home/xxx/bottest/python-rtmbot/rtmbot/core.py", line 65, in _start for reply in self.slack_client.rtm_read(): File "/home/xxx/virtualenv/slack-bot/lib/python3.4/site-packages/slackclient/_client.py", line 120, in rtm_read json_data = self.server.websocket_safe_read() File "/home/xxx/virtualenv/slack-bot/lib/python3.4/site-packages/slackclient/_server.py", line 138, in websocket_safe_read data += "{0}\n".format(self.websocket.recv()) AttributeError: 'NoneType' object has no attribute 'recv'
The text was updated successfully, but these errors were encountered: