Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start after a clean install with a simple configuration file #360

Closed
zenithyr opened this issue Jun 4, 2020 · 1 comment
Closed

Comments

@zenithyr
Copy link

zenithyr commented Jun 4, 2020

Hi there,

I ran into this issue today after pip install slack_machine and follow the tutorials.

My local_settings.py is

SLACK_API_TOKEN="hidden"
PLUGINS = []

Then I ran slack-machine and saw the output below:

Initializing Slack Machine:
    Loading settings...
    Initializing storage using backend: machine.storage.backends.memory.MemoryStorage
    Loading plugins...

Starting Slack Machine:
    ✓ Connected to Slack
    ✓ Scheduler started
Bottle v0.13-dev server starting up (using WSGIRefServer())...
    ✓ Web server started
Listening on http://0.0.0.0:8080/
    ✓ Dispatcher started
Hit Ctrl-C to quit.

Traceback (most recent call last):
  File "/home/tradeops/.virtualenvs/default/bin/slack-machine", line 8, in <module>
    sys.exit(main())
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/machine/bin/run.py", line 14, in main
    bot.run()
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/machine/core.py", line 211, in run
    self._dispatcher.start()
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/machine/dispatch.py", line 34, in start
    self._client.start()
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/machine/clients/singletons/slack.py", line 118, in start
    self.rtm_client.start()
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/slack/rtm/client.py", line 198, in start
    return self._event_loop.run_until_complete(future)
  File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
    return future.result()
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/slack/rtm/client.py", line 329, in _connect_and_read
    url, data = await self._retreive_websocket_info()
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/slack/rtm/client.py", line 503, in _retreive_websocket_info
    resp = await self._web_client.rtm_connect()
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/slack/web/base_client.py", line 214, in _send
    http_verb=http_verb, api_url=api_url, req_args=req_args
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/slack/web/base_client.py", line 244, in _request
    async with session.request(http_verb, api_url, **req_args) as res:
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/aiohttp/client.py", line 1012, in __aenter__
    self._resp = await self._coro
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/aiohttp/client.py", line 473, in _request
    ssl=ssl, proxy_headers=proxy_headers, traces=traces)
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 291, in __init__
    self.update_proxy(proxy, proxy_auth, proxy_headers)
  File "/home/tradeops/.virtualenvs/default/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 519, in update_proxy
    raise ValueError("Only http proxies are supported")
ValueError: Only http proxies are supported

The server is an Amazon Cloud server, no proxy is set (env | grep -i proxy is empty).

What's interesting is that, if I run this locally, and install a HTTP proxy server and set it in the config like

HTTP_PROXY="http://127.0.0.1:1087"
SLACK_API_TOKEN='hidde'
PLUGINS=[]

...works like a charm.

I may have misunderstood but how to properly run it on the server without any proxy? Thanks!

@zenithyr
Copy link
Author

zenithyr commented Jun 4, 2020

Confirmed this is a package version error. Try pip install -r requirement.txt after a clear virtualenv setup fixed the issue.

@zenithyr zenithyr closed this as completed Jun 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant