Failed to undo a command

I’ve been working on an extension that interfaces with some of the Physics objects that can be added to the scene in Create/Code, and I must have royally messed something up because I can no longer add a ground plane from the physics menu when using Code. When I try to do so, I get the following error:

2022-09-02 21:55:49  [Error] [omni.kit.undo.undo] Failed to undo a command: AddGroundPlaneCommand.
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.ui-1.4.14-5.1\omni\physxui\scripts\menu.py", line 146, in <lambda>
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]     "onclick_fn": lambda *_: self._on_create_ground_plane()
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.ui-1.4.14-5.1\omni\physxui\scripts\menu.py", line 301, in _on_create_ground_plane
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]     commands.AddGroundPlaneCommand.execute(stage, "/GroundPlane", upAxis, 25.0 * scaleFactor, Gf.Vec3f(0.0), Gf.Vec3f(0.5))
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.commands-1.4.14-5.1\omni\physxcommands\__init__.py", line 36, in execute
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]     return execute(cls.__name__, **bound.kwargs)
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\commands\command.py", line 448, in execute
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]     result = omni.kit.undo.execute(command, name, kwargs)
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 74, in execute
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]     result = _execute(command, name, level, history_key)
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo] [...skipped...]
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 311, in _execute
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]     last_entry.command.undo()
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.commands-1.4.14-5.1\omni\physxcommands\__init__.py", line 215, in undo
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]     DeletePrimsCommand([self._actPath]).do()
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo] 
2022-09-02 21:55:49  [Error] [omni.kit.undo.undo]  <class 'AttributeError'> 'AddGroundPlaneCommand' object has no attribute '_actPath'
2022-09-02 21:55:49  [Error] [omni.kit.commands.command] Failed to execute a command: AddGroundPlaneCommand.
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.ui-1.4.14-5.1\omni\physxui\scripts\menu.py", line 146, in <lambda>
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]     "onclick_fn": lambda *_: self._on_create_ground_plane()
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.ui-1.4.14-5.1\omni\physxui\scripts\menu.py", line 301, in _on_create_ground_plane
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]     commands.AddGroundPlaneCommand.execute(stage, "/GroundPlane", upAxis, 25.0 * scaleFactor, Gf.Vec3f(0.0), Gf.Vec3f(0.5))
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.commands-1.4.14-5.1\omni\physxcommands\__init__.py", line 36, in execute
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]     return execute(cls.__name__, **bound.kwargs)
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\commands\command.py", line 448, in execute
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]     result = omni.kit.undo.execute(command, name, kwargs)
2022-09-02 21:55:49  [Error] [omni.kit.commands.command] [...skipped...]
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 74, in execute
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]     result = _execute(command, name, level, history_key)
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 335, in _execute
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]     raise error
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 295, in _execute
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]     kwargs = get_history_item(history_key).kwargs
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\history.py", line 88, in get_history_item
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]     return _history[history_key]
2022-09-02 21:55:49  [Error] [omni.kit.commands.command] 
2022-09-02 21:55:49  [Error] [omni.kit.commands.command]  <class 'KeyError'> 18

Note that this is on a completely fresh launch of Code in a new, empty scene.

I suspect it has something to do with the extension’s use of omni.kit.commands.execute, specifically a problem with the command history as the error states that the program “Failed to undo a command.” However, I disabled all the extensions I was working on and uninstalled/reinstalled Code from the launcher, and it didn’t fix the problem.

I also can’t make a vehicle with the vehicle wizard either; it gives me the following error (also on a fresh launch of Code):

2022-09-02 22:07:50  [Error] [omni.kit.undo.undo] Failed to undo a command: PhysXVehicleWizardCreateCommand.
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.vehicle-1.4.14-5.1\omni\physxvehicle\scripts\wizards\vehicleWizardBasics.py", line 536, in _on_create_clicked
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]     self._wizard.create_vehicle_command()
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.vehicle-1.4.14-5.1\omni\physxvehicle\scripts\wizards\physxVehicleWizard.py", line 708, in create_vehicle_command
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]     (success, (messageList, scenePath)) = commands.PhysXVehicleWizardCreateCommand.execute(self.vehicleDataManager.vehicleData)
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.commands-1.4.14-5.1\omni\physxcommands\__init__.py", line 36, in execute
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]     return execute(cls.__name__, **bound.kwargs)
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\commands\command.py", line 448, in execute
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]     result = omni.kit.undo.execute(command, name, kwargs)
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 74, in execute
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]     result = _execute(command, name, level, history_key)
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo] [...skipped...]
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 316, in _execute
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]     history_entry = get_history_item(last_entry.history_key)
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\history.py", line 88, in get_history_item
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]     return _history[history_key]
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo] 
2022-09-02 22:07:50  [Error] [omni.kit.undo.undo]  <class 'KeyError'> 19
2022-09-02 22:07:50  [Error] [omni.kit.commands.command] Failed to execute a command: PhysXVehicleWizardCreateCommand.
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.vehicle-1.4.14-5.1\omni\physxvehicle\scripts\wizards\vehicleWizardBasics.py", line 536, in _on_create_clicked
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]     self._wizard.create_vehicle_command()
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.vehicle-1.4.14-5.1\omni\physxvehicle\scripts\wizards\physxVehicleWizard.py", line 708, in create_vehicle_command
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]     (success, (messageList, scenePath)) = commands.PhysXVehicleWizardCreateCommand.execute(self.vehicleDataManager.vehicleData)
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.commands-1.4.14-5.1\omni\physxcommands\__init__.py", line 36, in execute
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]     return execute(cls.__name__, **bound.kwargs)
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\commands\command.py", line 448, in execute
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]     result = omni.kit.undo.execute(command, name, kwargs)
2022-09-02 22:07:50  [Error] [omni.kit.commands.command] [...skipped...]
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 74, in execute
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]     result = _execute(command, name, level, history_key)
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 335, in _execute
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]     raise error
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\undo.py", line 295, in _execute
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]     kwargs = get_history_item(history_key).kwargs
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]   File "c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extscore\omni.kit.commands\omni\kit\undo\history.py", line 88, in get_history_item
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]     return _history[history_key]
2022-09-02 22:07:50  [Error] [omni.kit.commands.command] 
2022-09-02 22:07:50  [Error] [omni.kit.commands.command]  <class 'KeyError'> 19
2022-09-02 22:07:50  [Error] [omni.ui.python] TypeError: cannot unpack non-iterable NoneType object
2022-09-02 22:07:50  [Error] [omni.ui.python] 
2022-09-02 22:07:50  [Error] [omni.ui.python] At:
2022-09-02 22:07:50  [Error] [omni.ui.python]   c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.vehicle-1.4.14-5.1\omni\physxvehicle\scripts\wizards\physxVehicleWizard.py(708): create_vehicle_command
2022-09-02 22:07:50  [Error] [omni.ui.python]   c:\users\labuser\appdata\local\ov\pkg\code-2022.1.3\kit\extsphysics\omni.physx.vehicle-1.4.14-5.1\omni\physxvehicle\scripts\wizards\vehicleWizardBasics.py(536): _on_create_clicked
2022-09-02 22:07:50  [Error] [omni.ui.python] 

Fortunately, these errors don’t happen in Create; the problem seems to be something wrong specifically in the Code installation. I assume that if I wipe all of the local Code files it will fix the problem, but I don’t want to mess the installation up further by failing to remove all the files properly. Is there a proper way to perform a clean install of Code? Furthermore, what would I have done wrong in the first place to cause this problem? Thanks!

Hi, can you please provide full log from startup until the error? Thanks!
Also, local settings (on Windows) can be found in C:\Users\username\AppData\Local\ov\data\Kit\Code. Can you also attach the content of that folder? As far as cleanup you can then try to delete that to see if it fixes your issue.

Log File (I got this by clicking the “Open Log File” button in Code):

kit_20220906_155904.log (761.8 KB)

Folder Content:

2022.1.zip (78.0 MB)

Deleting the folder did seem to fix things from what I can tell. Thank you very much!

EDIT: Reading the log file, It looks like I forgot to disable one of the custom extensions we had enabled, but given that it was most likely enabled since the beginning of the summer with no noticeable problems, I don’t think it was responsible for the problematic behavior.