operable / cog

Bringing the power of the command line to chat
https://book.cog.bot/
Other
916 stars 71 forks source link

Cog crashes when new user registers (Slack) #1380

Open Erreinion opened 7 years ago

Erreinion commented 7 years ago

I have self-registration on. Behaviour is consistent. Every time a new user interacts with the Cog bot on Slack, cog crashes.

Using the cog Docker container. Version 1.0 (pulled today).

By the way, Cog generates hundreds of log messages in a minute when this happens.

Log, first entry:

2017-03-16T13:52:59.274 module=Cog.Chat.Slack.Connector line=3 [error] key :email not found in: %{avatar_hash: "gdf01c943807", fields: nil, first_name: "Sam", image_192: "https://secure.gravatar.com/avatar/df01c9438074866325af64e3345eb949.jpg?s=192&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0025-192.png", image_24: "https://secure.gravatar.com/avatar/df01c9438074866325af64e3345eb949.jpg?s=24&d=https%3A%2F%2Fa.slack-edge.com%2F0180%2Fimg%2Favatars%2Fava_0025-24.png", image_32: "https://secure.gravatar.com/avatar/df01c9438074866325af64e3345eb949.jpg?s=32&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0025-32.png", image_48: "https://secure.gravatar.com/avatar/df01c9438074866325af64e3345eb949.jpg?s=48&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0025-48.png", image_512: "https://secure.gravatar.com/avatar/df01c9438074866325af64e3345eb949.jpg?s=512&d=https%3A%2F%2Fa.slack-edge.com%2F7fa9%2Fimg%2Favatars%2Fava_0025-512.png", image_72: "https://secure.gravatar.com/avatar/df01c9438074866325af64e3345eb949.jpg?s=72&d=https%3A%2F%2Fa.slack-edge.com%2F66f9%2Fimg%2Favatars%2Fava_0025-72.png", last_name: "manatee", real_name: "Sam manatee", real_name_normalized: "Sam manatee"}
2017-03-16T13:52:59.275 module=Cog.Chat.Slack.Connector line=3 [error]     (cog) lib/cog/chat/slack/connector.ex:255: Cog.Chat.Slack.Connector.make_user/1
    (cog) lib/cog/chat/slack/connector.ex:176: Cog.Chat.Slack.Connector.lookup_user/3
    (cog) lib/cog/chat/slack/connector.ex:284: Cog.Chat.Slack.Connector.annotate_message/2
    (cog) lib/cog/chat/slack/connector.ex:39: Cog.Chat.Slack.Connector.handle_message/2
    (cog) lib/cog/chat/slack/connector.ex:3: Cog.Chat.Slack.Connector.websocket_handle/3
    src/websocket_client.erl:384: :websocket_client.retrieve_frame/6
    (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Erreinion commented 7 years ago

Is there a way to turn off the requirement for emails, or for cog to handle errors more gracefully?

christophermaier commented 7 years ago

May have to do with this recent change to how Slack exposes email addresses: https://api.slack.com/changelog/2016-11-10-addressing-email-addresses

christophermaier commented 7 years ago

@Erreinion There isn't currently a way to disable the requirement for emails, as that's also built into Cog's database schema. Not having an email address would also affect the "reset password by email" functionality. We may be able to alter Cog to better account for this, but as of this moment, I don't think there's a "quick fix" for this.