Search Unity

Failed to insert item messages in build log

Discussion in 'Editor & General Support' started by diekeure, Nov 17, 2015.

  1. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    219
    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
     
  2. BurningToad

    BurningToad

    Joined:
    Aug 14, 2013
    Posts:
    54
    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?
     
  3. BurningToad

    BurningToad

    Joined:
    Aug 14, 2013
    Posts:
    54
    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)
     
    diekeure likes this.
  4. NachoAbril

    NachoAbril

    Joined:
    Jun 30, 2014
    Posts:
    34
    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. jehovah0121qq

    jehovah0121qq

    Joined:
    Nov 14, 2013
    Posts:
    64
    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)
    ......
     
  6. lovexbma

    lovexbma

    Joined:
    Jul 1, 2016
    Posts:
    1
    same issue with 2017.1.2p3.
    and make unity run slowly.
     
  7. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    845
    i have the same with unity 2018, anyone ever work this out ?
     
  8. Vitens

    Vitens

    Joined:
    May 2, 2018
    Posts:
    1
    the same in Unity 2017.4.3f1 :(
     
  9. AndersonDev

    AndersonDev

    Joined:
    Dec 13, 2015
    Posts:
    79
    Any fix of this for 2017.3? Unity help!
     
  10. jCampbell86

    jCampbell86

    Joined:
    Jan 10, 2019
    Posts:
    2
    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?
     
  11. jCampbell86

    jCampbell86

    Joined:
    Jan 10, 2019
    Posts:
    2
    Update: Also running into this Error in 2018.1.6f1
     
  12. skyThron

    skyThron

    Joined:
    Apr 25, 2019
    Posts:
    1
    how to fix?
     
  13. fuy

    fuy

    Joined:
    Sep 24, 2014
    Posts:
    23
    I got this too in Unity2017.4.30:
    Assertion failed: Failed to insert item. Name: XXX Command: SCRIPT
     
  14. PW_Dave

    PW_Dave

    Joined:
    Feb 9, 2017
    Posts:
    30
    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?
     
  15. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,451
    Did anybody file a bug report?
     
  16. AndersonDev

    AndersonDev

    Joined:
    Dec 13, 2015
    Posts:
    79
    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.
     
  17. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,451
    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?
     
  18. AndersonDev

    AndersonDev

    Joined:
    Dec 13, 2015
    Posts:
    79
    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.
     
    Last edited: Aug 13, 2019
  19. vincent_hhc

    vincent_hhc

    Joined:
    Aug 13, 2019
    Posts:
    1
    I also get this error after I update my Win10.
     
    fuy likes this.
  20. fuy

    fuy

    Joined:
    Sep 24, 2014
    Posts:
    23
    Last edited: Sep 2, 2019
  21. fuy

    fuy

    Joined:
    Sep 24, 2014
    Posts:
    23
    the bug is fixed in unity2019.1.7f1, 2019.2.1
    i think you forget merge the patch to unity 2017
     
  22. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,451
    The is is in 2017.4.19f1
     
  23. fuy

    fuy

    Joined:
    Sep 24, 2014
    Posts:
    23
    I just tested it In Unity 2017.4.19, the bug is not fixed!
    with below code, you will reproduct it:
    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEditor;
    5. using System.IO;
    6.  
    7. public class ReproduceBug
    8. {
    9.  
    10.     [MenuItem("BUG/ProductBug")]
    11.     static void Test()
    12.     {
    13.         for (int i = 0; i < 1200; i++)
    14.         {
    15.             string str = "using UnityEngine; public class XXX" + i.ToString() + ": MonoBehaviour{}";
    16.  
    17.             File.WriteAllText(Application.dataPath + "/XXX" + i.ToString() + ".cs", str);
    18.         }
    19.  
    20.         AssetDatabase.Refresh();
    21.     }
    22. }
    23.  
     
  24. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    3,451
    Could you please file a bug report
     
  25. fuy

    fuy

    Joined:
    Sep 24, 2014
    Posts:
    23
    hi, i have filed a bug report:
    (Case 1181898) Assertion failed: Failed to insert item. Name: XXX973, Command: SCRIPT3218