# TraconSessionOwnerRequiredException

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.traconsessionownerrequiredexception/
> Summary: TraconSessionOwnerRequiredException: Thrown when session ownership is on, a session write needs an owner, and no authenticated identity could be resolved to be that owner.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Abstractions.dll</code></div>

Thrown when session ownership is on, a session write needs an owner, and no
authenticated identity could be resolved to be that owner.

```csharp
public sealed class TraconSessionOwnerRequiredException : TraconException, ISerializable
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="https://learn.microsoft.com/dotnet/api/system.exception">Exception</a> ← <a href="/api/tracon.traconexception/">TraconException</a> ← <a href="/api/tracon.traconsessionownerrequiredexception/">TraconSessionOwnerRequiredException</a></dd><dt>Implements</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.runtime.serialization.iserializable">ISerializable</a></dd><dt>Inherited Members</dt><dd><a href="/api/tracon.traconexception/#Tracon_TraconException_ErrorType">TraconException.ErrorType</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.getbaseexception">Exception.GetBaseException()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.tostring">Exception.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.gettype">Exception.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.targetsite">Exception.TargetSite</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.message">Exception.Message</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.data">Exception.Data</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.innerexception">Exception.InnerException</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.helplink">Exception.HelpLink</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.source">Exception.Source</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.hresult">Exception.HResult</a>, <a href="https://learn.microsoft.com/dotnet/api/system.exception.stacktrace">Exception.StackTrace</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

**Fail-closed.** With
[TraconSessionOwnershipOptions.Enabled](/api/tracon.traconsessionownershipoptions/#Tracon_TraconSessionOwnershipOptions_Enabled) on and
[TraconSessionOwnershipOptions.RequireAuthenticatedOwner](/api/tracon.traconsessionownershipoptions/#Tracon_TraconSessionOwnershipOptions_RequireAuthenticatedOwner)
left at its default, a session is never OPENED without an owner: an
ownerless row would be invisible to every owner-filtered listing from that
moment on, so the caller would have written a session they can never read
back. Rejecting the write is the honest answer; writing the row and hiding
it is not.

This is the one place where attribution stops being bookkeeping.
[IRunAttributionContext](/api/tracon.irunattributioncontext/) promises that its own failure never
stops a run — an unresolved user costs a NULL column and nothing else. With
ownership on, the SAME value becomes an authorization input, and its
absence rejects the write instead. Same service, two contract strengths;
the option is what moves between them.

Over HTTP this surfaces as `403`, not `500`: it is a policy
decision the deployment asked for, not a fault. It is also not `401` —
the caller may be perfectly well authenticated for the endpoint's own role
policy and still carry no identity the attribution pipeline can name.

## Constructors

### <a id="Tracon_TraconSessionOwnerRequiredException__ctor"></a> TraconSessionOwnerRequiredException\(\)

Creates a new error.

```csharp
public TraconSessionOwnerRequiredException()
```

### <a id="Tracon_TraconSessionOwnerRequiredException__ctor_System_String_"></a> TraconSessionOwnerRequiredException\(string\)

Creates a new error.

```csharp
public TraconSessionOwnerRequiredException(string message)
```

#### Parameters

`message` [string](https://learn.microsoft.com/dotnet/api/system.string)

The error message.

### <a id="Tracon_TraconSessionOwnerRequiredException__ctor_System_String_System_Exception_"></a> TraconSessionOwnerRequiredException\(string, Exception\)

Creates a new error.

```csharp
public TraconSessionOwnerRequiredException(string message, Exception innerException)
```

#### Parameters

`message` [string](https://learn.microsoft.com/dotnet/api/system.string)

The error message.

`innerException` [Exception](https://learn.microsoft.com/dotnet/api/system.exception)

The underlying error.

## Fields

### <a id="Tracon_TraconSessionOwnerRequiredException_SessionOwnerRequiredErrorType"></a> SessionOwnerRequiredErrorType

The stable value written to [TraconException.ErrorType](/api/tracon.traconexception/#Tracon_TraconException_ErrorType).

```csharp
public const string SessionOwnerRequiredErrorType = "session_owner_required"
```

#### Field Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

## Properties

### <a id="Tracon_TraconSessionOwnerRequiredException_ErrorType"></a> ErrorType

Gets the stable error type name written to the run record.

```csharp
public override string ErrorType { get; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)

#### Remarks

Defaults to the full name of the exception type, so today's behaviour does
not change. A derived type overrides this member when the record has to be
machine readable — for example [TraconContentFilteredException](/api/tracon.traconcontentfilteredexception/)
writes `content_filtered`. Reports and alert rules can rely on this
stable name instead of an assembly name.

The value is written to `RunError.Type` and **carries no secret**.

### <a id="Tracon_TraconSessionOwnerRequiredException_SessionId"></a> SessionId

Gets the id of the session that could not be given an owner.

```csharp
public string? SessionId { get; init; }
```

#### Property Value

 [string](https://learn.microsoft.com/dotnet/api/system.string)?
