Hi , I am experiencing this same issue when I attempt to Attach an Actor at the start of the game with a Client. This is on 4.10.
Hi ,
Would it be possible to take a look at your project? We can cross-reference what is happening with your project with what is happening in 's and see if that helps to pinpoint where things are going wrong. If you would like to provide your project privately, you can [send me a PM][1] on the forums.
Hi ,
I did some more experimenting today with the sample project that you provided, and was unable to see the crash that we originally saw there. Would you be able to provide some updated steps that trigger the crash (either here or via forum PM).
, we have not heard back from you for a while. Would you be able to provide a sample project demonstrating the issue you are seeing so we can compare what is happening there directly with what is happening with the other sample project we have?
I could provide project with 100% (I hope) way to reproduce issue. I’ll uploading sources somewhere, will send you in PM.
UPDATE: done, check your PM on forum.
UPDATE2: It seems to get crash I need to detach on object first.
Hey ,
I have send you a PM with the current code and description. I am testing with 4.10
Hello everyone,
Thank you for the additional test projects that were provided. I have created a new ticket to continue investigating this issue (UE-25221). With the additional information that was provided, I am hopeful that we will be able to pinpoint what is going wrong.
Hey everyone,
I’m getting the same problem.
, here is a simple say to reproduce the problem using the sample project (miniYag) i sent you for the network issue about file sharing between server and clients.
In the YagPlayerController.cpp, add the following lines around line 1430 (in the ServerSpawnObject function):
// TEST
// ATTACH TO PREVIOUS OBJECT
if (MyGameState && MyGameState->ObjectArray.Num() > 1)
{
//SpawnedObject->AttachRootComponentTo(MyGameState->ObjectArray[FMath::Min(0, MyGameState->ObjectArray.Num() - 2)]->GetRootComponent());
SpawnedObject->AttachRootComponentToActor(MyGameState->ObjectArray[FMath::Min(0, MyGameState->ObjectArray.Num() - 2)]);
}
They attach each newly spawned object to its predecessor in the object array maintained by the game state.
You then just have to add two objects to reproduce the problem.
When playing with only a server the attachment works well, but when using 2 players, you’ll get the crash.
Here is a video showing you everything:
I hope this helps.Cheers
Hello everyone,
Thank you for the additional test cases and patience while we work on this issue. I just ran some tests using the sample projects that were provided in 4.11 Preview 3, and in most cases the Ensure was no longer getting triggered (one sample project got stuck when trying to open, though I don’t believe that is related to this particular issue). Would you be able to try your sample projects in Preview 3 and let us know if you happen to still see the Ensure?
, in your project in particular, a different (but similar) Ensure was triggered when ending PIE. This other Ensure we believe was corrected this past weekend.
Hey ,
Sorry for the delayed answer, i’m using the substance plugin which has still not been released for 4.11 preview so i had to debug the 4.10 version of the plugin for it to compile on 4.11.
So i ran some tests in 4.11 preview 4 and unfortunately the bug is still present for me.
I made a quick video to show you what i do:
Of course, please let me know if you need any more info.Cheers
I tested Preview 4 and it all seems to work really well. This is going to be a great Update. Hope it stays that way, but I will re-open this thread if the error occurs again. Thank you so much. You are great.
Hey ,
I tried on a packaged game and it worked, even in 4.10.
So in short, on my side:
- it works well on packaged game even in 4.10
- It doesn’t work in PIE even in 4.11
Cheers
Hi,
I have the same problem in a multiplayer Dedicated game, running on 4.11 latest. Both packed games and in PIE.
- Detach item(actor) on server
- Client freeze(could be up to 40 sec !!!) and stacktrace as below:
2016.04.26-12.57.56:270][947]LogOutputDevice:Warning:
Script Stack:
Actor.OnRep_AttachmentReplication[2016.04.26-12.57.56:994][947]LogStats: FPlatformStackWalk::StackWalkAndDump -
0.723 s [2016.04.26-12.57.56:994][947]LogOutputDevice:Warning: === Handled error: ===Ensure condition failed: !bRegistered
||
AttachParent->AttachChildren.Contains(this)
[File:D:\BuildFarm\buildmachine_++UE4+Release-4.11\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp]
[Line: 1655] Attempt to detach
SceneComponent ‘LootCollisionSphere’
owned by ‘Shotgun_C_3’ from
AttachParent ‘CharacterMesh0’ while
not attached. Stack:
UE4Editor-Core.dll!FWindowsPlatformStackWalk::StackWalkAndDump()
[d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\windows\windowsplatformstackwalk.cpp:178]
UE4Editor-Core.dll!FDebug::EnsureFailed()
[d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\misc\outputdevice.cpp:317]
UE4Editor-Core.dll!FDebug::OptionallyLogFormattedEnsureMessageReturningFalse()
[d:\buildfarm\buildmachine_++ue4+release-4.11\engine\source\runtime\core\private\misc\outputdevice.cpp:441]
UE4Editor-Engine.dll!USceneComponent::DetachFromParen[2016.04.26-12.57.56:996][947]LogStats: SubmitErrorReport - 0.000 s
[2016.04.26-12.57.57:452][947]LogStats: SendNewReport - 0.455 s
[2016.04.26-12.57.57:452][947]LogStats: FDebug::EnsureFailed - 1.182 s
When i can initiate it from the client i always detach first on client, that seems to work. But the problem is when the server is the “Initiator”
Cheers
Hi State128,
Are you able to reproduce this issue in a new, clean project, or does it only happen in your project? Just to be sure, when you detach a component on the Server, are you making sure that when the client is notified to detach the component it isn’t turning around and telling the server that the component needs to be detached?
Hi, after a chat with you guys at Nordic Game i changed approach. I think it works well now. What I did when dropping an item is to kill the item and create a new item (as a pickup). Then it seems to work. It could be a problem when changing owner of the actor and detach the Component. Anyways, works for me now. Thanks for your attention.
Hi there,
What is the status of this ticket?
We are having an issue caused by the change in UE-19264:
https://udn.unrealengine.com/questions/301054/non-replicated-child-detaches-from-replicated-pare.html
The issue is that, on the client, the parent’s replicated AttachChildren is first being updated via property replication and this is conflicting with the subsequent Detach/DetachFromParent code that expects to be the one that modifies AttachChildren.
Thanks
Hi,
Sorry for the delayed response. I checked the post that you linked, and it looks like someone else had already responded there. For the sake of everyone on this thread, the issue that you described is a known issue that was reported in UE-26025. Unfortunately we do not have a solution for this issue at this time.
Hi all,
Did this ever get officially fixed? I’m having this problem in 4.19 with exactly the same callstack mentioned above.
It sporadically happens when attaching an actor to another in a multiplayer game - sometimes the clients fail the check in the attach code when the attachment is replicated.
There is another bug that has the same callstack, but a different description here :
It is marked as Resolved, Won’t Fix, and Backlogged simultaneously.
I’m getting same error. UE4.19.2
LogOutputDevice: Error: Ensure condition failed: !bRegistered || GetAttachParent()->GetAttachChildren().Contains(this) [File:D:\Build\++UE4+Release-4.19+Compile\Sync\Engine\Source\Runtime\Engine\Private\Components\SceneComponent.cpp] [Line: 2009]
LogOutputDevice: Error: Attempt to detach SceneComponent 'StaticMesh' owned by 'Wheel01_BP_C_9' from AttachParent 'StaticMesh' while not attached.
I guess we need to find workaround as they are not going to fix…
It turned out my problem was a network race condition. I was letting UE4 replicate the attachment/detachment of actors, but also manually attaching/unattaching the same actors in response to replication notifies.
Sometimes the rep notifies would get in first, and when UE4’s internal replication happened, things weren’t in the expected state.
Just removing my manual attachment/detachment on remote clients fixed it for me.