question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Slack Engine cannot import slack client

See original GitHub issue

Description The slack engine fails to load with a recent version of the slack client library

Setup

  • Salt v3001
  • Configure a salt engine
  • Install slackclient on the system (e.g. pip3 install slackclient)

Steps to Reproduce the behavior When starting up and enabling debug logging, one can see this:

2020-06-30 07:46:46,163 [salt.utils.lazy :106 ][DEBUG ][30780] Could not LazyLoad slack.start: 'slack' __virtual__ returned False: The 'slackclient' Python module could not be loaded

https://github.com/saltstack/salt/blob/master/salt/engines/slack.py#L177

It’s probably because slackclient is now different and the migration described in https://github.com/slackapi/python-slackclient/wiki/Migrating-to-2.x was not done.

Installing a v1 version fixed the import but yielded different errors inside the slack module. Quickfixing the imports also didn’t fully work.

Expected behavior

Salt engine starts with recent version of slackclient.

Versions Report

Salt Version:
           Salt: 3001
 
Dependency Versions:
           cffi: 1.13.2
       cherrypy: Not Installed
       dateutil: 2.7.3
      docker-py: Not Installed
          gitdb: Not Installed
      gitpython: Not Installed
         Jinja2: 2.10
        libgit2: 0.28.4
       M2Crypto: Not Installed
           Mako: Not Installed
   msgpack-pure: Not Installed
 msgpack-python: 0.5.6
   mysql-python: Not Installed
      pycparser: Not Installed
       pycrypto: 2.6.1
   pycryptodome: 3.6.1
         pygit2: 1.0.2
         Python: 3.7.3 (default, Dec 20 2019, 18:57:59)
   python-gnupg: Not Installed
         PyYAML: 3.13
          PyZMQ: 18.1.1
          smmap: Not Installed
        timelib: Not Installed
        Tornado: 4.5.3
            ZMQ: 4.3.2
 
System Versions:
           dist: debian 10 buster
         locale: utf-8
        machine: x86_64
        release: 4.19.0-6-amd64
         system: Linux
        version: Debian GNU/Linux 10 buster

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:3
  • Comments:9 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lorenzoquantycacommented, Oct 21, 2020

Do you have any news about the release date of this fix?

0reactions
ITJamiecommented, Jun 26, 2022

https://slack.dev/bolt-python - https://github.com/slackapi/bolt-python Bolt seems to be the direction that slack are going for their newer apps. I would hope this is the direction salt team chooses so that we are actually future proofed

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot import WebClient from slack even after installation ...
For python, use this library --> https://github.com/slackapi/python-slackclient; pip install slackclient; import slack on top of your file ...
Read more >
slackclient
Overview. The Python slackclient library is a developer kit for interfacing with the Slack Web API and Real Time Messaging (RTM) API on...
Read more >
Frequently Asked Questions — slackclient (Legacy Python ...
I cannot install slackclient…¶. We recommend using virtualenv (venv) ... import os import logging from slack import WebClient logging. ... I found a...
Read more >
Community tools for Slack apps
Go ahead and code Slack bots and Web API clients with this library supporting the ... slackline-gae - Google App Engine app to...
Read more >
Use Slack and Confluence together
Install the Slack app on your Confluence site to get updates about your pages in Slack in Confluence Cloud.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found