2017-08-24 39 views
1

我的代碼後,我寫了使用機器人框架和路易斯簡單柯塔娜技能,部署它,一切運行良好。我柯塔娜技能展示InternalServerError更新Azure上

早些時候,我更新的代碼並上傳到Azure的,然後我得到這個InternalServerError柯塔娜時試圖推出的技能。然後我切換回前面的代碼,但仍然有相同的錯誤。

然而機器人框架門戶的聊天窗口正常工作與兩個版本。仿真器也可以正常工作。

任何人都可以幫忙嗎?提前致謝。

下面是詳細的錯誤信息。

{ 
    "error": { 
    "botId": "dumbot_carina", 
    "botRequest": { 
     "type": "message", 
     "id": "Dxu2FN06OUb", 
     "timestamp": "2017-08-24T10:11:57.8258747Z", 
     "serviceUrl": "https://CortanaBFChannelWestUS.azurewebsites.net/", 
     "channelId": "cortana", 
     "from": { 
     "id": "9057CB40B3D426035920CA7B7E2995332082556FE830F719B877D774D2790155" 
     }, 
     "conversation": { 
     "id": "46191e3e-57b6-48b2-b804-164d6afc3840" 
     }, 
     "recipient": { 
     "id": "dumbot_carina" 
     }, 
     "locale": "en-US", 
     "entities": [ 
     { 
      "type": "Intent", 
      "name": "Microsoft.Launch" 
     }, 
     { 
      "type": "DeviceInfo", 
      "supportsDisplay": "true" 
     } 
     ], 
     "channelData": { 
     "skillId": "abec8214-0a15-4e47-aa7a-37db6faf2cd3", 
     "skillProductId": "3c2f525c-1917-4f5f-8275-6173a37bb1ee", 
     "isDebug": true 
     } 
    }, 
    "error": "Bot service failed with status code: InternalServerError" 
    }, 
    "traceId": "0f0bb690-ee99-4c92-bf2e-067ff41dfa32" 
} 

回答

1

我發現這個問題,它的,因爲我的應用無法處理空消息,因此當我說「問dumbot東西」,將工作,但只有「問dumbot」將失敗。但是,因爲模擬器和聊天窗口不允許空消息,所以他們沒事。

這是known issues for Bot Framework Skills之一。

LuisDialog上技能啓動

當技術人員在不發聲(即「打開」,「向」)啓動失敗,則activity.Text值爲空。 當它傳遞給LuisDialog時,它會拋出一個錯誤。至 解決此問題,您可以覆蓋MessageRecieved方法並添加 空檢查,如下所示。

/// <summary> 
/// Need to override the LuisDialog.MessageReceived method so that we can detect when the user invokes the skill without 
/// specifying a phrase, for example: "Open Hotel Finder", or "Ask Hotel Finder". In these cases, the message received will be an empty string 
/// </summary> 
/// <param name="context"></param> 
/// <param name="item"></param> 
/// <returns></returns> 
protected override async Task MessageReceived(IDialogContext context, IAwaitable<IMessageActivity> item) 
{ 
    // Check for empty query 
    var message = await item; 
    if (string.isNullOrEmpty(message.Text)) 
    { 
     // Return the Help/Welcome 
     await Help(context, null); 
    } 
    else 
    { 
     await base.MessageReceived(context, item); 
    } 
} 
1

當我看着你的機器人在dev portal它顯示了這兩個網絡聊天和柯塔娜錯誤。這些錯誤是通用的,通常意味着問題出在你的機器人代碼上。所以在沒有看到你的代碼的情況下幫助你真的很難。您是否嘗試過在Emulator或使用ngrok進行調試?

enter image description here

+0

謝謝各位大大的建議,我會盡力的模擬器。 – dontloo

+0

喜在模擬器中工作正常了,但是還是我的柯塔娜是有問題開展技能:/ – dontloo

+0

啊,我發現這個問題,它是因爲我的應用程序無法處理空消息,因此當我說「問dumbot東西」它將工作,但只有「問dumbot」將失敗。 – dontloo