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

tools/c7n_mailer - on slack error show err text and status code #3652

Merged
merged 3 commits into from Mar 9, 2019

Conversation

kapilt
Copy link
Collaborator

@kapilt kapilt commented Mar 8, 2019

Trying to address and issue reported on gitter, basically the error log tries to decode json from the slack api response, and barfs if its not json, which obscures the original message.

from chat

Looking for some help, how would it be possible that the json response c7n_mailer is trying to send to my slack incoming webhook could not be decoded?
[WARNING] 2019-03-08T17:24:34.882Z f125ba06-c7ad-4751-9dde-8c98a5207dfd Error: Incorrect padding Unable to base64 decode slack_token, will assume plaintext. Traceback (most recent call last): File "/var/task/c7n_mailer/sqs_queue_processor.py", line 182, in process_sqs_message slack_delivery.slack_handler(sqs_message, slack_messages) File "/var/task/c7n_mailer/slack_delivery.py", line 116, in slack_handler self.send_slack_msg(key, payload) File "/var/task/c7n_mailer/slack_delivery.py", line 187, in send_slack_msg self.logger.info("Error in sending Slack message: %s" % response.json()) File "/var/task/requests/models.py", line 897, in json return complexjson.loads(self.text, **kwargs) File "/usr/lib64/python2.7/json/init.py", line 339, in loads return _default_decoder.decode(s) File "/usr/lib64/python2.7/json/decoder.py", line 364, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode raise ValueError("No JSON object could be decoded") ValueError: No JSON object could be decoded END RequestId: f125ba06-c7ad-4751-9dde-8c98a5207dfd

Copy link

@mike-mcelreath mike-mcelreath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 🌮

@kapilt kapilt changed the title tools/c7n_mailer - on slack error show text of errror and status code tools/c7n_mailer - on slack error show err text and status code Mar 9, 2019
@kapilt kapilt merged commit f764464 into cloud-custodian:master Mar 9, 2019
@kapilt kapilt deleted the slack-mailer-error branch March 9, 2019 18:51
lamyanba pushed a commit to lamyanba/cloud-custodian that referenced this pull request Apr 23, 2019
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

Successfully merging this pull request may close these issues.

None yet

2 participants