botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

Slack and Skype stopped working since update to V3

Open Thegaram opened this issue 10 years ago • 22 comments

Since my update to the new version, both the Slack and Skype channels stopped working.

On Skype, the messages I send seemingly don't reach my bot and I'm getting Unauthorized. I'm using HTTPS, it works on other channels. On the My Bot page the status is Error (Unauthorized).

On Slack, the messages reach my controller but my responses don't reach Slack. On the My Bot page the status is Error (Sorry, [Bot Name] is having a problem responding right now).

Other channels work fine. (Tried Facebook, Telegram, Kik, GroupMe.)

Thegaram avatar Jul 09 '16 00:07 Thegaram

http://docs.botframework.com/en-us/support/upgrade-code-to-v3/#navtitle , I guess you haven't done this.

AmineI avatar Jul 09 '16 01:07 AmineI

@AmineI I have actually. Had to change many lines due to the changes to messages and bot state handling. Also updated Web.config (MicrosoftAppID, MicrosoftAppPassword) and updated my registration to use V3. As mentioned, it works on other channels, and also in the new Channel Emulator.

Thegaram avatar Jul 09 '16 01:07 Thegaram

Oh, okay then ! Which language are you working with ?

AmineI avatar Jul 09 '16 01:07 AmineI

C#.

Thegaram avatar Jul 09 '16 01:07 Thegaram

I am also having trouble with Slack, Skype seems to work fine though. I am working with C#.

I created a new project using the new V3 bot application template, deploy it to an azure API app. All the bot connector stuff is already configured. When attach a remote debugger to my deployed app, I get a Microsoft.Rest.RestException with the message "Unable to deserialize the response."

sixpi avatar Jul 09 '16 01:07 sixpi

The inner exception is {"Unexpected character encountered while parsing value: <. Path '', line 0, position 0."}

sixpi avatar Jul 09 '16 01:07 sixpi

The web chat also seems to work too.

sixpi avatar Jul 09 '16 01:07 sixpi

thegram what is your bot id?

tomlm avatar Jul 09 '16 21:07 tomlm

I'm seeing the same exception when trying to reply to a message on the slack channel only.

"Microsoft.Rest.RestException: Unable to deserialize the response. ---> Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0. at Newtonsoft.Json.JsonTextReader.ParseValue() ... at Microsoft.Bot.Connector.Conversations.d__7.MoveNext()

vipulm avatar Jul 09 '16 22:07 vipulm

@tomlm bot handle: platform_service, Microsoft App ID: 12fadc94-5c73-42e4-b2f6-01ea53fc62f5.

Checked again, it seems like on Slack I get the same exception as the others (on sending the reply from my dialog). On Skype the message doesn't even reach my controller (or at least the Post method).

Thegaram avatar Jul 10 '16 00:07 Thegaram

My guess according to the source code is that the connector's response to the following request is ill-formatted (for Slack): POST v3/conversations/{conversationId}/activities/{activityId}

The exception is from Microsoft.Bot.Connector.Conversations.ReplyToActivityWithHttpMessagesAsync. Here's the stacktrace:

Microsoft.Rest.RestException: Unable to deserialize the response. --->
Newtonsoft.Json.JsonReaderException: Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ReadForType(JsonReader reader, JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject[T](String json, JsonSerializerSettings settings)
at Microsoft.Bot.Connector.Conversations.<ReplyToActivityWithHttpMessagesAsync>d__7.MoveNext()
--- End of inner exception stack trace ---

Thegaram avatar Jul 10 '16 00:07 Thegaram

It looks like the Activity sent from skype has a < character at the beginning. Could you post the JSON being sent to the bot from Slack so we can compare it to the request sent from Skype?

ChuckkNorris avatar Jul 11 '16 04:07 ChuckkNorris

I just meant to add I am having the same problems (Slack & Skype) as @Thegaram, but with the Node version. In the bot framework dashboard, Slack's status is "error" and the message given is:

Sorry, test_bot is forbidden for us to talk to.

I am not really sure what it means though, and I am not sure how to debug this.

Everything used to work fine with 1.0.

thingista avatar Jul 11 '16 17:07 thingista

@ChuckkNorris You mean the Activity from Slack has a < character? I don't think so, as the exception occures during reply, not during the first deserialization. The stacktrace above suggests that, when posting the reply message, the answer from https://slack.botframework.com/ begins with that character.

Nevertheless, here's the Activity from Slack:

{
  "type": "message",
  "id": "5bfc91b30c6a4b6eb50f5c503af62cc2",
  "timestamp": "2016-07-11T17:26:35.0869918Z",
  "serviceUrl": "https://slack.botframework.com/",
  "channelId": "slack",
  "from": {
    "id": "U1KSC3SEM:T1KS69V8F",
    "name": "admin"
  },
  "conversation": {
    "isGroup": false,
    "id": "B1KSCS94Z:T1KS69V8F:D1KRYTP5L"
  },
  "recipient": {
    "id": "B1KSCS94Z:T1KS69V8F",
    "name": "platformservice"
  },
  "text": "test",
  "attachments": [],
  "entities": [],
  "channelData": {
    "SlackMessage": {
      "type": "message",
      "channel": "D1KRYTP5L",
      "user": "U1KSC3SEM",
      "text": "gfh",
      "ts": "1468257994.000362",
      "team": "T1KS69V8F"
    }
  }
}

Thegaram avatar Jul 11 '16 17:07 Thegaram

we have a fix for this which should be available by end of day.

tomlm avatar Jul 11 '16 20:07 tomlm

@tomlm Great news! I'm still getting Unauthorized on the Skype channel though. Should I open a separate issue for that?

UPDATE

Nevermind, I removed Skype from my bot's channels and readded it, that solved the issue. (There seems to be a problem with auto-configuring existing Skype channels upon upgrade to V3.) I can close this issue once Slack works.

Thegaram avatar Jul 12 '16 01:07 Thegaram

Hi, I'm getting an error in slack. the line in question is
await connector.Conversations.ReplyToActivityAsync(reply);

dimak72 avatar Jul 13 '16 16:07 dimak72

The problem seems to have been resolved, Slack works fine for me now. I'm closing the issue.

Thegaram avatar Jul 14 '16 00:07 Thegaram

Slack started working automatically or you have to create a new slack bot? I'm still facing this issue.

gosha1 avatar Jul 14 '16 05:07 gosha1

@gosha1 yeah automatically. Are you still getting the deserialization exception? Maybe try removing and readding Slack on your bot page. (Sorry, I have no better idea.)

Thegaram avatar Jul 14 '16 05:07 Thegaram