Failed to insert item messages in build log

Hello,

When we perform a headless build of our game, we get lots of messages in the build log that look like this

Failed to insert item. Name: Sheep Mover, Command: SCRIPT3712
(Filename: C:/buildslave/unity/build/Editor/Platform/Windows/MenuControllerWin.cpp Line: 526)

SheepMover being a class in our game. We have this for many other scripts but not all. The build succeeds regardless.

Is this a problem? What causes this? Can I get rid of it?

Thanks!
Alex

Pardon for the old thread resurrection, but we have this problem as well, and it only seems to have gotten worse with Unity 5.4. Are others still seeing this, or know of any solutions?

Bump… using latest 5.4.2p3 and still have 100mb build logs that are mostly garbage like this… in fact, during our particular build process, we have 64,780 instances of “Failed to insert item”.

[10:12:31]: [Step 1/2] Failed to insert item. Name: Party Member UI, Command: SCRIPT9222
[10:12:31]: [Step 1/2]
[10:12:31]: [Step 1/2] (Filename: C:/buildslave/unity/build/Editor/Platform/Windows/MenuControllerWin.cpp Line: 518)
[10:12:31]: [Step 1/2]
[10:12:31]: [Step 1/2] Failed to insert item. Name: Party Options Context Menu Button, Command: SCRIPT9954
[10:12:31]: [Step 1/2]
[10:12:31]: [Step 1/2] (Filename: C:/buildslave/unity/build/Editor/Platform/Windows/MenuControllerWin.cpp Line: 518)
[10:12:31]: [Step 1/2]
[10:12:31]: [Step 1/2] Failed to insert item. Name: Party UI, Command: SCRIPT3338

[11:14:26]: [Step 1/2] Failed to insert item. Name: Login UI, Command: SCRIPT4936
[11:14:26]: [Step 1/2] UnityEditor.BuildPipeline:BuildAssetBundleInternal(Object, Object[ ], String[ ], String, BuildAssetBundleOptions, BuildTarget, UInt32&)
[11:14:26]: [Step 1/2] UnityEditor.BuildPipeline:BuildAssetBundle(Object, Object[ ], String, UInt32&, BuildAssetBundleOptions, BuildTarget) (at C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:306)
[11:14:26]: [Step 1/2] UnityEditor.BuildPipeline:BuildAssetBundle(Object, Object[ ], String, BuildAssetBundleOptions, BuildTarget) (at C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:282)
[11:14:26]: [Step 1/2] PortBuildMenu:BuildConversationBundlesInternal(Boolean) (at Assets\Editor\PortBuildMenu.cs:9290)
[11:14:26]: [Step 1/2] PortBuildMenu:BatchPostProcessBuild(BuildTarget, Boolean) (at Assets\Editor\PortBuildMenu.cs:8099)
[11:14:26]: [Step 1/2] PortBuildMenu:BatchPostProcessBuildForPC() (at Assets\Editor\PortBuildMenu.cs:480)
[11:14:26]: [Step 1/2]
[11:14:26]: [Step 1/2] [C:/buildslave/unity/build/Editor/Platform/Windows/MenuControllerWin.cpp line 518]
[11:14:26]: [Step 1/2] (Filename: Assets/Editor/PortBuildMenu.cs Line: 9290)
[11:14:26]: [Step 1/2]
[11:14:26]: [Step 1/2] Failed to insert item. Name: Logout Timer UI, Command: SCRIPT6604
[11:14:26]: [Step 1/2] UnityEditor.BuildPipeline:BuildAssetBundleInternal(Object, Object[ ], String[ ], String, BuildAssetBundleOptions, BuildTarget, UInt32&)
[11:14:26]: [Step 1/2] UnityEditor.BuildPipeline:BuildAssetBundle(Object, Object[ ], String, UInt32&, BuildAssetBundleOptions, BuildTarget) (at C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:306)
[11:14:26]: [Step 1/2] UnityEditor.BuildPipeline:BuildAssetBundle(Object, Object[ ], String, BuildAssetBundleOptions, BuildTarget) (at C:\buildslave\unity\build\artifacts\generated\common\editor\BuildPipelineBindings.gen.cs:282)
[11:14:26]: [Step 1/2] PortBuildMenu:BuildConversationBundlesInternal(Boolean) (at Assets\Editor\PortBuildMenu.cs:9290)
[11:14:26]: [Step 1/2] PortBuildMenu:BatchPostProcessBuild(BuildTarget, Boolean) (at Assets\Editor\PortBuildMenu.cs:8099)
[11:14:26]: [Step 1/2] PortBuildMenu:BatchPostProcessBuildForPC() (at Assets\Editor\PortBuildMenu.cs:480)

1 Like

Hi,

We have the same issue here with 5.6.1p1. A lot of:

Failed to insert item. Name: xxxx, Command: SCRIPTnnnn

when doing a build using batchmode command line parameter.

Any ideas how to fix it?

5.5.2f1

When building assetbundles, there are similar error messages like:

Failed to insert item. Name: Look Dev, Command: 39
UnityEditor.BuildPipeline:BuildAssetBundles(String, AssetBundleBuild[ ], BuildAssetBundleOptions, BuildTarget)
…

same issue with 2017.1.2p3.
and make unity run slowly.

i have the same with unity 2018, anyone ever work this out ?

the same in Unity 2017.4.3f1 :frowning:

Any fix of this for 2017.3? Unity help!

I am porting a project from an old version of unity to a newer one and I am running into the same issue in both 4.6.9 and 5.3.1. Has the been any progress addressing this issue?

Update: Also running into this Error in 2018.1.6f1

how to fix?

I got this too in Unity2017.4.30:
Assertion failed: Failed to insert item. Name: XXX Command: SCRIPT

We just upgraded from Unity 2018.2.15f1 to Unity 2018.4.2f1 and we’re getting thousands of these messages during a bundle build and the log file is over 400MB. There are so many messages, there’s no way that I can think of to figure out the pattern of objects that are having this problem. It’s also taking extremely long to build. I’ve seen other threads online which seem to indicate that this is an innocuous message, and that seems to be the case for us as well, since the builds are working.
Can somebody from Unity at least let us know what causes this error message so that we can figure out what is going on?

Did anybody file a bug report?

This is really old one. Occurs on Windows in project with a lot of .cs files (I think ~ 5000 or more). I tried to make some research several months ago but failed. Issue is around adding menu items in “Add Component” list.

To push this bug we need to push whole huge project. I think you can reproduce it by generating couple of thousand files with random names and empty monobehaviors inside.

I can see the reason its failing is because of InsertMenuItemW
I have asked the team to improve the error message.
Are you using no graphics when you run the build?

On build machine, as I remember (in without GUI mode) we haven’t any errors. Only when scripts are recompiled after changes on Windows PC.

P.S. Yes, your suggestion about InsertMenuItemW is very logical. It occurs when add a lot of components in top menu bar.

I also get this error after I update my Win10.

1 Like

someone reproduced it, pls fix it:

i tested in unity2017.4.31, the bug still exist