Failed to insert item messages in build log

the bug is fixed in unity2019.1.7f1, 2019.2.1
i think you forget merge the patch to unity 2017

The is is in 2017.4.19f1

I just tested it In Unity 2017.4.19, the bug is not fixed!
with below code, you will reproduct it:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.IO;

public class ReproduceBug
{

    [MenuItem("BUG/ProductBug")]
    static void Test()
    {
        for (int i = 0; i < 1200; i++)
        {
            string str = "using UnityEngine; public class XXX" + i.ToString() + ": MonoBehaviour{}";

            File.WriteAllText(Application.dataPath + "/XXX" + i.ToString() + ".cs", str);
        }

        AssetDatabase.Refresh();
    }
}

Could you please file a bug report

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

This is actually fixed in 2017.4.34f1, you can find it here: Unity 2017.4.34

ā€œScripting: Fixed Produce a warning and prevent warnings spamming when trying to insert menu item when the insertion limit is reached. (1181898, 1187861)ā€

Actually, oddly enough, Iā€™m getting this same issue in 2020.3 when using Addressables package.

1 Like

Weā€™re still seeing this issue aswell in Unity 2020.3.11. The code posted above to reproduce the bug also still works for this.

Iā€™ve sent in a new bugreport: (Case 1343433) ā€œFailed to insert itemā€ warnings logged with many components in project

Edit:
The issue has been added to the public issuetracker: Unity Issue Tracker - Multiple &quot;Failed to insert item&quot; warnings are logged when amount of inserted items exceeds 1000

2 Likes

Hello,
So me and my friend are trying to make a game together (share and edit the same project at the same time).
Everything that we did went smoothly but when my friend publishes a project in our organisation and I download and open it, it only transfers scripts, no elements or items. An error message appears which says: ā€œFailed to insert item. Invalid menu handle.ā€
Please, if someone knows how to fix this problem let me know and contact me on my e-mail pivachd@gmail.com
Thank you and good bye!
Niko Pivac

7637557--951259--upload_2021-11-8_14-3-39.png
2019.4

1 Like

Seeing more of this on a freshly installed Unity Hub + Unity 2021.3.8f1 LTS after it first popping up. Temporary Unity download folder deleted and all Unity-related folders removed from /AppData prior to the reinstall.

Iā€™m getting all the fun stuff, from ā€˜failed to add separatorā€™ to ā€˜Failed to insert item. Invalid menu handle.ā€™

I also have that cool bug where where almost every running application window pops up; from GHub and iCue to Discord and Settings, as well as applications that donā€™t really have UIs and so only some title bars appear. I have to relog the OS user account to clear it all out or I would be tediously closing stuff from the Task Manager for like 15 minutes.

Generally when this happens, the Editor becomes completely useless and stops reacting to any input events; No drop down menus, tabbed windows donā€™t switch when clicked on, etc., so I just alt-F4 is as even the Close/X button doesnā€™t respond. I tried this is the current 2022.2.0b6 Beta as well, and was running into the same issuesā€¦ which was very odd.

Keep in mind, all of this happened with a new blank 3D project.

I will post if I find some sort of solution unless it just starts working again for whatever reason.

Thatā€™s strange. Have you filled any bug reports? Do you have a log file from when this happened?

I have yet to do as I want to make sure Iā€™m not doing anything stupid on my end for some reason :wink: But Iā€™m getting closer to doing so.

I seem to be seeing something reported in [another thread ]( https://discussions.unity.com/t/505901 page-2#post-8408379)as well, my post with an excerpt of the Editor.log shown. I kept seeing this after Revo uninstalling then reinstalling Unity as well; Registry and AppData wiped prior to install.

I have not specifically set any additional logging outside of default, but if a default log has it, I should be able to get one from one of these two issues pretty easily. Sorry, never submitted one on here before manually, just once on a crash, which isnā€™t happening with these 2 issues Iā€™m having.

Let me know about the logs, or link me on what to do if anything, and Iā€™ll get you anything needed :slight_smile:

Going to give Alpha a shot in the meantime. If I still have issues I have to assume itā€™s something local going on; Then on to figure that out.

trying to make a VR game and finding the same error. i am using the unity version 2022.1.15ft.
closing and reopening works but it comes back up again. does anybody know how to fix?

1 Like

Iā€™m just curious; Are you trying this with an existing project only?
Have you tried with something like a new blank 3D project?

Iā€™m working on VR/XR myself, but before any of that is involved, before any package imported, these issues pop up from simply going around menus and preferences, change tabs, etc. Iā€™m getting this issue from completely new projects before anything is even ā€˜doneā€™ to the project.
Iā€™m wondering if thatā€™s the same case for you, or if it seems project specific.

I installed 2023.1.0a6.754, created a new 3D project in my user folder, opened the package manager, selected Engineering, Clicked the ā€˜Removeā€™ button, and received the error:

Error displaying dialog: The current process has used all of its system allowance of handles for Window Manager objects.

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

After this point, the menus showed a highlight on mouse over, but there was no dropdown menu when clicked (File, Edit, etc.).

I then clicked the Package Manager Tab and dragged it down and to the left, which then gave me this in the console:

UnityException: Win32 could not create GUI view becasue CreateWindowEx failed with message: The operation completed successfully.

UnityEditor.GUIView.SetWindow (UnityEditor.ContainerWindow win) (at <1e70ef17bec74538be72c6474de528c4>:0)
UnityEditor.View.SetWindowRecurse (UnityEditor.ContainerWindow win) (at <1e70ef17bec74538be72c6474de528c4>:0)
UnityEditor.ContainerWindow.set_rootView (UnityEditor.View value) (at <1e70ef17bec74538be72c6474de528c4>:0)
UnityEditor.PaneDragTab.Show (UnityEngine.Rect pixelPos, UnityEngine.GUIContent content, UnityEngine.Vector2 viewSize, UnityEngine.Vector2 mouseScreenPosition) (at <1e70ef17bec74538be72c6474de528c4>:0)
UnityEditor.DockArea.DragTab (UnityEngine.Rect tabAreaRect, System.Single scrollOffset, UnityEngine.GUIStyle tabStyle, UnityEngine.GUIStyle firstTabStyle) (at <1e70ef17bec74538be72c6474de528c4>:0)
UnityEditor.DockArea.DrawTabs (UnityEngine.Rect tabAreaRect) (at <1e70ef17bec74538be72c6474de528c4>:0)
UnityEditor.DockArea.OldOnGUI () (at <1e70ef17bec74538be72c6474de528c4>:0)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, System.Boolean canAffectFocus) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.IMGUIContainer.SendEventToIMGUI (UnityEngine.UIElements.EventBase evt, System.Boolean canAffectFocus, System.Boolean verifyBounds) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.IMGUIContainer.ProcessEvent (UnityEngine.UIElements.EventBase evt) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEvent (UnityEngine.UIElements.EventBase evt) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase evt) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.CallbackEventHandler.HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase evt) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.EventDispatcher.ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, System.Boolean imguiEventIsInitiallyUsed) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEventQueue () (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.EventDispatcher.OpenGate () (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.EventDispatcherGate.Dispose () (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.UIElementsUtility.UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& eventHandled) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.UIEventRegistration.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.UIElements.UIEventRegistration+<>c.<.cctor>b__1_2 (System.Int32 i, System.IntPtr ptr) (at <e0e2776ee0dc49a2b4913c60438f7b39>:0)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr, System.Boolean& result) (at <ec2c82f195a443ac96f36c6a81d3dd8b>:0)

along with,

!m_View
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

which seemed to alternate one to the other, over and over, about 79 times combined.

Any ideas, anyone?

same error in version 2021.3.6f1 LTS

The error occurs on any version I use even if itā€™s a new project. I can click around a little big and it either wonā€™t let me click anything and shows errors, or the UI just breaks and I close unity, where it should show Save or Donā€™t save buttons, only to show nothing and unity completely freezes.

1 Like

Looks like exactly what Iā€™m seeing, and happening on any version as well, at least back to 2019s.

After some of the errors mentioning using up all available objects, I turned on the User Objects column from Details in Task Managerā€¦

Here the new, blank 3D project is prior to clicking or interacting with the editor at all:

After some clicking around in the package manager, but not installing or removing anything, when the ā€˜failed to insertā€™ stuff starts, this is what it looks like:

Yeaā€¦ thatā€™s no good. And again, this is a new, unmodified 3D project on 2021.3.9f1, but I get the same basic things on ALL versions that are currently on the hub from 2019+.