Item.SetParent caused remove - this shouldn't ever happen

I keep seeing this error happen very randomly, and I get reports of my players getting disconnected from the server. I asked for the Disconnect message but nobody could grab it at the time.

In looking through the server.log file, I do see the following at or around that time of disconnects:

Item.SetParent caused remove - this shouldn't ever happen
(Filename: C:\buildslave\unity\build\Runtime/Export/Debug/Debug.bindings.h Line: 35)​

I'm not entirely sure what would be causing this - Google'ing doesn't have much answers either. Any tips?

This particular server is running on Windows Server 2022 as well for reference. Thanks in advance!

I think only plugins that call the item.SetParent() method directly can cause this. 99.9% of plugins will instead use item.MoveToContainer() which doesn't cause this. When I search uMod plugins for item.SetParent, I see 7 plugins in total. Maybe you are running some of those, or maybe you have plugins from other websites that are using that method.

NKXTQs24ExGTuL8.jpg WhiteThunder

I think only plugins that call the item.SetParent() method directly can cause this. 99.9% of plugins will instead use item.MoveToContainer() which doesn't cause this. When I search uMod plugins for item.SetParent, I see 7 plugins in total. Maybe you are running some of those, or maybe you have plugins from other websites that are using that method.

Oddly enough I am using Clans REBORN by @k1lly0u and the majority of plugins using that method are created by him. (Not sure if Clans REBORN uses that method as well?) - I'm not saying they're linked, but maybe it's a coincidence? The only plugin on that list you linked that we're using is Remover Tool - however, only Admins have access to that and nobody was using it at the time of the kicks, etc.

Is there anywhere in any log files I can look at that would give me more information other than this generic error message in the server.log file?

CpzRiG6SsesXoIz.jpg MONSTRO

Is there anywhere in any log files I can look at that would give me more information other than this generic error message in the server.log file?

No, since the related events won't be logged. Most events in Rust aren't logged.

You could use a text editor or other tool to search for "item.SetParent" in all your plugin files at once, to see if you have other plugins installed which could cause this.

NKXTQs24ExGTuL8.jpg WhiteThunder

No, since the related events won't be logged. Most events in Rust aren't logged.

You could use a text editor or other tool to search for "item.SetParent" in all your plugin files at once, to see if you have other plugins installed which could cause this.

The only plugin using it appears to be Remover Tool. However only Admins have access to this plugin and nobody was using it at the time of the events in the console... not sure what is going on. It's up to date as well with the latest version.

Search "item.SetParent" (2 hits in 1 file of 149 searched)
  Z:\Websites\Rust Elevated\Plugins\RemoverTool.cs (2 hits)
	Line 1276:                     activeItem.SetParent(null);
	Line 1286:                             activeItem.SetParent(Player.inventory.containerBelt);​


EDIT: These errors haven't happened since this post, so I'm not sure if it just needed a reload, etc. I do have daily restarts configured, just not sure why it was happening at all. ¯\_(ツ)_/¯



Merged post

Spoke too soon, it just happened again a few times in a row...