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.)
http://docs.botframework.com/en-us/support/upgrade-code-to-v3/#navtitle , I guess you haven't done this.
@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.
Oh, okay then ! Which language are you working with ?
C#.
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."
The inner exception is {"Unexpected character encountered while parsing value: <. Path '', line 0, position 0."}
The web chat also seems to work too.
thegram what is your bot id?
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()
@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).
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 ---
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?
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.
@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"
}
}
}
we have a fix for this which should be available by end of day.
@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.
Hi, I'm getting an error in slack. the line in question is
await connector.Conversations.ReplyToActivityAsync(reply);
The problem seems to have been resolved, Slack works fine for me now. I'm closing the issue.
Slack started working automatically or you have to create a new slack bot? I'm still facing this issue.
@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.)
Thanks. :) Its working for me now. I had given my BotHandle value for BotId in web.config. When I changed it to the Name of the AppId created in the apps.dev.microsoft.com portal, Slack started working. Wondering how skype and web chat worked previously.
Thanks! Confirmed to be working.
Most helpful comment
we have a fix for this which should be available by end of day.