Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Stefano Ortolani
@ostefano
@nzlosh does the errbot slackv3 backend supports the bot replying with an image rather than text?
Carlos
@nzlosh
I've never tried personally. There's a method _slack_upload which calls Slack's files_upload API. If the backend doesn't support the method directly, the SlackSDK module is avilable through the backend object as slack_web. There's a method called api_call which was carried forward from the original slack backend that calls SlackSDK's api_call method. It's a thin wrapper giving access to calling the Slack API directly. That might be another way of getting to the functionality you need.
jv-kalyanchakravarthy
@jv-kalyanchakravarthy

Hai,

I'm facing the problem on my errbot recently, which is running fine from quite long time. We haven't done any changes in the recent time, all of sudden it started failing.

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/errbot/backends/base.py", line 861, in serve_forever
if self.serve_once():
File "backends/err-backend-slackv3/slackv3.py", line 256, in serve_once
self.auth = self.slack_web.auth_test()
File "/usr/local/lib/python3.9/site-packages/slack_sdk/web/client.py", line 1512, in auth_test
return self.api_call("auth.test", params=kwargs)
File "/usr/local/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 145, in api_call
return self._sync_send(api_url=api_url, req_args=req_args)
File "/usr/local/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 182, in _sync_send
return self._urllib_api_call(
File "/usr/local/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 297, in _urllib_api_call
response = self._perform_urllib_http_request(url=url, args=request_args)
File "/usr/local/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 504, in _perform_urllib_http_request
raise err
File "/usr/local/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 412, in _perform_urllib_http_request
resp = self._perform_urllib_http_request_internal(url, req)
File "/usr/local/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 537, in _perform_urllib_http_request_internal
resp = urlopen( # skipcq: BAN-B310
File "/usr/local/lib/python3.9/urllib/request.py", line 214, in urlopen
return opener.open(url, data, timeout)
File "/usr/local/lib/python3.9/urllib/request.py", line 517, in open
response = self._open(req, data)
File "/usr/local/lib/python3.9/urllib/request.py", line 534, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/usr/local/lib/python3.9/urllib/request.py", line 494, in _call_chain
result = func(*args)
File "/usr/local/lib/python3.9/urllib/request.py", line 1389, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/usr/local/lib/python3.9/urllib/request.py", line 1349, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [Errno -3] Try again>
2022-03-11 20:51:22,049 INFO errbot.backends.base Reconnecting in 601 seconds (10 attempted reconnections so far).

2022-03-11 20:51:15,716 ERROR slack_sdk.web.base_client Failed to send a request to Slack API server: <urlopen error [Errno -3] Try again>
2022-03-11 20:51:15,716 INFO slack_sdk.web.base_client A retry handler found: ConnectionErrorRetryHandler for POST https://www.slack.com/api/auth.test - <urlopen error [Errno -3] Try again>
2022-03-11 20:51:17,024 INFO slack_sdk.web.base_client Going to retry the same request: POST https://www.slack.com/api/auth.test
2022-03-11 20:51:22,048 ERROR slack_sdk.web.base_client Failed to send a request to Slack API server: <urlopen error [Errno -3] Try again>
2022-03-11 20:51:22,048 ERROR errbot.backends.base Exception occurred in serve_once:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/urllib/request.py", line 1346, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/usr/local/lib/python3.9/http/client.py", line 1285, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/local/lib/python3.9/http/client.py", line 1331, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.9/http/client.py", line 1280, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.9/http/client.py", line 1040, in _send_output
self.send(msg)
File "/usr/local/lib/python3.9/http/client.py", line 980, in send
self.connect()
File "/usr/local/lib/python3.9/http/client.py", line 1447, in connect
super().connect()
File "/usr/local/lib/python3.9/http/client.py", line 946, in connect
self.sock = self._create_connection(
File "/usr/local/lib/python3.9/socket.py", line 823, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
File "/usr/local/lib/python3.9/socket.py", line 954, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno -3] Try again
Has anyone faced the issue. Request to help on the issue.
Carlos
@nzlosh

@jv-kalyanchakravarthy According to the man pages for getaddrinfo, "Try again" relates to this error:

EAI_AGAIN
              The name server returned a temporary failure indication.  Try again later.

Which suggest you've got DNS issues in your infrastructure

jv-kalyanchakravarthy
@jv-kalyanchakravarthy
Thanks @nzlosh got the issue. Updated the DNS config and it's working.
YuchaoWanghh
@YuchaoWanghh
hello
Sijis Aviles
@sijis
Hi
@nzlosh I'm looking at a release in the next couple of weeks.
Carlos
@nzlosh
Sounds good :thumbsup:
DrHeckerKiller
@DrHeckerKiller
Hi
Can i have mod?
Plss
U w U
Hello?
Pls answer
Sijis Aviles
@sijis
What do I mean, mod?
lowid
@soloradish
Hi every one. I need some help in simple botcmd() use case.
how can I get user identitry who trigger the botcmd ?
I need read user email address from slack backend. I find there is identity.Person in slackv3 backend.
but I'm not able to figure out how to get or 'reflect' user identity in @botcmd decorated function.
Sijis Aviles
@sijis
If you type !whoami you should see the object path to get the info you need. It's be like frm.xxxx
lowid
@soloradish
@sijis thank you!
Sijis Aviles
@sijis
Glad that helped
lowid
@soloradish
I have another question, how should I handle the non-command message from users?
eg. user send text with out leading !, I want send help message back to user.
I found 'def unknown_command'. but this method only handle unmatched command, not plain messages.
how can I achieve this ?
lowid
@soloradish
I finally resolve it. use 'callback_message'. ; )
Carlos
@nzlosh
Sijis Aviles
@sijis
lowid
@soloradish
It's very helpful, thank you @nzlosh @sijis
Sijis Aviles
@sijis
@soloradish anytime. Glad to be of help
Carlos
@nzlosh
Good news for discord users, the lead developer of the Python discord.py module has decided to return to active development. https://gist.github.com/Rapptz/c4324f17a80c94776832430007ad40e6
Sijis Aviles
@sijis
That's great!
K Dhanesh
@dhanupreeth_twitter
Hey Folks, Hope you all r doing good.
I need help to configure the slack.
K Dhanesh
@dhanupreeth_twitter
20:05:56 WARNING  slackclient.client        Failed RTM connect
Traceback (most recent call last):
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slackclient/client.py", line 140, in rtm_connect
    self.server.rtm_connect(use_rtm_start=with_team_state, **kwargs)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slackclient/server.py", line 168, in rtm_connect
    raise SlackLoginError(reply=reply)
slackclient.server.SlackLoginError
20:05:56 ERROR    errbot.backends.base      Exception occurred in serve_once:
Traceback (most recent call last):
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backends/base.py", line 861, in serve_forever
    if self.serve_once():
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backends/slack.py", line 453, in serve_once
    raise Exception("Connection failed, invalid token ?")
Exception: Connection failed, invalid token ?
20:05:56 INFO     errbot.backends.base      Reconnecting in 41 seconds (5 attempted reconnections so far).
my Token was accepted.
Carlos
@nzlosh
@dhanupreeth_twitter I recommend using the slackv3 https://github.com/errbotio/err-backend-slackv3 backend
K Dhanesh
@dhanupreeth_twitter
thanks, already I tried got the below error
21:14:44 INFO     errbot.bootstrap          Found Storage plugin: Shelf.
Traceback (most recent call last):
  File "/Users/dhanesh/.pyenv/versions/3.9.0/bin/errbot", line 8, in <module>
    sys.exit(main())
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/cli.py", line 395, in main
    bootstrap(backend, root_logger, config, restore)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/bootstrap.py", line 257, in bootstrap
    bot = setup_bot(bot_class, logger, config, restore)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/bootstrap.py", line 166, in setup_bot
    backendpm = BackendPluginManager(
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backend_plugin_manager.py", line 51, in __init__
    raise PluginNotFoundException(
errbot.backend_plugin_manager.PluginNotFoundException: Could not find the plugin named SlackV3 in ['/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backends’].
Carlos
@nzlosh
You need to installed it. Follow the instructions in the README.
K Dhanesh
@dhanupreeth_twitter
Sure let me try that, I’m using Mac. I’m not able to fix it.
but let me try and will update.
Carlos
@nzlosh
Errbot isn't tested on Mac so it might be an issue. Especially if it's using M1 architecture.
K Dhanesh
@dhanupreeth_twitter
I’m using intel. still I couldn’t resolve it.
K Dhanesh
@dhanupreeth_twitter

@nzlosh In my app location, I’ve created backend directory and cloned the following repo - https://github.com/errbotio/err-backend-slackv3 and then installed via pip install -r ./backend/err-backend-slackv3/requirements.txt Updated the config.py

BOT_EXTRA_BACKEND_DIR="mypath/backend”

And started the app, now getting this error.

21:38:07 ERROR    errbot.backends.base      Exception occurred in serve_once:
Traceback (most recent call last):
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/errbot/backends/base.py", line 861, in serve_forever
    if self.serve_once():
  File "/Users/dhanesh/dhanu/2022/devopsbot/backend/err-backend-slackv3/slackv3.py", line 273, in serve_once
    self.bot_identifier = SlackPerson(self.slack_web, self.auth["user_id"])
  File "/Users/dhanesh/dhanu/2022/devopsbot/backend/err-backend-slackv3/_slack/person.py", line 50, in __init__
    self._cache_user_info()
  File "/Users/dhanesh/dhanu/2022/devopsbot/backend/err-backend-slackv3/_slack/person.py", line 88, in _cache_user_info
    res = self._webclient.users_info(user=self._userid)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/client.py", line 4192, in users_info
    return self.api_call("users.info", http_verb="GET", params=kwargs)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 145, in api_call
    return self._sync_send(api_url=api_url, req_args=req_args)
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 182, in _sync_send
    return self._urllib_api_call(
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 316, in _urllib_api_call
    return SlackResponse(
  File "/Users/dhanesh/.pyenv/versions/3.9.0/lib/python3.9/site-packages/slack_sdk/web/slack_response.py", line 205, in validate
    raise e.SlackApiError(message=msg, response=self)
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/users.info)
The server responded with: {'ok': False, 'error': 'missing_scope', 'needed': 'users:read', 'provided': 'chat:write,im:write'}