Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
sijis
@sijis:matrix.org
[m]

I got some importlib code to work but it breaks on py 3.7 :(.

There's less than 1 yr support on 3.7. I m considering dropping support and not worry on a py version try/except code

Carlos
@nzlosh
Ouch, I need py3.7 support for some of the older distros. Is it that painful to maintain support until py3.7 reaches EOL?
If it really is a pain, I guess dropping support early is for the good of maintenance. Any stragglers can fork and maintain their own patched copy of errbot until they move off py3.7.
sijis
@sijis:matrix.org
[m]
I can keep it. It's not that big of a pain. I'll just add another dependency for py37 versions
sijis
@sijis:matrix.org
[m]
I fixed it, so it works on py37.
trying to get a better test but having issues with dynamically adding an entrypoint :(
Carlos
@nzlosh
Thanks for the fix @sijis:matrix.org :thumbsup: If it turns out to be too much work/fragile on py37 don't feel compelled to do it my account.
sijis
@sijis:matrix.org
[m]
It actually want as bad as I thought. Just an import and a try/catch piece
sijis
@sijis:matrix.org
[m]
I updated my PR to include some documentation around entrypoints and the pip install enhancement
sijis
@sijis:matrix.org
[m]
I'm merging the PR to remove slack/slack_trm from core
Probably in the next day or so
Carlos Rojas
@carlos.rojas.scl_gitlab
a couple days ago, we have this error message
slack_sdk.errors.SlackApiError: The request to the Slack API failed. (url: https://www.slack.com/api/files.upload)
The server responded with: {'ok': False, 'error': 'invalid_channel', 'channel': '<#GCNTLJ5JQ|infraestructura>'}
we search on stackoverflow, and not results found.
Carlos
@nzlosh
What function are you calling to get that error? Is there an Exception shown?
Carlos Rojas
@carlos.rojas.scl_gitlab
Hi @nzlosh i triying to upload a file to a slack chat. This is a complete log
2022-07-18 17:13:51,398 ERROR errbot.backends.slackv3 Upload of archivos-R107-H02.tar.gz to coordinación-entregas failed.
Traceback (most recent call last):
File "/errbot-dir/backend/err-backend-slackv3/slackv3.py", line 752, in _slack_upload
resp = self.slack_web.files_upload(
File "/usr/lib/python3.9/site-packages/slack_sdk/web/client.py", line 2975, in files_upload
return self.api_call("files.upload", files={"file": file}, data=kwargs)
File "/usr/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 156, in api_call
return self._sync_send(api_url=api_url, req_args=req_args)
File "/usr/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 187, in _sync_send
return self._urllib_api_call(
File "/usr/lib/python3.9/site-packages/slack_sdk/web/base_client.py", line 309, in _urllib_api_call
return SlackResponse(
File "/usr/lib/python3.9/site-packages/slack_sdk/web/slack_response.py", line 189, 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/files.upload)
The server responded with: {'ok': False, 'error': 'invalid_channel', 'channel': '<#GCP4E5A1G|coordinación-entregas>'}
Carlos
@nzlosh

Has anyone come across a problem using the errbot docker image where installing a plugin via !repo install will install the python module dependencies but will fail to find the installed modules when the plugin is activated? nzlosh/err-stackstorm#43

I can see the module is built successfully

Building wheel for sseclient (setup.py) ... done
Created wheel for sseclient: filename=sseclient-0.0.27-py3-none-any.whl size=5584 sha256=f3983832f82d8469375b7afe2fc7439a8af1feff2da64a8c3514401422e34429
Stored in directory: /home/errbot/.cache/pip/wheels/73/21/3f/9d20c05c1c9312ab61bc7bf63bb2c189a71e800cb028fa8d2a
Successfully built sseclient

And when it's imported, an exception is raised

File "/home/errbot/data/plugins/nzlosh/err-stackstorm/lib/stackstorm_api.py", line 7, in
import sseclient
ModuleNotFoundError: No module named 'sseclient'
I noticed this message in the logs
Defaulting to user installation because normal site-packages is not writeable
Perhaps errbot isn't searching the user installation path for plugin modules.
@carlos.rojas.scl_gitlab That looks like a bug, can you create a github issue under the slackv3 repository please?
Carlos Rojas
@carlos.rojas.scl_gitlab
yeah no problem!
Carlos Rojas
@carlos.rojas.scl_gitlab
sijis
@sijis:matrix.org
[m]

@nzlosh: I can't say I have. If I recall I use root to install errbot and deps. When repos install is run, it should be under the errbot account.

I would guess the problem is that the plugin is trying to install on container site-packages but it should really do a 'pip install --user x' for plugin dependencies.

I thought there was a flag/option for have pip use the --user behavior
Carlos
@nzlosh
Thanks @sijis:matrix.org .. I'll take a look at how repo install is calling pip
Fernando Tricas García
@fernand0
Thanks @nzlosh for your help in the issue at github and sorry for the noise!
Carlos
@nzlosh
No need to apologise, we've all been there and you're welcome, happy to help
Randy Thompson
@beardedeagle

ok so looking at the instructions here: https://errbot.readthedocs.io/en/latest/user_guide/configuration/slackv3.html#dependencies

it wants me to clone the repo to ./$PROJECT/backends, then install the dependencies. Is that a hard requirement, or am I just able to install directly from the git location without the need to drop something in ./$PROJECT/backends?

sijis
@sijis:matrix.org
[m]
The backend, right now, is not packaged a python package, so you'll have to clone it
The path you choose, is up to you but it has to be defined in your config.py file
Dependencies should be installed, as the backend still depends on slack sdk package to work
All that being said, there are changes in the master branch will will find plugins that are pip installed on a system.
This backend hasn't been update yet for that (and package published), yet
Randy Thompson
@beardedeagle
gotcha, thanks
sijis
@sijis:matrix.org
[m]
@beardedeagle: not a problem.
Randy Thompson
@beardedeagle
On fresh installs of errbot, I'm getting the following with errbot --init:
Traceback (most recent call last):
  File "/home/rlthompson/.cache/pypoetry/virtualenvs/alfred-pq-5Zp9O-py3.8/bin/errbot", line 5, in <module>
    from errbot.cli import main
  File "/home/rlthompson/.cache/pypoetry/virtualenvs/alfred-pq-5Zp9O-py3.8/lib/python3.8/site-packages/errbot/cli.py", line 27, in <module>
    from errbot.bootstrap import CORE_BACKENDS
  File "/home/rlthompson/.cache/pypoetry/virtualenvs/alfred-pq-5Zp9O-py3.8/lib/python3.8/site-packages/errbot/bootstrap.py", line 10, in <module>
    from errbot.plugin_manager import BotPluginManager
  File "/home/rlthompson/.cache/pypoetry/virtualenvs/alfred-pq-5Zp9O-py3.8/lib/python3.8/site-packages/errbot/plugin_manager.py", line 8, in <module>
    from graphlib import CycleError
ModuleNotFoundError: No module named 'graphlib'
Randy Thompson
@beardedeagle
seems to be an issue specifically when using poetry though
Randy Thompson
@beardedeagle
if you explicitly poetry add graphlib-backport@^1.0.3 then it solves the issue
Randy Thompson
@beardedeagle

so something about poetry doesn't respect

if py_version < (3, 9):
    deps.append("graphlib-backport==1.0.3")

from the setup.py

Randy Thompson
@beardedeagle
however, poetry doesn't work with the slackv3 backend for installing from a location. so seems like a standard pip/setup.py setup is the way to go over poetry for now
Randy Thompson
@beardedeagle
explicitly running poetry add "slack-sdk>=3.12.0" "slackeventsapi>=3.0.0" aiohttp "markdown>=3.3.6" covers it though, if you want to stick with poetry
Carlos
@nzlosh
why doesn't poetry use the requirements.txt from slackv3 when installing it? Does poetry expect pyrpoject.toml?
Randy Thompson
@beardedeagle
it doesn't support requirements.txt directly, but can export to requirements.txt. it's weird like that. I even tried piping the requirements.txt to poetry add directly with no luck
ie, xargs poetry add < requirements.txt and cat requirements.txt | xargs -I % sh -c 'poetry add "%"'
if it were a .whl or .tar.gz file, it should work though from location or normal dependency add's
Carlos
@nzlosh
I think @sijis:matrix.org worked on installing plugins via pypi, so installing as a wheel should be possible. But there needs to be some work done on the plugin/backend to get it there.
That's hasn't happened for slackv3 yet.
Randy Thompson
@beardedeagle
right, makes sense
songupta7
@songupta7

I am having issue with errbot integeration with stackstorm.
Please see the below error:
00:43:19 CRITICAL errbot.plugin.st2.st2_api St2 stream listener - An error occurred: <class 'ValueError'> Bot token is not valid for Stream API.. Backing off 10 seconds.
Traceback (most recent call last):
File "/Users/songupta/errbot/data/plugins/nzlosh/err-stackstorm/lib/stackstorm_api.py", line 187, in st2stream_listener
listener(callback, bot_identity)
File "/Users/songupta/errbot/data/plugins/nzlosh/err-stackstorm/lib/stackstorm_api.py", line 156, in listener
raise ValueError("Bot token is not valid for Stream API.")
ValueError: Bot token is not valid for Stream API.
00:43:29 WARNING errbot.plugin.st2.st2_api Bot credentials re-authentication required.
00:43:29 DEBUG errbot.plugin.st2.auth_ct Authentication User ID is 'errbot%service'
00:43:29 WARNING errbot.plugin.st2 Internal logic error, bot session already exists.
00:43:29 DEBUG errbot.plugin.st2.auth_ct Authentication User ID is 'errbot%service'
00:43:29 DEBUG errbot.plugin.st2 Bot session UserID: errbot%service, Is Sealed: False, SessionID: 1546c95f-bcd0-4737-b248-6cdbda3a43a2, Creation Date: 2022-08-10 00:41:21, Modified Date: 2022-08-10 00:41:21, Expiry Date: 2022-08-10 01:41:21

I have checked the API key is valid , still I am getting this error. Please help suggest.

Below is the config.py
ST2_HOST = os.environ['ST2_HOST']
STACKSTORM = {
'api_auth': {
'key': os.environ['ST2_API_KEY'],
},
"route_key": "errbot",
"plugin_prefix": "st2",
'verify_cert': True,
'auth_url': 'http://{}/auth/v1'.format(ST2_HOST),
'api_url': 'http://{}/api/v1'.format(ST2_HOST),
'stream_url': 'http://{}/stream/v1'.format(ST2_HOST),
'verify_cert': False, # ST2 uses self-signed cert

# Interval for Errbot to refresh a list of available action aliases.
'timer_update': 900,  # Unit: seconds.

}

songupta7
@songupta7
Hey! please help me with the stackstorm-errbot integration : I am getting above failure.
songupta7
@songupta7
01:01:45 CRITICAL errbot.plugin.st2 Failed to authenticate bot credentials with StackStorm API.
@beardedeagle @sijis:matrix.org can you help?
Carlos
@nzlosh
@songupta7 please do not highlight people in this channel, they're not your oncall support.
Carlos
@nzlosh
Since your problem appears to be a StackStorm issue, I suggest you join the StackStorm Slack community and ask in #err-stackstorm