IDE hangs on startup: "Error: reading inventory file: While parsing config: yaml: control characters are not allowed"

Can you help, My IDE 2.1.1 is also locking up on startup. this is what I get...

pl.js:177:42) at Socket.emit (node:events:394:28) at addChunk (node:internal/streams/readable:312:12) at readableAddChunk (node:internal/streams/readable:287:9) at Socket.Readable.push (node:internal/streams/readable:226:10) at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) 2023-07-22T16:58:56.856Z daemon INFO Starting daemon from C:\Program Files\Arduino IDE\resources\app\node_modules\arduino-ide-extension\build\arduino-cli.exe... 2023-07-22T16:58:56.863Z daemon INFO Daemon exited with exit code: 7. 2023-07-22T16:58:56.926Z daemon INFO Error: reading inventory file: While parsing config: yaml: control characters are not allowed 2023-07-22T16:58:56.927Z daemon ERROR Error: Error: reading inventory file: While parsing config: yaml: control characters are not allowed at Socket.<anonymous> (C:\Program Files\Arduino IDE\resources\app\node_modules\arduino-ide-extension\lib\node\arduino-daemon-impl.js:177:42) at Socket.emit (node:events:394:28) at addChunk (node:internal/streams/readable:312:12) at readableAddChunk (node:internal/streams/readable:287:9) at Socket.Readable.push (node:internal/streams/readable:226:10) at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) 2023-07-22T16:58:56.928Z daemon INFO Starting daemon from C:\Program Files\Arduino IDE\resources\app\node_modules\arduino-ide-extension\build\arduino-cli.exe... 2023-07-22T16:58:56.935Z daemon INFO Daemon exited with exit code: 7. 2023-07-22T16:58:57.000Z daemon INFO Error: reading inventory file: While parsing config: yaml: control characters are not allowed 2023-07-22T16:58:57.001Z daemon ERROR Error: Error: reading inventory file: While parsing config: yaml: control characters are not allowed at Socket.<anonymous> (C:\Program Files\Arduino IDE\resources\app\node_modules\arduino-ide-extension\lib\node\arduino-daemon-impl.js:177:42) at Socket.emit (node:events:394:28) at addChunk (node:internal/streams/readable:312:12) at readableAddChunk (node:internal/streams/readable:287:9) at Socket.Readable.push (node:internal/streams/readable:226:10) at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) 2023-07-22T16:58:57.002Z daemon INFO Starting daemon from C:\Program Files\Arduino IDE\resources\app\node_modules\arduino-ide-extension\build\arduino-cli.exe... 2023-07-22T16:58:57.010Z daemon INFO Daemon exited with exit code: 7. 2023-07-22T16:58:57.075Z daemon INFO Error: reading inventory file: While parsing config: yaml: control characters are not allowed 

I do not know how many YAML files the IDE uses. I'm aware of one.

Close the IDE.

Search your installation directory for arduino-cli.yaml and rename it. I don't have an installation that uses your installation directory; if you can't find it, you can look if you have the file in C:\Users\yourUsername\.arduinoIDE.

Start the IDE; it will create a new YAML file that should not be corrupt.

Note:
You will loose additional board urls if you already had them from a previous 2.x installation.

Thats strange, I just searched the C Drive and no file found. Is it possible that IDE is not able to write the file?

.arduinoIDE is shown as read only. I cant undo this? I am sure I am Administrator?

That seems normal

Question is if the YAML file is there?

No only files shown are Localization-cache and plugin-storage. plugin is empty. localization has files marked bg, cs etc

aaa

It seems that IDE is trying to write files to .arduinoIDE but is not able too? It then locks up.

Hi @Peterpurr. It seems that one of the data files used by Arduino IDE somehow became corrupted. The fix will be to manually delete the file at this path.

Please try this:

  1. Close the Arduino IDE window if it is still running.
  2. Delete the file at the following path on your computer:
    C:\Users\<username>\AppData\Local\Arduino15\inventory.yaml 
    (where <username> is your Windows username)
    :exclamation: If looking for it with your file manager or command line, note that the AppData folder is hidden by default. On Windows "File Explorer", you can make it visible by opening the "View" menu, then checking the box next to "☐ Hidden items".
  3. Start Arduino IDE again, as you did before.

Hopefully this time the IDE will be able to start up successfully.

Brilliant, that was the fix. Really appreciate your help. All working now. Peter

You are welcome. I'm glad it is working now.

The Arduino developers recently made the system resilient to the corruption of this file:

That change hasn't yet propagated into Arduino IDE, but a future release of the IDE will no longer be subject to these hangs when something like this happens. The reports of this problem occurring are very rare so I would guess you won't run into it again anyway.

Regards,
Per

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.