dotnet / dotnet/orleans

Misleading "IGrainReferenceActivatorProvider not found" error when Grain interface uses named tuple parameters

Open
#9,719 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
10.9k
Forks
2.1k
Avg merge
14h 42m
Merged PRs (30d)
354

Description

**Title:**
Grain interface with named tuple parameters causes misleading activation error: "Unable to find an IGrainReferenceActivatorProvider for grain type session"

### Description

When defining a Grain interface method that uses **C# named tuples** as parameters (e.g., `(int x, long y)`), the Orleans runtime fails during grain activation with a misleading exception:

```
Unable to find an IGrainReferenceActivatorProvider for grain type session
```

This error occurs **even though the Grain itself is correctly registered**, and the actual root cause appears to be **serialization or code generation failure due to the use of named tuples in the method signature**.

### Reproduction Steps

1. Define a Grain interface like this:

```csharp
public interface ITestGrain : IGrainWithStringKey
{
Task TestFuncAsync((int x, long y) arg1, (int xx, long yy) arg2);
}
```

2. Implement the grain and register it in the silo.
3. Call `GrainFactory.GetGrain("key")` from client or another grain.
4. The call fails with the exception below.

### Exception Details

```
System.InvalidOperationException: Unable to find an IGrainReferenceActivatorProvider for grain type session
at Orleans.GrainReferences.GrainReferenceActivator.CreateActivator(GrainType grainType, GrainInterfaceType interfaceType)
at Orleans.GrainReferences.GrainReferenceActivator.CreateReference(GrainId grainId, GrainInterfaceType interfaceType)
at Orleans.GrainFactory.GetGrain(Type interfaceType, IdSpan grainKey, String grainClassNamePrefix)
at Orleans.GrainFactory.GetGrain[TGrainInterface](String primaryKey, String grainClassNamePrefix)
```

### Environment

- **Orleans Version**: 8.0.0
- **.NET Version**: .NET 8

Contributor guide

Open the contributing guide

Research direction

Start with the GrainReferences.GrainReferenceActivator.CreateActivator and CreateReference entries shown in the stack trace, then reproduce the failure using the ITestGrain interface with named tuple parameters. Trace the related serialization or code-generation failure and verify the behavior against the reported Orleans 8.0.0 setup; done means named tuple parameters no longer produce the misleading activation error, or the underlying failure is reported clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
distributed-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.