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

Facebook and Web chat do not work - V3 #648

Closed
shloak opened this issue Jul 11, 2016 · 20 comments
Closed

Facebook and Web chat do not work - V3 #648

shloak opened this issue Jul 11, 2016 · 20 comments
Assignees

Comments

@shloak
Copy link

shloak commented Jul 11, 2016

After migrating to V3 and changing settings in bot framework portal, Facebook and webchat are not working. When I test connection on the portal, it says the endpoint authorization succeeded and my c# code works on my local machine through the emulator. However, Facebook messenger, which was working with V1, now gives the error "sorry, bot name is having a problem responding right now", and web chat does not return a response. I am using an Azure web app to host the bot.

@alex182
Copy link

alex182 commented Jul 11, 2016

I am having the same issue (C#, V3).

Facebook, Groupme, and Telegram webchats return "sorry, bot name is having a problem responding right now".

While Kik, Twilio, Skype, and Slack do not return a response.

When I test my bot connection on dev.botframework.com I get a response of "accepted"

When ran using the local emulator it works fine if I leave MicrosoftAppId and MicrosoftAppPassword blank in the web.config file.

I've attempted to follow this guide but the Emulator does not have a field for the botID.

@rmatosaw
Copy link

Same for me. It is related to some kind of permission. This error occurs when answering messages:

System.UnauthorizedAccessException: Security token for MicrosoftAppId: xxxxxxx is unauthorized to post to connector!
at Microsoft.Bot.Connector.JwtTokenRefresher.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Connector.Conversations.d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Bot.Connector.ConversationsExtensions.d__15.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
at N.OC.Bot._3.MessagesController.d__0.MoveNext()

@msft-shahins
Copy link
Contributor

@alex182 and @rmatosaw can you try with the updated version of nuget v3.0.1 and see if it solves the problem? We had a bug in the MicrosoftAppCredentials implementation that should be fixed in the new package.

@Stevenic Stevenic added the bug Indicates an unexpected problem or an unintended behavior. label Jul 12, 2016
@rmatosaw
Copy link

Hi. Thanks for the tip.
After upgrade, I have a different problem, about references as mentioned in the other post:

InternalServerError
{
"message": "An error has occurred.",
"exceptionMessage": "Could not load type 'System.IdentityModel.Tokens.TokenValidationParameters' from assembly 'System.IdentityModel.Tokens.Jwt, Version=5.0.0.127, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.",
"exceptionType": "System.TypeLoadException",
"stackTrace": " at Microsoft.Bot.Connector.BotAuthentication.d__16.MoveNext()\r\n at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine& stateMachine)\r\n at Microsoft.Bot.Connector.BotAuthentication.OnAuthorizationAsync(HttpActionContext actionContext, CancellationToken cancellationToken)\r\n at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"
}

Also, the upgrade is not easy, because the reference to Bot.Connector needs to be removed manually. I don't know if I did it right.

@msft-shahins
Copy link
Contributor

@rmatosaw how do you end up with this dependency: 'System.IdentityModel.Tokens.Jwt, Version=5.0.0.127, Culture=neutral, PublicKeyToken=31bf3856ad364e35'? Bot builder nuget is dependent on id="System.IdentityModel.Tokens.Jwt" version="4.0.2.206221351". Is it the case that you have another dependency that relies on a newer version of System.IdentityModel.Tokens.Jwt.

Also upgrade shouldn't be hard, just use nuget package manager to update the nuget and it automatically update all the dependencies.

@alexsorokoletov
Copy link
Contributor

3.0.1 made facebook work for me, node.js

@rmatosaw
Copy link

Removed all the references and added again, by nuget. After rewrite some references in web.config it worked!
Thanks a lot.
The only problem still occurring: in the bot site: error 500 for skype and alerts for all of the other channels.
Thanks

@0GiS0
Copy link

0GiS0 commented Jul 12, 2016

Hi folks,

I've updated to 3.0.1 for Node.JS but Webchat doesn't work (no answer). Skype and Telegram work fine.

Thanks,

@alex182
Copy link

alex182 commented Jul 12, 2016

@msft-shahins that did it. thanks for the quick response!

@msft-shahins
Copy link
Contributor

@rmatosaw can you elaborate on the issue that you are seeing? your bot works locally against emulator but it deosn't work with skype and other channels? what is your MicrosoftAppId?

@msft-shahins
Copy link
Contributor

@0GiS0 what is the MicrosoftAppId for your bot? Is Webchat still not working for your bot?

@msft-shahins msft-shahins removed the bug Indicates an unexpected problem or an unintended behavior. label Jul 12, 2016
@AmineI
Copy link

AmineI commented Jul 12, 2016

Same here, Facebook is now working but nothing new about WebChat : It understands and receive my message since I see logs in the Azure Web Console, but no messages are sent from the bot in the Webchat. The bot works locally with the emulator and with Facebook like I said 😄 . MicrosoftAppId : bb30223f-2e12-422f-bc7a-4f92d9388600
Hope it helps !

@wtam
Copy link

wtam commented Jul 13, 2016

I'm using nodejs and have the following error when try to configure the facebook messenger (note: I already using nuguet 3.0.1

Server Error in '/' Application.

The remote server returned an error: (400) Bad Request.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (400) Bad Request.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[WebException: The remote server returned an error: (400) Bad Request.]
Microsoft.WindowsAzure.Storage.Table.Protocol.TableOperationHttpResponseParsers.TableOperationPreProcess(TableResult result, TableOperation operation, HttpWebResponse resp, Exception ex) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Table\Protocol\TableOperationHttpResponseParsers.cs:53
Microsoft.WindowsAzure.Storage.Table.<>c__DisplayClass4.b__2(RESTCommand`1 cmd, HttpWebResponse resp, Exception ex, OperationContext ctx) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Table\TableOperation.cs:133
Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndGetResponse(IAsyncResult getResponseResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:299

[StorageException: The remote server returned an error: (400) Bad Request.]
Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync(IAsyncResult result) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Executor\Executor.cs:50
Microsoft.WindowsAzure.Storage.Table.CloudTable.EndExecute(IAsyncResult asyncResult) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Table\CloudTable.cs:95
Microsoft.WindowsAzure.Storage.Core.Util.<>c__DisplayClass11.<CreateCallback>b__0(IAsyncResult ar) in c:\Program Files (x86)\Jenkins\workspace\release_dotnet_master\Lib\ClassLibraryCommon\Core\Util\AsyncExtensions.cs:66 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 Intercom.Azure.Helpers.<OnEntityChanged>d__101.MoveNext() in C:\a\1\s\Utilities\Intercom.Storage.Helpers\CloudTableEntityExtensions.cs:245
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58
Intercom.Azure.Helpers.d__31.MoveNext() in C:\a\1\s\Utilities\Intercom.Storage.Helpers\CloudTableEntityExtensions.cs:71 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task) +11532712 FacebookChannel.Models.<AddClientCredentials>d__2.MoveNext() in C:\a\1\s\Channels\FacebookChannel\Models\CredentialManager.cs:97 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 Microsoft.Bot.ChannelSDK.<AddClient>d__21.MoveNext() in C:\a\1\s\Channels\IntercomChannelSDK\BaseDevController.cs:250 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +92 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +58 System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult) +97 System.Web.Mvc.Async.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult) +17 System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult) +32 System.Web.Mvc.Async.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d() +50 System.Web.Mvc.Async.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f() +225 System.Web.Mvc.Async.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult) +10 System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult) +34 System.Web.Mvc.Async.<>c__DisplayClass2b.<BeginInvokeAction>b__1c() +26 System.Web.Mvc.Async.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult) +100 System.Web.Mvc.Async.WrappedAsyncResult1.CallEndDelegate(IAsyncResult asyncResult) +10
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult) +27 System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState) +13 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +36 System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller) +12 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +22
System.Web.Mvc.Async.WrappedAsyncResultBase1.End() +49 System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +26 System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult) +10 System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +21 System.Web.Mvc.Async.WrappedAsyncVoid1.CallEndDelegate(IAsyncResult asyncResult) +29
System.Web.Mvc.Async.WrappedAsyncResultBase`1.End() +49
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +28
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +9
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion(IAsyncResult ar) +129

@0GiS0
Copy link

0GiS0 commented Jul 13, 2016

@msft-shahins mi MicrosoftAppId is d5f732f3-c3b0-4093-affc-1d320d4eae4c and still not working. But it happens with all my bots for the WebChat. My bots work well in Skype and Telegram.

Thanks

@msft-shahins
Copy link
Contributor

@AmineI and @0GiS0 we are tracking the issue with WebChat.

@wtam are you using node.js or c# (you mention both nuget and node.js in your question)? Can you attach the debugger and see when connector service is returning 400?

@dandriscoll
Copy link
Member

I've got two bugfixes and some additional tracing in place in the WebChat service now. Can you try again with the same app ID and let me know what the result is? Even if it fails, I'll have more data to get this working.

@wtam
Copy link

wtam commented Jul 14, 2016

I'm not sure how to attach the debugger as I use the bot channel web portal to configure. My appid 379a3e85-2a5b-4fa1-a1e7-45b6a9df278c and I just try again and still the same error. fyi the app work on skype

@AmineI
Copy link

AmineI commented Jul 14, 2016

Just tried again, it works here :) !
The chat user name is set to something random like "LJX9NYlUT6F", by the way.
-- It's a different issue, but, is there any way we could change that user name before launching the chat ?

@wtam
Copy link

wtam commented Jul 14, 2016

I'm very sorry for stupid mistake, I made mistake on my Facebook ID and after correcting it. It's working now. The fault is on myside but if the error return provide some friendly msg in future, it will help some of us to find out where goes wrong.

@dandriscoll
Copy link
Member

Hi everyone-
Many of the reports on this thread are about the C# version of the SDK. We've updated the C# Nuget package to include fixes for auth reliability, please take a look at 3.1.0. The Node version was updated roughly a week prior. Thanks
--Dan

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

No branches or pull requests

10 participants