Hi,
My bot works in an instance in Azure, but when i tried to upload it to another instance, it stopped responding. Am getting the following exception.
Because of this we got rejected from Bot framework.
@willportnoy Please help.
{
"message": "An error has occurred.",
"exceptionMessage": "Multiple custom attributes of the same type found.",
"exceptionType": "System.Reflection.AmbiguousMatchException",
"stackTrace": " at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)\r\n at Microsoft.Rest.ServiceClient`1.get_FrameworkVersion()\r\n at Microsoft.Rest.ServiceClient`1.SetDefaultUserAgentInfo()\r\n at Microsoft.Rest.ServiceClient`1.SetUserAgent(String productName, String version)\r\n at Microsoft.Rest.ServiceClient`1.InitializeHttpClient(HttpClientHandler httpClientHandler, DelegatingHandler[] handlers)\r\n at Microsoft.Bot.Connector.ConnectorClient..ctor(Uri baseUri, DelegatingHandler[] handlers)\r\n at Microsoft.Bot.Connector.ConnectorClient..ctor(Uri baseUri, String microsoftAppId, String microsoftAppPassword, DelegatingHandler[] handlers)\r\n at HoroscopeBot.MessagesController.<Post>d__1.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.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.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.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.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.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Web.Http.Filters.ActionFilterAttribute.<CallOnActionExecutedAsync>d__5.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.Filters.ActionFilterAttribute.<ExecuteActionFilterAsyncCore>d__0.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.Controllers.ActionFilterResult.<ExecuteAsync>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.<SendAsync>d__1.MoveNext()"
}
@smich73 is this something you have seen before?
@alokraj68 any chance you are using multiple BotAuthentication attributes?
@willportnoy No am not. I checked that, ran to this issue multiple times.
Only fix i found is delete the azure instance and create a new one.
@alokraj68 I get axactly same exception. Did it works when you just re-publish ? or you have to recreate entirely instance ?
@Raphhhhh Recreate entirely a new Instance and app plan is what i did.
@Raphhhhh is it on the line where you connect the connector to serviceurl?
@alokraj68 I got this exception
Exception type : System.Reflection.AmbiguousMatchException
…
Failed method : Autofac.RegistrationExtensions+<>c__DisplayClass5_0`1.
then when I look the exception message i get a big one :
An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IPostToBot (DelegateActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.IPostToBot], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DialogTaskManagerBotDataLoader (DelegateActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.IBotData], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = JObjectBotData (ReflectionActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.JObjectBotData], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = CachingBotDataStore (DelegateActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.IBotDataStore1[[Microsoft.Bot.Connector.BotData, Microsoft.Bot.Connector, Version=3.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.Bot.Builder.Dialogs.Internals.CachingBotDataStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ConnectorStore (ReflectionActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.ConnectorStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IStateClient (DelegateActivator), Services = [Microsoft.Bot.Connector.IStateClient], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Multiple custom attributes of the same type found. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.)An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = DialogTaskManagerBotDataLoader (DelegateActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.IBotData], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = JObjectBotData (ReflectionActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.JObjectBotData], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = CachingBotDataStore (DelegateActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.IBotDataStore1[[Microsoft.Bot.Connector.BotData, Microsoft.Bot.Connector, Version=3.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.Bot.Builder.Dialogs.Internals.CachingBotDataStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ConnectorStore (ReflectionActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.ConnectorStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IStateClient (DelegateActivator), Services = [Microsoft.Bot.Connector.IStateClient], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Multiple custom attributes of the same type found. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.)An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = JObjectBotData (ReflectionActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.JObjectBotData], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = CachingBotDataStore (DelegateActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.IBotDataStore1[[Microsoft.Bot.Connector.BotData, Microsoft.Bot.Connector, Version=3.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.Bot.Builder.Dialogs.Internals.CachingBotDataStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ConnectorStore (ReflectionActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.ConnectorStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IStateClient (DelegateActivator), Services = [Microsoft.Bot.Connector.IStateClient], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Multiple custom attributes of the same type found. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.) (See inner exception for details.)An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = CachingBotDataStore (DelegateActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.IBotDataStore1[[Microsoft.Bot.Connector.BotData, Microsoft.Bot.Connector, Version=3.3.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]], Microsoft.Bot.Builder.Dialogs.Internals.CachingBotDataStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ConnectorStore (ReflectionActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.ConnectorStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IStateClient (DelegateActivator), Services = [Microsoft.Bot.Connector.IStateClient], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Multiple custom attributes of the same type found. (See inner exception for details.) (See inner exception for details.) (See inner exception for details.)An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = ConnectorStore (ReflectionActivator), Services = [Microsoft.Bot.Builder.Dialogs.Internals.ConnectorStore], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IStateClient (DelegateActivator), Services = [Microsoft.Bot.Connector.IStateClient], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Multiple custom attributes of the same type found. (See inner exception for details.) (See inner exception for details.)An error occurred during the activation of a particular registration. See the inner exception for details. Registration: Activator = IStateClient (DelegateActivator), Services = [Microsoft.Bot.Connector.IStateClient], Lifetime = Autofac.Core.Lifetime.CurrentScopeLifetime, Sharing = Shared, Ownership = OwnedByLifetimeScope ---> Multiple custom attributes of the same type found. (See inner exception for details.)Multiple custom attributes of the same type found.
This is when I call my dialog await Conversation.SendAsync(activity, () => dialog); .
Btw, I tried to delete and create a new appservice, nothing changes for me...
Please refer here. I have put a detailed guideline.
@Raphhhhh am looking on your issue
@Raphhhhh do you have the problem to run the bot in emulator?
@alokraj68 I don't use emulator cause I use directline, so everything works with directline+ngrock in local
@Raphhhhh i used with emulator and it was working fine for me. I use the AutoFac version 4.2.0
when i uploaded to azure all the trouble started.
did you try deleting your instance and app plan?
some where i read this issue is with azure.
@alokraj68 I use Autofac 4.2.0 too, but when I delete all then re create with a new name, I get the same exceptions.
I'm trying some remote debugging right now...
@Raphhhhh Okays, i had this issue for a day. no one is able to tell why until now. i suspect its with azure instances as it worked for me in an old instance.
and Between, my name is not Aleksion :(
ahah it begins with same letter sorry @alokraj68 :)
@raphhhh please post if you get another solution. Happy debugging.
@alokraj68 Ok your fix worked. I had other problems due to my config files, but that's alright now. Thanks !
@Raphhhhh That's Great to know! Hope anyone from Microsoft will tell us why its happening. :D
Sounds like the issue was resolved. If not, please let us know.
The issue is not resolved as no one could figure out what went wrong. seems like an issue with azure. please check it.
I am having the same problem and figured out that adding the following line of code to my bot application is one way to recreate this error:
ConnectorClient connector = new ConnectorClient(new Uri(activity.ServiceUrl));
It is very frustrating, especially because a fully functional version stopped to work overnight, and since then I am trying the find the cause of this error.
The code and method names from the original call stack doesn't match the version of Microsoft.Rest.ClientRuntime I have in my enlistment (2.3.2).
But it looks like this is the issue, though: https://github.com/Azure/autorest/issues/1542
Can you check your version of the Microsoft.Rest.ClientRuntime?
@willportnoy, this was indeed the case. Thank you! I think adding Application Insights to my project upgraded my Microsoft.Rest.ClientRuntime to 2.3.4 which broke the bot. To fix it, I stripped every AI reference and downgraded to the ClientRuntime to 2.3.2.
It looks like the AI installation caused my problems. To avoid this in the future, is there any dependency lists that people can look up before upgrading at this point?
However, I deployed the same project to a new instance as suggested by @alokraj68 above, and it worked as well. So it is very ambiguous to me what exactly caused the issue. One the one hand the same project runs on one but not the other Azure instance. On the other hand, I downgraded the ClientRuntime and it worked again as well.
At an azure git i saw them asking to do this in order to get over the
issue. They say its with the azure instance. I feel the instance has to do
something, may be its nit clearing all files when we upgrade and upload the
files to 2.3.4.
On 01-Dec-2016 5:44 AM, "embee8" notifications@github.com wrote:
@willportnoy https://github.com/willportnoy, this was indeed the case.
Thank you! I think adding Application Insights to my project upgraded my
Microsoft.Rest.ClientRuntime to 2.3.4 which broke the bot. To fix it, I
stripped every AI reference and downgraded to the ClientRuntime to 2.3.2.It looks like the AI installation caused my problems. To avoid this in the
future, is there any dependency lists that people can look up before
upgrading at this point?However, I deployed the same project to a new instance as suggested by
@alokraj68 https://github.com/alokraj68 above, and it worked as well.
So it is very ambiguous to me what exactly caused the issue. One the one
hand the same project runs on one but not the other Azure instance. On the
other hand, I downgraded the ClientRuntime and it worked again as well.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/Microsoft/BotBuilder/issues/1600#issuecomment-264038924,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AIyDm_gU-HlYUXAYf7Fh_kxP3BuwgH0-ks5rDhFOgaJpZM4KsBNk
.
That might be the case, @alokraj68. I will run some tests and clear out all files via FTP before deploying the project. I will post any new insights here. Would be great to exactly know what this is caused by. I don't want to work around the problem by deploying it to a new instance all the time.
@embee8 please let us know if you could find the root cause
I'm going this issue for now (due to age, and we have a possible explanation above), but feel free to open a new issue for further discussion.
We are seeing the same exception. The same project works in one instance of Azure and it does not work in another instance.
Exception: System.Reflection.AmbiguousMatchException: Multiple custom attributes of the same type found.
at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
at Microsoft.Rest.ServiceClient1.get_FrameworkVersion()
at Microsoft.Rest.ServiceClient1.SetDefaultAgentInfo()
at Microsoft.Rest.ServiceClient`1.InitializeHttpClient(HttpClient httpClient, HttpClientHandler httpClientHandler, DelegatingHandler[] handlers)
at Microsoft.Bot.Connector.ConnectorClient..ctor(Uri baseUri, DelegatingHandler[] handlers)
at Microsoft.Bot.Connector.ConnectorClient..ctor(Uri baseUri, String microsoftAppId, String microsoftAppPassword, DelegatingHandler[] handlers)
Has there been any resolution identified for this issue?
We are seeing the same exception. The same project works in one instance of Azure and it does not work in another instance.
Exception: System.Reflection.AmbiguousMatchException: Multiple custom attributes of the same type found.
at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
at Microsoft.Rest.ServiceClient1.get_FrameworkVersion() at Microsoft.Rest.ServiceClient1.SetDefaultAgentInfo()
at Microsoft.Rest.ServiceClient`1.InitializeHttpClient(HttpClient httpClient, HttpClientHandler httpClientHandler, DelegatingHandler[] handlers)
at Microsoft.Bot.Connector.ConnectorClient..ctor(Uri baseUri, DelegatingHandler[] handlers)
at Microsoft.Bot.Connector.ConnectorClient..ctor(Uri baseUri, String microsoftAppId, String microsoftAppPassword, DelegatingHandler[] handlers)Has there been any resolution identified for this issue?
Hi, @prm113 this issue was there in v3 of the chatbot. I hope you are using v4 right now. It will be great to post this question in V4 repo since most people here are not associated with V4.
Most helpful comment
The code and method names from the original call stack doesn't match the version of Microsoft.Rest.ClientRuntime I have in my enlistment (2.3.2).
But it looks like this is the issue, though: https://github.com/Azure/autorest/issues/1542
Can you check your version of the Microsoft.Rest.ClientRuntime?