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

[.Net SDK, Skype] Send message from Skype bot with image attachment sometimes gives "Sorry, my bot code is having an issue"?

Open JonesAbramoff opened this issue 8 years ago • 6 comments

Bot Info

  • SDK Platform: .NET
  • SDK Version: bot builder 3.12.2.4
  • Active Channels: Skype, Telegram, Facebook Messenger
  • Deployment Environment: Azure Bot Service

Issue Description

Send message from Skype bot with image attachment not always working. The same code with the same image works ok in Facebook Messenger and Telegram bots.

Code Example

                        // Set the address-related properties in the message and send the message.
                        message.From = botAccount;
                        message.Recipient = userAccount;
                        message.Conversation = new ConversationAccount(id: objEntrada.IdConversa);
                        message.Text = "";
                        message.Locale = "pt-BR";
                        Attachment attachment = new Attachment();
                        attachment.ContentType = "image/jpg";
                        attachment.ContentUrl = objAux.URLFigura;
                        message.Attachments.Add(attachment);
                        await connector.Conversations.SendToConversationAsync((Activity)message);

Reproduction Steps

  1. It works ok with http://www.zapprices.com.br/img/7891058017507.jpg but with "https://www.drogarianovaesperanca.com.br/imagens-complete/400x400/00807587.jpg" shows to the user the following message "Sorry, my bot code is having an issue". Both URLs displays the image correctly in Google Chrome.

  2. By the way, where can I see the log of this error ? My bot was recently migrated to Azure and its message endpoint is https://botzapprices4.azurewebsites.net/api/messages

Expected Behavior

If loading the image is too slow or it is unavailable (404 or other) then the bot should show a pre-defined icon of problematic image and continue processing the messages.

Actual Results

I send 3 messages with the first one with the image attached and the result is that the first text is shown and "Sorry, my bot code is having an issue" and the other two message texts are lost.

JonesAbramoff avatar Jan 08 '18 14:01 JonesAbramoff

I'll look into this, but I think the issue may be that one of those URLs is https and the other is http.

JasonSowers avatar Jan 08 '18 17:01 JasonSowers

Hi,

I have tried with more https URLs and it worked.

Use the exact URLs I have sent to debug.

Test also with a non-existant URL and it will give the same error message.

Maybe increasing a timeout would be a workaround but it should handle better this case of not being able to display an image.

Where can I view a log of this error ?

Thanks,

Jones

From: Jason Sowers Sent: Monday, January 08, 2018 3:24 PM To: Microsoft/BotBuilder Cc: JonesAbramoff ; Author Subject: {Disarmed} Re: [Microsoft/BotBuilder] Send message from Skype bot with image attachment sometimes gives "Sorry, my bot code is having an issue" (#4009)

I'll look into this, but I think the issue may be that one of those URLs is https and the other is http.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

JonesAbramoff avatar Jan 08 '18 17:01 JonesAbramoff

could you please supply your app ID?

This could also be a timeout issue. if the request is not processed in 15 seconds this will cause this too. There is nowhere to reset the timeout interval at this time.

JasonSowers avatar Jan 08 '18 17:01 JasonSowers

364ac194-60b8-4959-88ba-6cef784e924b

The channels tab now show some errors of invalid content of the .jpg

From: Jason Sowers Sent: Monday, January 08, 2018 3:45 PM To: Microsoft/BotBuilder Cc: JonesAbramoff ; Author Subject: {Disarmed} Re: [Microsoft/BotBuilder] Send message from Skype bot with image attachment sometimes gives "Sorry, my bot code is having an issue" (#4009)

could you please supply your app ID?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

JonesAbramoff avatar Jan 08 '18 18:01 JonesAbramoff

But remember that the same URL works fine with FB Messenger and Telegram bots

From: Jones Abramoff Sent: Monday, January 08, 2018 4:14 PM To: Microsoft/BotBuilder ; Microsoft/BotBuilder Cc: Author Subject: Re: {Disarmed} Re: [Microsoft/BotBuilder] Send message from Skype bot with image attachment sometimes gives "Sorry, my bot code is having an issue" (#4009)

364ac194-60b8-4959-88ba-6cef784e924b

The channels tab now show some errors of invalid content of the .jpg

From: Jason Sowers Sent: Monday, January 08, 2018 3:45 PM To: Microsoft/BotBuilder Cc: JonesAbramoff ; Author Subject: {Disarmed} Re: [Microsoft/BotBuilder] Send message from Skype bot with image attachment sometimes gives "Sorry, my bot code is having an issue" (#4009)

could you please supply your app ID?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

JonesAbramoff avatar Jan 08 '18 18:01 JonesAbramoff

If you are still experiencing issues please open a new issue

JasonSowers avatar Jun 25 '18 18:06 JasonSowers