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

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

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

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

and i wrote that code at DefaultEngine.ini

[/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

3 Likes

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

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.

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.

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.

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.