Adaptivecards: AdaptiveCard on Slack: Image with no content

Created on 24 Nov 2017  路  12Comments  路  Source: microsoft/AdaptiveCards

Version Bot: 3.8.1
Channels: Slack and Web

Issue Description

We are using AdaptiveCards. Until last week we have this working in both channels, even in slack the adptive card appear as an image while web mode appears in text (as it is supposed to be).

Since this week, slack adptive card is not working, whenever we make a request to show the card it appears the space of the image, the image exists but no content.

This is 2 image examples:
https://bcattachmentsprod.blob.core.windows.net/at13023/BiQrsQYenEx-original
https://slack-imgs.com/?c=1&url=https://bcattachmentsprod.blob.core.windows.net/at13023/JTJAU9ye6Q7-original

This works on web channel, the content is correct,

Code Example

//FactSet
string title = $"{TicketNumber} - {Title}";

List lstFacts = new List()
{
new AdaptiveCards.Fact("Ticket Nr", TicketNumber),
new AdaptiveCards.Fact("Team", ResponsibleTeam),
new AdaptiveCards.Fact("Status", Status),
};

List listaCards = new List()
{
UX.AdCards.ContainerFactSet.CreateFactSetWithTitle(ticket.Title, TextColor.Attention, lstFacts),
UX.AdCards.ContainerDescription.CreateDescription("Description", InitialDescription),
};

List listAction = new List();
OpenUrlAction o = new OpenUrlAction()
{
Title = "Show",
Url = ticket.GetLink()
};
listAction.Add(o);

var card = new AdaptiveCard()
{
Body = listaCards,
Actions = listAction,
Title = title
};

//Attachements
Attachment attachment = new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Content = card
};

var reply = context.MakeMessage();
reply.Attachments.Add(attachment);

return reply;

public static Container CreateDescription(string title, string description, int maxDescriptionSize = 256000, bool removeHTMLImages = true)
{
//remove images if some appears in text
string descriptionAux = description;
if (removeHTMLImages)
{
Regex regex = new Regex(@"");
descriptionAux = regex.Replace(descriptionAux, "##Removed Image##");
}

int val = System.Text.ASCIIEncoding.Unicode.GetByteCount(descriptionAux);

if (val > maxDescriptionSize)
{
    descriptionAux = new string(descriptionAux.Take(100).ToArray()) + "... [Texto removido devido ao extenso tamanho]";
}


var converter = new ReverseMarkdown.Converter();
description = converter.Convert(descriptionAux);

Container container = new Container();
if (!string.IsNullOrEmpty(description))
{
    container.Items = new List<CardElement>()
    {
                new TextBlock()
                {
                    Color = TextColor.Dark,
                    Weight = TextWeight.Bolder,
                    Text = title,
                    Wrap = true
                },
                new TextBlock()
                {
                    Color = TextColor.Default,
                    Weight = TextWeight.Lighter,
                    Text = description,
                    Wrap = true
                }
    };
}
return container;

}

Reproduction Steps

1.Go to slack
2.Request to show a card

Expected Behavior

Appears the card.
Slack: Show card (as an image for now, if possible should appear as text, but not full support yet by microsoft)
Web: Show card

Actual Results

The image on Slack appears with no content, full transparent.

UPDATE

I'm receiving the below error in appinsights, and it seems to be related to my issue:

POST to XXX_ASH failed: POST to the bot's endpoint failed with HTTP status 500POST to the bot's endpoint failed with HTTP status 500

Microsoft.Bot.Schema.BotException:
   at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__29.MoveNext (Microsoft.Bot.ChannelConnector, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null: d:\a\1\s\ChannelSDK\Microsoft.Bot.ChannelConnector\API\BotAPI.cs: 312)
Inner exception System.Exception handled at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__29.MoveNext:
   at Microsoft.Bot.ChannelConnector.BotAPI+<PostActivityToBotAsync>d__29.MoveNext (Microsoft.Bot.ChannelConnector, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null: d:\a\1\s\ChannelSDK\Microsoft.Bot.ChannelConnector\API\BotAPI.cs: 308)

assembly | Microsoft.Bot.ChannelConnector, Version=3.2.0.0, Culture=neutral, PublicKeyToken=null
-- | --
聽 method | Microsoft.Bot.ChannelConnector.BotAPI+d__29.MoveNext
聽 level | 0
聽 line | 312
聽 fileName | d:a1\s\ChannelSDK\Microsoft.Bot.ChannelConnector\API\BotAPI.cs

Most helpful comment

Hi folks, we've patched all of the servers and this should be working as expected now. Please re-open if you're see any issues. We apologize for any downtime this has caused you!

All 12 comments

I've responded to the duplicate post on the BotBuilder repo: https://github.com/Microsoft/BotBuilder/issues/3823

So I've done a lot of digging here and I think I found what's going on:
https://support.microsoft.com/en-us/help/4043601/rendering-issues-after-the-september-12-2017-net-security-and-quality

A September security rollout broke the scenario of using WPF in a service, which is why we're seeing blank images on occasion.

There are 4 October patches that should fix the issue but we'll have to wait for azure to roll them out. The problem should then resolve itself and the image rendering service will continue working as expected.

I'll keep you posted as we learn more. Sorry about the troubles!

@matthidinger Was so issue solved meanwhile? It seems to be back now.

Using Bot Builder and Bot Connector packages v3.12.2.4 and AdaptiveCards package v1.0.0-beta10. Was working a couple of days ago with Bot Builder, Bot Connector v3.11 and AdaptiveCards v1.0.0-beta8.

I can confirm it's back, in node.js

We're still managing the rollout and patching, so you may continue to see sporadic failures. Will keep this thread posted as I learn more

Thanks @matthidinger. This is affecting one of bots soon to go live and it started to happen today and it was kind of a surprise until we found this thread. We will keep an eye on this post

This is happening to me as well. AdaptiveCards are rendered as an empty image in facebook messenger.
I'm using BotFramework for .NET.

@matthidinger do you have an ETA on this?

When will this solve the problem?
I am currently using an adaptive card, but I can not solve it.

I have changed botbuilder 3.12.2.4, adaptivecard 1.0.0-beta10 due to a problem with botbuilder 3.8.1, adaptivecard 0.5.1, but there is still a problem.

Skype works normally, but facebook does not work.

It seems this is working again. @matthidinger can you confirm?

Hi folks, we've patched all of the servers and this should be working as expected now. Please re-open if you're see any issues. We apologize for any downtime this has caused you!

Sorry, I have to reopen. #1038

Was this page helpful?
0 / 5 - 0 ratings