Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception running Actor example: Type 'Dapr.Actors.Runtime.ActorReminder' cannot be serialized. #1177

Closed
m3nax opened this issue Oct 25, 2023 · 1 comment · Fixed by #1179
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@m3nax
Copy link
Contributor

m3nax commented Oct 25, 2023

Expected Behavior

The var reminder = await proxy.GetReminder(); should return the registerd reminder information

Actual Behavior

Exception is thrown in the client: Type 'Dapr.Actors.Runtime.ActorReminder' cannot be serialized.
At line https://github.com/m3nax/dapr-dotnet-sdk/blob/master/examples/Actor/ActorClient/Program.cs#L100

Client output:

Making call using actor proxy to save data.
Making call using actor proxy to get data.
Received data is PropertyA: ValueA, PropertyB: ValueB.
Making calls to an actor method which has no argument and no return type.
Got Incorrect Exception from actor method invocation. Exception Dapr.Actors.ActorInvokeException: The method or operation is not implemented.
Making calls without Remoting.
Registering the timer and reminder
Waiting so the timer and reminder can be triggered
Making call using actor proxy to get data after timer and reminder triggered
Received data is PropertyA: Timer triggered at '02023-10-25T22:50:16', PropertyB: Reminder triggered at '2023-10-25T22:50:12'.
Getting details of the registered reminder
Unhandled exception. Dapr.Actors.ActorMethodInvocationException: Remote Actor Method Exception,  DETAILS: Exception: InvalidDataContractException, Method Name: ThrowInvalidDataContractException, Line Number: 0, Exception uuid: 99272412-891a-40e7-9705-1cb6b3edf4e3
 ---> Dapr.Actors.ActorInvokeException: Type 'Dapr.Actors.Runtime.ActorReminder' cannot be serialized. Consider marking it with the DataContractAttribute attribute, and marking all of its members you want serialized with the DataMemberAttribute attribute. Alternatively, you can ensure that the type is public and has a parameterless constructor - all public members of the type will then be serialized, and no attributes will be required.
   --- End of inner exception stack trace ---
   at Dapr.Actors.DaprHttpInteractor.InvokeActorMethodWithRemotingAsync(ActorMessageSerializersManager serializersManager, IActorRequestMessage remotingRequestRequestMessage, CancellationToken cancellationToken) in C:\Users\manue\source\repos\dapr-dotnet-sdk\src\Dapr.Actors\DaprHttpInteractor.cs:line 174
   at Dapr.Actors.Communication.Client.ActorRemotingClient.InvokeAsync(IActorRequestMessage remotingRequestMessage, CancellationToken cancellationToken) in C:\Users\manue\source\repos\dapr-dotnet-sdk\src\Dapr.Actors\Communication\Client\ActorRemotingClient.cs:line 47
   at Dapr.Actors.Client.ActorProxy.InvokeMethodAsync(Int32 interfaceId, Int32 methodId, String methodName, IActorRequestMessageBody requestMsgBodyValue, CancellationToken cancellationToken) in C:\Users\manue\source\repos\dapr-dotnet-sdk\src\Dapr.Actors\Client\ActorProxy.cs:line 227
   at Dapr.Actors.Client.ActorProxy.ContinueWithResult[TRetval](Int32 interfaceId, Int32 methodId, Task`1 task) in C:\Users\manue\source\repos\dapr-dotnet-sdk\src\Dapr.Actors\Client\ActorProxy.cs:line 291
   at ActorClient.Program.Main(String[] args) in C:\Users\manue\source\repos\dapr-dotnet-sdk\examples\Actor\ActorClient\Program.cs:line 100
   at ActorClient.Program.<Main>(String[] args)

Steps to Reproduce the Problem

  • fetch lastest version of master branch
  • move to example folder cd .\examples\Actor\DemoActor\
  • run command as written in readme dapr run --dapr-http-port 3500 --app-id demo_actor --app-port 5010 dotnet run
  • open another console and move to example folder cd .\examples\Actor\ActorClient\
  • run command as written in readme dotnet run
  • wait for reminder part of example

Release Note

RELEASE NOTE:

@m3nax m3nax added the kind/bug Something isn't working label Oct 25, 2023
@philliphoff
Copy link
Contributor

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants