akkadotnet / akka.net

Canonical actor model implementation for .NET with local + distributed actors in C# and F#.
http://getakka.net
Other
4.7k stars 1.04k forks source link

Failed to write message to the transport Akka.Remote.EndpointException #3045

Closed vikingcodes closed 7 years ago

vikingcodes commented 7 years ago

Facing the following exception.

[ERROR][8/29/2017 9:08:52 AM][Thread 0016][remoting] Failed to write message to the transport Cause: Akka.Remote.EndpointException: Failed to write message to the transport - --> System.MissingMethodException: Method not found: 'Akka.Serialization.Seriali zer Akka.Serialization.Serialization.FindSerializerFor(System.Object)'. at Akka.Remote.MessageSerializer.Serialize(ActorSystem system, Address addres s, Object message)

Configuration in Lighthouse project

<hocon>
            <![CDATA[
                    lighthouse{
                            actorsystem: "webcrawler" #POPULATE NAME OF YOUR ACTOR SYSTEM HERE
                        }

                    akka {
                        actor { 
            serializers {
              hyperion = "Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion"
            }
            serialization-bindings {
              "System.Object" = hyperion
            }

                            provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"

                        }

                        remote {
                            log-remote-lifecycle-events = DEBUG
                            dot-netty.tcp {
                                transport-class = "Akka.Remote.Transport.DotNetty.TcpTransport, Akka.Remote"
                                applied-adapters = []
                                transport-protocol = tcp
                                #will be populated with a dynamic host-name at runtime if left uncommented
                                #public-hostname = "POPULATE STATIC IP HERE"
                                hostname = "0.0.0.0"
                                port = 4053
                            }
                        }            

                        loggers = ["Akka.Logger.NLog.NLogLogger,Akka.Logger.NLog"]

                        cluster {
                            #will inject this node as a self-seed node at run-time
                            seed-nodes = [] #manually populate other seed nodes here, i.e. "akka.tcp://lighthouse@127.0.0.1:4053", "akka.tcp://lighthouse@127.0.0.1:4044"
                            roles = [lighthouse]
                        }
                    } 
            ]]>
        </hocon>

A configuration in web scraper project.

<hocon>
      <![CDATA[
          akka {
            actor {
                serializers {
                      hyperion = "Akka.Serialization.HyperionSerializer, Akka.Serialization.Hyperion"
                }
                serialization-bindings {
                  "System.Object" = hyperion
                }
              provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
            }

            remote {
              log-remote-lifecycle-events = DEBUG
              log-received-messages = on

              dot-netty.tcp {
                transport-class = "Akka.Remote.Transport.DotNetty.TcpTransport, Akka.Remote"
                    applied-adapters = []
                    transport-protocol = tcp
                #will be populated with a dynamic host-name at runtime if left uncommented
                #public-hostname = "POPULATE STATIC IP HERE"
                hostname = "127.0.0.1"
                port = 0
                maximum-frame-size = 256000b
              }
            }            

            cluster {
              #will inject this node as a self-seed node at run-time
              seed-nodes = ["akka.tcp://webcrawler@127.0.0.1:4053"] #manually populate other seed nodes here, i.e. "akka.tcp://lighthouse@127.0.0.1:4053", "akka.tcp://lighthouse@127.0.0.1:4044"
              roles = [crawler]
            }
          }
      ]]>
    </hocon>
jannicklange commented 7 years ago

Hey!

In case you did not resolve this issue (or somebody struggles with the same problem): I stumbled upon a similiar error message when trying to start several workers on a Cluster.

It turned out that I somehow updated 'some' NuGet-packages to Akka.[SomeSubPackage].1.3.1 and some were still on Version 1.2.3. After resetting them to the last configuration that I knew was working (i.e. v1.2.3), the problem was gone.

Hope this helps!

Danthar commented 7 years ago

Without specifying which version of Akka is being used. Helping with this issue is impractical. Especially since in recent releases we solved many serialiser related issues. Im going to close this issue. @virenderkverma If you still have this problem after updating to the last akka.net version. And making sure your lighthouse instance is running on the same akka.net version as your worker nodes. Feel free to open it again.