Botframework-sdk: Direct Line API + Action Fulfillment in LUIS not working

Created on 30 Oct 2016  路  16Comments  路  Source: microsoft/botframework-sdk

I was normally using this setup (Direct Line API + Action Fulfillment in LUIS) until yesterday when it started to fail. I have a LUIS model configured with action fulfillment using the Definition Channel. Then I published this model using the option "Enable Action Binding using Microsoft Bot Framework", and registered a new bot in the bot framework portal to point to that model. Then yesterday, I started to receive errors when I post a message to the bot using the directline API. Next are the responses I get using different ways:

  • Using the REST interface provided in the documentation here, I'm able to create conversatons and retrieve messages but when I post a new message I get a Response Body
{
  "message": "Failed to send message: bot returned an error"
}

with a Response Code 500

  • When using the Direct Line Nuget package from CSharp code, I get
Microsoft.Rest.HttpOperationException occurred
  HResult=-2146233088
  Message=Operation returned an invalid status code 'InternalServerError'
  Source=Microsoft.Bot.Connector.DirectLine
  StackTrace:
       at Microsoft.Bot.Connector.DirectLine.Conversations.<PostMessageWithHttpMessagesAsync>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.DirectLine.ConversationsExtensions.<PostMessageAsync>d__5.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 Test.Directline.<GetDefinition>d__6.MoveNext() in C:\Test\Directline.cs:line 136
  InnerException:

Looking into Fiddler, I get the same error as in the REST interface.

  • If I configure the bot to get telemetry using an Application Insights key, I get
Exception type: System.Exception
ExceptionDetail: 
{ "Data": {},
 "Source": "Microsoft.Bot.ChannelConnector",
 "HResult": -2146233088
 }
StatusCode: BadRequest

Any idea of what might be happening? Thanks!

bug

All 16 comments

Hi @eydelrivero, I'm looking into the error. Thanks for reporting.

I'm not seeing widespread errors. Do you have a conversation ID I can take a closer look at?

Thanks @dandriscoll for the fast reply. Here is the conversation id LntGS0s5NPX.

The only data I can see is that the bot is returning a 400 error. There's no detail beyond that. Can you tell what the failure is in your bot? I'm interested to know if we made a change that inadvertently broke something.

Hi @dandriscoll , sorry for the delay. I'm not sure how to proceed to collect more info beyond what I posted before. That is all I can see. Can I share an app token so you can try it using the REST interface or send telemetry to an Application Insights instance on your control, or both? Thanks!

@dandriscoll more people seem to be getting 403 from the direct line api

https://github.com/Microsoft/BotBuilder/issues/1555

We have a fix for this deployed to all of our datacenters. Can you try again and report if you're seeing any problems?

Hi @dandriscoll , unfortunately I'm still getting the same errors. I've tested directly in the REST API interface and from C# code. I'm getting the same outcomes than before. Checking the Application Insights trace I can see the same exception:

System.Exception:
   at Microsoft.Bot.ChannelConnector.BotAPI+<PostMessageToAppAsync>d__18.MoveNext (Microsoft.Bot.ChannelConnector, Version=3.1.4.1, Culture=neutral, PublicKeyToken=null: C:\a\1\s\Microsoft.Bot.ChannelConnector\API\BotAPI.cs: 246)

You can see it by checking conversation id 5u1Rax62STp

Hi @eydelrivero, the errors for this conversation ID are being generated by the LUIS service. I'll take a closer look.

@dandriscoll can you please comment or close as appropriate?

Just checking in, we are still working with the LUIS team on this.

Hi @eydelrivero, the LUIS team tells me they've made a fix for this. Can you try again and let us know if it's working?

Closing issue as we've fixed known issues here. Please at-mention or open a new issue if you encounter further problems.

i m using direct line dll 1.0.2 and gettiog error when
await client.Conversations.PostMessageAsync(conversation.ConversationId, message); this line executes gives error
Message "Operation returned an invalid status code 'InternalServerError'" string

Hi @Rina1Patel, this usually means your bot is generating an error. Please open a new issue and include your bot ID if you want to discuss further.

For anyone who runs into the same issue: I was using DirectLine.dll 1.0.2 (as Rina1Patel) to connect to the Luis-Bot. InternalServerException. Then I updated the DirectLine Nuget Package to DirectLine 3.0.2 and that solved the issue. Note that the methods in DirectLine 3.0.2 have diffrent names, everything that was named "Message" before is now "Activity". There is an example project in the Microsoft BotBuilder-Samples called Core-DirectLine that you can use to copy from.

Was this page helpful?
0 / 5 - 0 ratings