# How to fix the error "Ensure condition failed: SessionInterface.IsUnique()"

**URL:** <https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277>\
**Category:** Programming & Scripting\
**Tags:** onlinesubsystem, unreal-engine, question, Cooking-Failed\
**Created:** [December 13, 2022, 11:27am UTC](https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277 "2022-12-13T11:27:31Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![BIGSUNGG](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@BIGSUNGG](https://forums.unrealengine.com/u/BIGSUNGG)\
**Post date:** [December 13, 2022, 11:27am UTC](https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277/1 "2022-12-13T11:27:31Z")

</div>

Hello,  
I have a problem that getting this error when cooking my project  
I want solution of this problem  
Im using UE5.1

```auto
LogOutputDevice: Error: === Handled ensure: ===
LogOutputDevice: Error: Ensure condition failed: SessionInterface.IsUnique() [File:D:\build\++UE5\Sync\Engine\Plugins\Online\OnlineSubsystemNull\Source\Private\OnlineSubsystemNull.cpp] [Line: 268] 
LogOutputDevice: Error: Stack: 
LogOutputDevice: Error: [Callstack] 0x00007ff83d3d7f55 UnrealEditor-OnlineSubsystemNull.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff83dfa1f8a UnrealEditor-OnlineSubsystem.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff83dfc7f4f UnrealEditor-OnlineSubsystem.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff84e6269b8 UnrealEditor-UnrealEd.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff84e62ae57 UnrealEditor-UnrealEd.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff84e62a621 UnrealEditor-UnrealEd.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff84df9b1f5 UnrealEditor-UnrealEd.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff84ea1d1b6 UnrealEditor-UnrealEd.dll!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff6b886852c UnrealEditor.exe!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff6b888287d UnrealEditor.exe!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff6b888296a UnrealEditor.exe!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff6b8885680 UnrealEditor.exe!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff6b88971b4 UnrealEditor.exe!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff6b889a516 UnrealEditor.exe!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff9189f74b4 KERNEL32.DLL!UnknownFunction []
LogOutputDevice: Error: [Callstack] 0x00007ff918b426a1 ntdll.dll!UnknownFunction []

```

I added Online Online Subsystem and Online Subsystem Steam plugin at my project  
and wrote that code in my project.Build.cs

```auto
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "OnlineSubsystemSteam", "OnlineSubsystem" });

```

and i wrote that code at DefaultEngine.ini

```auto
[/Script/Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystemUtils.IpNetDriver")

[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480
bInitServerOnClient=true

[/Script/OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"

```

Thank you in advance

---

<div class="post-metadata">

**Author:** ![halvini](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@halvini](https://forums.unrealengine.com/u/halvini)\
**Post date:** [January 25, 2023, 4:34am UTC](https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277/2 "2023-01-25T04:34:41Z")

</div>

Same problem. UE 5.1. Online Subsystem Steam.

Logs:

> PIE: New page: PIE session: GameStartupMap (Jan 24, 2023, 12:36:57 AM)  
> LogOutputDevice: Warning: Script Stack (0 frames) :  
> LogStats: FPlatformStackWalk::StackWalkAndDump - 0.021 s  
> LogOutputDevice: Error: === Handled ensure: ===  
> LogOutputDevice: Error: Ensure condition failed: SessionInterface.IsUnique() [File:D:\build++UE5\Sync\Engine\Plugins\Online\OnlineSubsystemNull\Source\Private\OnlineSubsystemNull.cpp] [Line: 268]  
> LogOutputDevice: Error: Stack:  
> LogOutputDevice: Error: [Callstack] 0x00007ff83b807f55 UnrealEditor-OnlineSubsystemNull.dll!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff83c3d1f8a UnrealEditor-OnlineSubsystem.dll!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff83c3f7f4f UnrealEditor-OnlineSubsystem.dll!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff8467b69b8 UnrealEditor-UnrealEd.dll!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff8467bae57 UnrealEditor-UnrealEd.dll!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff8467ba621 UnrealEditor-UnrealEd.dll!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff84612b1f5 UnrealEditor-UnrealEd.dll!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff846bad1b6 UnrealEditor-UnrealEd.dll!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff74805852c UnrealEditor.exe!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff74807287d UnrealEditor.exe!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff74807296a UnrealEditor.exe!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff748075680 UnrealEditor.exe!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff7480871b4 UnrealEditor.exe!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff74808a516 UnrealEditor.exe!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff917d055a0 KERNEL32.DLL!UnknownFunction   
> LogOutputDevice: Error: [Callstack] 0x00007ff91912485b ntdll.dll!UnknownFunction   
> LogStats: SubmitErrorReport - 0.000 s  
> LogStats: SendNewReport - 0.942 s  
> LogStats: FDebug::EnsureFailed - 0.985 s  
> LogOnline: Display: STEAM: OnlineSubsystemSteam::Shutdown()  
> LogOnline: OSS: Created online subsystem instance for: NULL  
> LogOnline: OSS: TryLoadSubsystemAndSetDefault: Loaded subsystem for module [NULL]  
> LogPlayLevel: Creating play world package: /Game/Maps/UEDPIE\_0\_GameStartupMap  
> LogPlayLevel: PIE: StaticDuplicateObject took: (0.012056s)  
> LogPlayLevel: PIE: Created PIE world by copying editor world from /Game/Maps/GameStartupMap.GameStartupMap to /Game/Maps/UEDPIE\_0\_GameStartupMap.GameStartupMap (0.012097s)  
> LogChaos: FPhysicsSolverBase::AsyncDt:-1.000000

---

<div class="post-metadata">

**Author:** ![pyskonus](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/pyskonus/32/485279_2.png) [@pyskonus](https://forums.unrealengine.com/u/pyskonus)\
**Post date:** [February 19, 2023, 5:04pm UTC](https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277/3 "2023-02-19T17:04:39Z")

</div>

Have you figured this out yet guys? I have this issue too and I’m not even using Online Subsystem Steam yet, only Online Subsystem NULL. It’s triggered when I start the game.

---

<div class="post-metadata">

**Author:** ![TheNateRalph](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TheNateRalph](https://forums.unrealengine.com/u/TheNateRalph)\
**Post date:** [March 28, 2023, 7:07pm UTC](https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277/4 "2023-03-28T19:07:44Z")

</div>

I’m also getting this with Online Subsystem NULL after adding in EOS and EOS Plus on 5.1.1. It only happens the first time I PIE after opening the editor. I was using Advanced Sessions before and wasn’t having this issue.

---

<div class="post-metadata">

**Author:** ![Kletterseil](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Kletterseil](https://forums.unrealengine.com/u/Kletterseil)\
**Post date:** [May 3, 2023, 6:55pm UTC](https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277/5 "2023-05-03T18:55:34Z")

</div>

I had the same problem. But since I don’t see any use for the **OnlineSubsystemNull** plugin, I simply deactivated it and since then everything worked without problems. Are there any disadvantages when simply deactivating the plugin? So far I have not had any. Of course, if I want to test something LAN via my local network then I need the plugin as far as I understand. But as long as that is not the case. Everything is great.

---

<div class="post-metadata">

**Author:** ![almogs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@almogs](https://forums.unrealengine.com/u/almogs)\
**Post date:** [August 18, 2024, 1:09pm UTC](https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277/6 "2024-08-18T13:09:36Z")

</div>

Had the same issue.  
You are probably using IOnlineSessionPtr::IsValid() somewhere before the IOnlineSessionPtr member or variable is initialized. You can either make sure it is only being called after the initialization of the member or instead of calling IsValid() directly use a wrapper that makes sure that the member is initialized first.

---

<div class="post-metadata">

**Author:** ![AnyOne](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/anyone/32/960595_2.png) [@AnyOne](https://forums.unrealengine.com/u/AnyOne)\
**Post date:** [February 21, 2025, 4:16pm UTC](https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277/7 "2025-02-21T16:16:08Z")

</div>

2025 UE5.4  
[OnlineSubsystemNull.cpp] [Line: 366] → DESTRUCT\_INTERFACE(SessionInterface);  
ErrorMsg-\>Error: Ensure condition failed: SessionInterface.IsUnique()

My Solution

void XXX\_Initialize(){  
…  
const IOnlineSubsystem\* OnlineSubsystem = Online::GetSubsystem(GetWorld());  
// Create SessionInterface  
SessionInterface = OnlineSubsystem-\>GetSessionInterface();  
}

**void XXX\_DeInitialize(){**  
\*\* …\*\*  
\*\* // Key point\*\*  
\*\* SessionInterface.Reset()\*\*  
**}**

The `DESTRUCT_INTERFACE` macro enforces that the session interface pointer (which is a shared pointer) must be the sole owner when it’s destroyed (`IsUnique() == true`). My approach is to call `Reset()` in advance to make sure the engine module has exclusive ownership of the reference count (I only reference the session interface once in the `XXX_Initialize` function).

---

<div class="post-metadata">

**Author:** ![Dustin\_Clark\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Dustin\_Clark\_1](https://forums.unrealengine.com/u/Dustin_Clark_1)\
**Post date:** [March 14, 2025, 8:13pm UTC](https://forums.unrealengine.com/t/how-to-fix-the-error-ensure-condition-failed-sessioninterface-isunique/727277/8 "2025-03-14T20:13:11Z")

</div>

That did the trick for me. Thanks
