{"action":"created","issue":{"url":"https://api.github.com/repos/dotnet/orleans/issues/3260","repository_url":"https://api.github.com/repos/dotnet/orleans","labels_url":"https://api.github.com/repos/dotnet/orleans/issues/3260/labels{/name}","comments_url":"https://api.github.com/repos/dotnet/orleans/issues/3260/comments","events_url":"https://api.github.com/repos/dotnet/orleans/issues/3260/events","html_url":"https://github.com/dotnet/orleans/issues/3260","id":246053174,"number":3260,"title":"Client stream subscription failing to deserialise model","user":{"login":"chris-eaton","id":12051582,"avatar_url":"https://avatars1.githubusercontent.com/u/12051582?v=4","gravatar_id":"","url":"https://api.github.com/users/chris-eaton","html_url":"https://github.com/chris-eaton","followers_url":"https://api.github.com/users/chris-eaton/followers","following_url":"https://api.github.com/users/chris-eaton/following{/other_user}","gists_url":"https://api.github.com/users/chris-eaton/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-eaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-eaton/subscriptions","organizations_url":"https://api.github.com/users/chris-eaton/orgs","repos_url":"https://api.github.com/users/chris-eaton/repos","events_url":"https://api.github.com/users/chris-eaton/events{/privacy}","received_events_url":"https://api.github.com/users/chris-eaton/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars1.githubusercontent.com/u/203839?v=4","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false},"assignees":[{"login":"ReubenBond","id":203839,"avatar_url":"https://avatars1.githubusercontent.com/u/203839?v=4","gravatar_id":"","url":"https://api.github.com/users/ReubenBond","html_url":"https://github.com/ReubenBond","followers_url":"https://api.github.com/users/ReubenBond/followers","following_url":"https://api.github.com/users/ReubenBond/following{/other_user}","gists_url":"https://api.github.com/users/ReubenBond/gists{/gist_id}","starred_url":"https://api.github.com/users/ReubenBond/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ReubenBond/subscriptions","organizations_url":"https://api.github.com/users/ReubenBond/orgs","repos_url":"https://api.github.com/users/ReubenBond/repos","events_url":"https://api.github.com/users/ReubenBond/events{/privacy}","received_events_url":"https://api.github.com/users/ReubenBond/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/dotnet/orleans/milestones/17","html_url":"https://github.com/dotnet/orleans/milestone/17","labels_url":"https://api.github.com/repos/dotnet/orleans/milestones/17/labels","id":2111063,"number":17,"title":"Triage","description":"","creator":{"login":"sergeybykov","id":8248806,"avatar_url":"https://avatars1.githubusercontent.com/u/8248806?v=4","gravatar_id":"","url":"https://api.github.com/users/sergeybykov","html_url":"https://github.com/sergeybykov","followers_url":"https://api.github.com/users/sergeybykov/followers","following_url":"https://api.github.com/users/sergeybykov/following{/other_user}","gists_url":"https://api.github.com/users/sergeybykov/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeybykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeybykov/subscriptions","organizations_url":"https://api.github.com/users/sergeybykov/orgs","repos_url":"https://api.github.com/users/sergeybykov/repos","events_url":"https://api.github.com/users/sergeybykov/events{/privacy}","received_events_url":"https://api.github.com/users/sergeybykov/received_events","type":"User","site_admin":false},"open_issues":30,"closed_issues":164,"state":"open","created_at":"2016-11-03T00:53:47Z","updated_at":"2017-08-02T01:08:26Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2017-07-27T14:11:41Z","updated_at":"2017-08-02T08:55:20Z","closed_at":null,"body":"**Note**\r\n\r\nThis may just be anecdotal, but I'm fairly sure this used to work [although I had only got it working in test / POC setups] and I feel like this only happened after I switched from using `GrainClient` to `ClientBuilder`...\r\n\r\n**Problem Description**\r\n\r\nI have a Silo and a Client that I am connecting to the Silo.  The client is very lightweight and simply connects to the Silo and then subscribes to a stream like so:\r\n\r\n```\r\nprivate async Task Subscribe()\r\n{\r\n    var streamProvider = this.grainClient.GetStreamProvider(\"SMSProvider\");\r\n    var stream = streamProvider.GetStream<Plot>(15304.ToGuid(), \"PlotDataStream\");\r\n\r\n    this.subscriptionHandle = await stream.SubscribeAsync(this.OnData);\r\n}\r\n\r\nprivate async Task OnData(Plot plot, StreamSequenceToken data)\r\n{\r\n    Console.WriteLine($\"New Plot {plot?.Imei}\");\r\n}\r\n```\r\n\r\nWhen data is sent to the stream I get this error message\r\n\r\n> StreamClientTest.exe Error: 0 : [2017-07-27 13:50:43.004 GMT     5\tERROR  \t101030\tMessage\t192.168.0.93:0]\t!!!!!!!!!! Exception deserializing message body\t\r\n> Exc level 0: System.TypeAccessException: Named type \"xxx.Common.Models.Plot\" is invalid: Type string \"xxx.Common.Models.Plot\" cannot be resolved.\r\n>    at Orleans.Serialization.BinaryTokenStreamReader.ReadSpecifiedTypeHeader(SerializationManager serializationManager)\r\n>    at Orleans.Serialization.SerializationManager.DeserializeInner(Type expected, IDeserializationContext context)\r\n>    at Orleans.Serialization.BuiltInTypes.DeserializeImmutable[T](Type expected, IDeserializationContext context)\r\n>    at Orleans.Serialization.SerializationManager.DeserializeInner(Type expected, IDeserializationContext context)\r\n>    at Orleans.Serialization.BuiltInTypes.DeserializeInvokeMethodRequest(Type expected, IDeserializationContext context)\r\n>    at Orleans.Serialization.SerializationManager.DeserializeInner(Type expected, IDeserializationContext context)\r\n>    at Orleans.Serialization.SerializationManager.Deserialize(Type t, BinaryTokenStreamReader stream)\r\n>    at Orleans.Runtime.Message.DeserializeBody(SerializationManager serializationManager, List`1 bytes)\r\n\r\nAll of the properties on `Plot` are primitive except for `DateTime`. When this didn't work I tried another simpler model `User` but this also failed in the same way.\r\n\r\nInterestingly if I subscribe to this stream from another grain within the Silo it works perfectly.  So it seems to only be an issue to a client application connecting in.\r\n\r\nIf it helps here is the package.config for the test stream client\r\n\r\n```\r\n<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<packages>\r\n  <package id=\"AutoMapper\" version=\"5.1.1\" targetFramework=\"net461\" />\r\n  <package id=\"CryptSharpOfficial\" version=\"2.1.0.0\" targetFramework=\"net461\" />\r\n  <package id=\"Desktop.Analyzers\" version=\"1.1.0\" targetFramework=\"net461\" />\r\n  <package id=\"EntityFramework\" version=\"6.1.3\" targetFramework=\"net461\" />\r\n  <package id=\"esendex-dotnet-sdk\" version=\"3.2.0.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.AnalyzerPowerPack\" version=\"1.0.1\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.CodeAnalysis.Analyzers\" version=\"1.1.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.CodeAnalysis.Common\" version=\"2.0.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.CodeAnalysis.CSharp\" version=\"2.0.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.CodeAnalysis.FxCopAnalyzers\" version=\"1.1.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.Extensions.DependencyInjection\" version=\"1.1.1\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.Extensions.DependencyInjection.Abstractions\" version=\"1.1.1\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.NETCore.Platforms\" version=\"1.1.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.Orleans.Client\" version=\"1.5.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.Orleans.Core\" version=\"1.5.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.Orleans.OrleansCodeGenerator\" version=\"1.5.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.Orleans.OrleansProviders\" version=\"1.5.0\" targetFramework=\"net461\" />\r\n  <package id=\"Microsoft.Win32.Primitives\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"NETStandard.Library\" version=\"1.6.1\" targetFramework=\"net461\" />\r\n  <package id=\"Newtonsoft.Json\" version=\"10.0.3\" targetFramework=\"net461\" />\r\n  <package id=\"RestSharp\" version=\"105.2.3\" targetFramework=\"net461\" />\r\n  <package id=\"System.AppContext\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Collections\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Collections.Concurrent\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Collections.Immutable\" version=\"1.3.1\" targetFramework=\"net461\" />\r\n  <package id=\"System.ComponentModel\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Console\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Diagnostics.Debug\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Diagnostics.DiagnosticSource\" version=\"4.3.1\" targetFramework=\"net461\" />\r\n  <package id=\"System.Diagnostics.FileVersionInfo\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Diagnostics.StackTrace\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Diagnostics.Tools\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Diagnostics.Tracing\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Dynamic.Runtime\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Globalization\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Globalization.Calendars\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.IO\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.IO.Compression\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.IO.Compression.ZipFile\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.IO.FileSystem\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.IO.FileSystem.Primitives\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Linq\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Linq.Expressions\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Net.Http\" version=\"4.3.2\" targetFramework=\"net461\" />\r\n  <package id=\"System.Net.Primitives\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Net.Sockets\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.ObjectModel\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Reflection\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Reflection.Extensions\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Reflection.Metadata\" version=\"1.4.2\" targetFramework=\"net461\" />\r\n  <package id=\"System.Reflection.Primitives\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Resources.ResourceManager\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Runtime\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Runtime.Analyzers\" version=\"1.0.1\" targetFramework=\"net461\" />\r\n  <package id=\"System.Runtime.Extensions\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Runtime.Handles\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Runtime.InteropServices\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Runtime.InteropServices.Analyzers\" version=\"1.0.1\" targetFramework=\"net461\" />\r\n  <package id=\"System.Runtime.InteropServices.RuntimeInformation\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Runtime.Numerics\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Security.Cryptography.Algorithms\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Security.Cryptography.Encoding\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Security.Cryptography.Hashing.Algorithms.Analyzers\" version=\"1.1.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Security.Cryptography.Primitives\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Security.Cryptography.X509Certificates\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Text.Encoding\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Text.Encoding.CodePages\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Text.Encoding.Extensions\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Text.RegularExpressions\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Threading\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Threading.Tasks\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Threading.Tasks.Parallel\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Threading.Thread\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Threading.Timer\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.ValueTuple\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Xml.ReaderWriter\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Xml.XDocument\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Xml.XmlDocument\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Xml.XPath\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"System.Xml.XPath.XDocument\" version=\"4.3.0\" targetFramework=\"net461\" />\r\n  <package id=\"Topshelf\" version=\"4.0.3\" targetFramework=\"net452\" />\r\n  <package id=\"xxx.Common\" version=\"1.17.208.2\" targetFramework=\"net461\" />\r\n  <package id=\"xxx.Data\" version=\"1.17.208.2\" targetFramework=\"net461\" />\r\n</packages>\r\n```"},"comment":{"url":"https://api.github.com/repos/dotnet/orleans/issues/comments/319611696","html_url":"https://github.com/dotnet/orleans/issues/3260#issuecomment-319611696","issue_url":"https://api.github.com/repos/dotnet/orleans/issues/3260","id":319611696,"user":{"login":"chris-eaton","id":12051582,"avatar_url":"https://avatars1.githubusercontent.com/u/12051582?v=4","gravatar_id":"","url":"https://api.github.com/users/chris-eaton","html_url":"https://github.com/chris-eaton","followers_url":"https://api.github.com/users/chris-eaton/followers","following_url":"https://api.github.com/users/chris-eaton/following{/other_user}","gists_url":"https://api.github.com/users/chris-eaton/gists{/gist_id}","starred_url":"https://api.github.com/users/chris-eaton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chris-eaton/subscriptions","organizations_url":"https://api.github.com/users/chris-eaton/orgs","repos_url":"https://api.github.com/users/chris-eaton/repos","events_url":"https://api.github.com/users/chris-eaton/events{/privacy}","received_events_url":"https://api.github.com/users/chris-eaton/received_events","type":"User","site_admin":false},"created_at":"2017-08-02T08:55:20Z","updated_at":"2017-08-02T08:55:20Z","body":"Hey @ReubenBond thats a good idea but unfortunately it doesnt work.\r\n\r\nInterestingly, I restarted it and out of nowhere got this error message in another client [one that sends Plots to Orleans].  Note that this client has worked without fail [and is working in production under the same code] for some time\r\n\r\n> Orleans.Runtime.OrleansMessageRejectionException: 'Unexpected error serializing message to gateway gwy.tcp://127.0.0.1:40000/0. System.ArgumentException: No serializer found for object of type xxx.Common.Models.Plot. Perhaps you need to mark it [Serializable] or define a custom serializer for it?\r\n> \r\n>    at Orleans.Serialization.SerializationManager.SerializeInner(Object obj, ISerializationContext context, Type expected)\r\n>    at Orleans.Serialization.BuiltInTypes.SerializeImmutable[T](Object original, ISerializationContext context, Type expected)\r\n>    at Orleans.Serialization.BuiltInTypes.SerializeGenericImmutable(Object original, ISerializationContext context, Type expected)\r\n>    at Orleans.Serialization.SerializationManager.SerializeInner(Object obj, ISerializationContext context, Type expected)\r\n>    at Orleans.Serialization.BuiltInTypes.SerializeInvokeMethodRequest(Object obj, ISerializationContext context, Type expected)\r\n>    at Orleans.Serialization.SerializationManager.SerializeInner(Object obj, ISerializationContext context, Type expected)\r\n>    at Orleans.Serialization.SerializationManager.Serialize(Object raw, BinaryTokenStreamWriter stream)\r\n>    at Orleans.Runtime.Message.Serialize(SerializationManager serializationManager, Int32& headerLengthOut, Int32& bodyLengthOut)\r\n>    at Orleans.Messaging.OutgoingMessageSender.Process(Message msg)'"}}
{"actor":{"display_login":"chris-eaton"}}