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

No handlers could be found for logger "slackclient.client" (ubuntu WORKS, same code centos7 does not) #389

Closed
6 of 9 tasks
miklasz opened this issue Mar 5, 2019 · 5 comments
Assignees
Labels
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented question M-T: User needs support to use the project Version: 1x
Milestone

Comments

@miklasz
Copy link

miklasz commented Mar 5, 2019

Description

Hi,

I am having issue to run my bot in centos7.
I worked with code in ubuntu and it works with no problem.
so i run the same code in centos7 with all pip requirements running, and when run in centos i have:

No handlers could be found for logger "slackclient.client"
Connection failed. Exception traceback printed above.

FUNNY THING IS:
when I use bot check script which use same method to connect as my bot I can get return bot name from slack

i am really puzzled

#########################
when run bot scriptto check my bot id i have:

DEBUG 2019-03-05 17:01:42,534 - Starting new HTTPS connection (1): slack.com:443
DEBUG 2019-03-05 17:01:42,880 - https://slack.com:443 "POST /api/users.list HTTP/1.1" 200 None

which is good, but when i run same thing with main bot script i have:

DEBUG 2019-03-05 16:58:14,448 - Starting new HTTPS connection (1): slack.com:443
DEBUG 2019-03-05 16:58:14,888 - https://slack.com:443 "POST /api/rtm.connect HTTP/1.1" 200 285
WARNING 2019-03-05 16:58:15,047 - Failed RTM connect
Traceback (most recent call last):
  File "/home/miklab01/python-slackclient/slackclient/client.py", line 140, in rtm_connect
    self.server.rtm_connect(use_rtm_start=with_team_state, **kwargs)
  File "/home/miklab01/python-slackclient/slackclient/server.py", line 159, in rtm_connect
    self.connect_slack_websocket(self.ws_url)
  File "/home/miklab01/python-slackclient/slackclient/server.py", line 200, in connect_slack_websocket
    raise SlackConnectionError(message=str(e))
SlackConnectionError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)

both bot check script and slack bot script connect with the same key

What type of issue is this? (place an x in one of the [ ])

  • bug ????
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion

Requirements (place an x in each of the [ ])

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

slackclient version: 1.3.1

python version:
with ubuntu i use:
Python 2.7.15rc1

with centos:
Python 2.7.5

OS version(s):
UBUNTU 18.04.1 Linux 4.15.0-45-generic LTS Server
Centos7 Linux 3.10.0-862.11.6.el7.x86_64

Steps to reproduce:

  1. python script.py

Expected result:

run bot script on both cenots and ubuntu (only ubuntu works)

Actual result:

ubuntu works fine
centos bot check script with the same method of connection works
centos running actual bot script DOES NOT

No handlers could be found for logger "slackclient.client"
Connection failed. Exception traceback printed above.

any ideas ? anyone ?

Attachments:

Logs, screenshots, screencast, sample project, funny gif, etc.

@miklasz
Copy link
Author

miklasz commented Mar 5, 2019

@RodneyU215
Copy link
Contributor

RodneyU215 commented Mar 6, 2019

Hi @miklasz, Thanks for reporting this. I believe the logging issue occurs because we've not set a default logging NullHandler to avoid the "No handler found" warnings.

Can you try adding this line of code?

import logging
logging.basicConfig()

Once confirmed we can open a PR to ensure the top level __init__.py sets it.

With respect to the SSL issues there's a decent conversation happening on issue #334

@RodneyU215 RodneyU215 self-assigned this Mar 6, 2019
@RodneyU215 RodneyU215 added the bug label Mar 6, 2019
@miklasz
Copy link
Author

miklasz commented Mar 6, 2019

@RodneyU215
yeah i did that before, thats how i found this:

WARNING:slackclient.client:Failed RTM connect
Traceback (most recent call last):
  File "/home/miklab01/python-slackclient/slackclient/client.py", line 140, in rtm_connect
    self.server.rtm_connect(use_rtm_start=with_team_state, **kwargs)
  File "/home/miklab01/python-slackclient/slackclient/server.py", line 159, in rtm_connect
    self.connect_slack_websocket(self.ws_url)
  File "/home/miklab01/python-slackclient/slackclient/server.py", line 200, in connect_slack_websocket
    raise SlackConnectionError(message=str(e))
SlackConnectionError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:579)
Connection failed. Exception traceback printed above.

@miklasz
Copy link
Author

miklasz commented Mar 6, 2019

i also found this:
Resolution Steps:
NOTE: We strongly recommend that Python is NOT updated to a version newer than python-2.7.5-48.el*.x86_64. If it is newer, downgrade if possible.

Cose:
This is due to a defect in newer releases of Python 2.7.5 (build 58 or greater) which causes certificate validation to fail regardless of certificate status. This is outlined further in the following link:

https://community.hortonworks.com/questions/120861/ambari-agent-ssl-certificate-verify-failed-certifi.html
Additionally, this can be caused by updating to a newer release of JDK above 1.8.0_131 and CentOS/RHEL versions 7.4 and above where TLS v1 has been disabled.

https://community.hortonworks.com/questions/134759/disabling-tlsv1-tls11-enabling-tlsv12.html

i didnt test it yet but i will tomorrow

@RodneyU215 RodneyU215 added Priority: High bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented Version: 1x and removed bug labels Jun 4, 2019
@seratch seratch added question M-T: User needs support to use the project and removed Priority: High labels May 20, 2020
@seratch
Copy link
Member

seratch commented May 20, 2020

@miklasz If you don't mind, could I close this issue? Regarding this, I don't see anything further I (as a maintainer of this library) can do for you. Allow me to close this issue after waiting for your response for a while.

@seratch seratch added this to the 1.x milestone May 20, 2020
@seratch seratch 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
bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented question M-T: User needs support to use the project Version: 1x
Projects
None yet
Development

No branches or pull requests

3 participants