Skip to content
This repository was archived by the owner on Oct 3, 2026. It is now read-only.
This repository was archived by the owner on Oct 3, 2026. It is now read-only.

Global.CloudStorage.SaveStorage() throw Serialization Exception #330

Open

Description

@sunkararp

Hi Grapheengine team,

I’m getting Serialization Exception when I call Global.CloudStorage.SaveStorage() methid,
Any Idea how to fix this?

System.Runtime.Serialization.SerializationException
HResult=0x8013150C
Message=Type 'System.ValueTuple2[[Trinity.DynamicCluster.Storage.ReplicaInformation, Trinity.DynamicCluster, Version=2.0.10792.0, Culture=neutral, PublicKeyToken=null],[Trinity.DynamicCluster.PersistedSlice, Trinity.DynamicCluster, Version=2.0.10792.0, Culture=neutral, PublicKeyToken=null]]' in Assembly 'System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' is not marked as serializable. Source=mscorlib StackTrace: at System.Runtime.Serialization.FormatterServices.InternalGetSerializableMembers(RuntimeType type) at System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey key, Func`2 valueFactory)
at System.Runtime.Serialization.FormatterServices.GetSerializableMembers(Type type, StreamingContext context)
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitMemberInfo()
at System.Runtime.Serialization.Formatters.Binary.WriteObjectInfo.InitSerialize(Type objectType, ISurrogateSelector surrogateSelector, StreamingContext context, SerObjectInfoInit serObjectInfoInit, IFormatterConverter converter, SerializationBinder binder)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.WriteArray(WriteObjectInfo objectInfo, NameInfo memberNameInfo, WriteObjectInfo memberObjectInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Write(WriteObjectInfo objectInfo, NameInfo memberNameInfo, NameInfo typeNameInfo)
at System.Runtime.Serialization.Formatters.Binary.ObjectWriter.Serialize(Object graph, Header[] inHeaders, __BinaryWriter serWriter, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph, Header[] headers, Boolean fCheck)
at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Serialize(Stream serializationStream, Object graph)
at Trinity.DynamicCluster.Utils.Serialize[T](T payload) in C:\Research\GraphEngine\src\Modules\GraphEngine.DynamicCluster\Trinity.DynamicCluster\Utils.cs:line 162
at Trinity.ServiceFabric.Infrastructure.Interfaces.ReliableTaskQueue.<>c__DisplayClass13_0.<b__0>d.MoveNext()

This exception was originally thrown at this call stack:
[External Code]
Trinity.DynamicCluster.Utils.Serialize(T) in Utils.cs
[External Code]

Activity

  1. TaviTruman commented on Jan 14, 2021

    @TaviTruman
    Contributor

    sunkararp please post the offending code here so that I can assist your further.

  2. sunkararp commented on Jan 15, 2021

    @sunkararp
    Author

    My code is very simple, Service Fabric satefull remoting service & client
    My code is here https://github.com/sunkararp/Ayushman.KgApplication.

    Exception is happening when client calls Global.CloudStorage.SaveStorage() method at ln@231 of file https://github.com/sunkararp/Ayushman.KgApplication/blob/main/Ayushamn.KgClient/GraphEngineRemotingClient.cs

    the client, calls protocol methods before calling Global.CloudStorage.SaveStorage()
    the service, protocol me saves the data Global.LocalStorage.SaveStorage

  3. TaviTruman commented on Jan 15, 2021

    @TaviTruman
    Contributor

    sunkararp you've done too much unnecessary work here. Firstly, you must use the graph data model generated via TSL; I do not see any TSL in your project. The Graph Engine TSL compiler will generate especially generated typed C# files for you. This is one of the very powerful aspects of the Graph Engine; the graph data model is codegen for you. You willl need to use those generated classes. It does not seem like you've read the documentation - you must do that and take a look at the Sample Graph Service Fabric project.

  4. sunkararp commented on Jan 15, 2021

    @sunkararp
    Author

    On server side, I'm using TSL generated code to write memory (like Global.LocalStorage.SavePatientNode(cell))
    Please see my code https://github.com/sunkararp/Ayushman.KgApplication/tree/main/Ayushman.KgProtocols

  5. TaviTruman commented on Jan 15, 2021

    @TaviTruman
    Contributor

    sunkararp Yikes - I did not see that - my bad. Are you using those same generated files in your remoting client?

  6. sunkararp commented on Jan 15, 2021

    @sunkararp
    Author

    Yes, client does following...

    • Create TSL generated object
    • Set all the properties
    • Call the protocol method

    ` var organization = new OrganizationT();
    organization.Id = o.Id;
    organization.Name = o.NAME;
    organization.Revenue = o.REVENUE;
    organization.Phone = o.PHONE;
    organization.Utilization = o.UTILIZATION;

                using var cell = new AddOrganizationRequestWriter(organization);
                using var res2 = m_trinity.AddOrganization(cell);`
    
  7. TaviTruman commented on Jan 15, 2021

    @TaviTruman
    Contributor

    sunkararp Just a moment - I am testing your project.

  8. TaviTruman commented on Jan 15, 2021

    @TaviTruman
    Contributor

    sunkararp Just a moment - you are running a back release of the Graph Engine Library.

  9. sunkararp commented on Jan 15, 2021

    @sunkararp
    Author

    I didn't understand your question.
    Below is what I did...

    • I cloned GraphEngine repo
    • Compiled locally, Windows10 & VS2019
    • In my application, used the locally generated Nugets
  10. TaviTruman commented on Jan 15, 2021

    @TaviTruman
    Contributor

    sunkararp no worries - I have made many updates to my local repro and so my local build is ahead of yours. I just need to get to one of my dev machines with that build on it.

  11. sunkararp commented on Jan 15, 2021

    @sunkararp
    Author

    Just uploaded Data files here

  12. TaviTruman commented on Jan 15, 2021

    @TaviTruman
    Contributor

    sunkararp Thanks!

  13. TaviTruman commented on Jan 15, 2021

    @TaviTruman
    Contributor

    sunkararp I'll have the fix for you shortly after I get other production matters resolved.

  14. TaviTruman commented on Jan 16, 2021

    @TaviTruman
    Contributor

    sunkararp I'm working on your code now and I will have an update for you shortly.

  15. TaviTruman commented on Jan 20, 2021

    @TaviTruman
    Contributor

    sunkararp found the problem! I'm updating your project with corrections. I'll come back here when I the VS solution ready.

  16. sunkararp commented on Jan 20, 2021

    @sunkararp
    Author

    Thank you so much for the help,
    can you share your email ID, I have few more questions.
    My email ID is porscheme@live.com

  17. sunkararp commented on Jan 24, 2021

    @sunkararp
    Author

    Any luck here?

  18. TaviTruman commented on Jan 24, 2021

    @TaviTruman
    Contributor

    sunkararp I will post the fix tomorrow. I've been very busy with pushing out a new release.

  19. sunkararp commented on Oct 16, 2021

    @sunkararp
    Author

    Any update here?

  20. TaviTruman commented on Oct 16, 2021

    @TaviTruman
    Contributor

    sunkararp The current implementation for GE to run in Service Fabric major rework of the runtime must take place. After much review with Microsoft Service Fabric team and an outside third party it has been determined by the current tcp/ip stack is not compatible with SF due to the advanced use of duplex sockets. However, I have reworked the part of the networking stack so that it's compatible with SF. The scheduled release of the build will not be ready until the December / January timeframe. Also as I'm not able to update the Microsoft Graph Engine github repo current at this time and new versions of the GE will appear at my InKnowWorks GraphEngine repo. You can find updated Nuget packages there with support for. Net 3.1,. Net 5 and 6. We are very actively working on the Graph Engine so that an modernized and updated version is available. I'll post an updated Readme file today sighting updates, and schedule availability and road map.

  21. TaviTruman commented on Aug 18, 2022

    @TaviTruman
    Contributor

    sunkararp I have been working on the GE/SF implementation in the background and finally have more time to address this problem. I hope to have a fix in place next week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions