Skip to content

Init Actions crash when given an empty state #5

Open
@sleipnir

Description

@sleipnir

Describe the bug

Methods marked as initialization end up popping an error when the actor's state is empty.

io.eigr.spawn.api.exceptions.ActorInvocationException: com.google.protobuf.InvalidProtocolBufferException: Type of the Any message does not match the given class.
    at io.eigr.spawn.internal.transport.server.ActorServiceHandler.callAction(ActorServiceHandler.java:168)
    at io.eigr.spawn.internal.transport.server.ActorServiceHandler.handleRequest(ActorServiceHandler.java:86)
    at io.eigr.spawn.internal.transport.server.ActorServiceHandler.handle(ActorServiceHandler.java:64)
    at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:98)
    at jdk.httpserver/sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:82)
    at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:101)
    at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.java:871)
    at jdk.httpserver/com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:98)
    at jdk.httpserver/sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:847)
    at java.base/java.util.concurrent.ThreadPerTaskExecutor$TaskRunner.run(ThreadPerTaskExecutor.java:314)
    at java.base/java.lang.VirtualThread.run(VirtualThread.java:311)
Caused by: com.google.protobuf.InvalidProtocolBufferException: Type of the Any message does not match the given class.
    at com.google.protobuf.Any.unpack(Any.java:225)
    at io.eigr.spawn.internal.transport.server.ActorServiceHandler.callAction(ActorServiceHandler.java:153)
    ... 10 common frames omitted

To Reproduce
Steps to reproduce the behavior:

  1. Create init method on Actor
  2. Start system
  3. See error

Additional context
Apparently it is trying to deserialize a protobuf type with no bytes in the Any type.

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