"Unable to parse YAML file" error

I sometimes get the error “Unable to parse YAML file: [could not find expected ‘:’] at line 2”. Is there a way I can figure out what file is causing this error? Thanks!

YAML is the format used by text versions of scenes. See:

I know it’s used by text version of scenes, but we’ve got Asset Serialization Mode set to Mixed, and scenes are saving as .unity and .unity.meta files. It’s a large project with lots of files… how would I locate the two files (it always appears twice when it does appear) that have the glitch? Clicking on the error message doesn’t do anything. There’s no indication anywhere what file actually contains the error. That’s what I’m trying to figure out. If I could find the file causing the problem, I could probably fix the problem.

We are also seeing this issue. A lot.

We realise it’s because YAML is used for scenes. But the error doesn’t say what file it is unable to parse. That would be useful to know.

+1 for letting us know which file is causing the error.

1 Like

Ya, the only solution I’ve found is to save everything and then reboot unity. I’m guessing it reformats the YAML files… but ya… preeeetty lame.

You should go thoug all of your .meta files and search for git or svn conflicts.
Here is small description and script in ruby to help you with that

Simply search for the occurrence of “<<<<” in your ‘.meta’ files; it is caused by merging improperly in GIT as mentioned before.

1 Like

[I know its an old thread and not specific to the Unity 5.0 Beta]
I do have this issue with Unity 5.0 RC2, everytime i open my project it gives me this error with no further explanation:
Unable to parse YAML file: [Control characters are not allowed] at line 0
The project is a little big to report a bug with the project, what can possibly cause this?

I have discovered since discovering this post that any syntax error in your yaml will cause this. It’s just a generall error message stating something is wrong. Version control merge conflicts seem to be the most common way of getting this. As stated above, do a search for either “===” or “<<<<” within the yaml file. I also found that (after verifying the object and scene has been saved) deleting the yaml file experiencing the conflict will cause Unity to attempt to generate a new one, as if it was a newly generated asset. This newly generated asset won’t have conflicts.

We had this just earlier, once each on a single Git pull, the first of the day on scenes. No idea why as our scenes are all binary (and still are, having checked). The only thing different to normal is we moved from 4.6.1f1 to 4.6.3f1 this morning.

A quick review of the logs, and it appears the errors were being spawned from mp3 files, not scenes.

Hasn’t happened again, but at least I’ve something to bugette now.

I believe that regardless of how you have asset serialization there’s still meta files generated that git will try to merge. It’s normal behaviour is to ignore changes made to the same section of a file, leaving a conflict. I could be wrong but I suspect that may be what’s happening?

That crossed my mind, though YAML is supposed to refer to scene files, not assets (if the editor log is anything to go by). Hasn’t happened again anyway, and didn’t do any damage that we can find. I dunno, Yesterday just didn’t want to work. Even our Cloud Builds sat in a Restart loop for four hours until we switched from ILCPP to mono…life :stuck_out_tongue:

This still happens on 4.6.6x

STILL HAPPENS >:[

1 Like

Close Unity and from explorer search all .meta files and delete them. Now open the Unity. Works perfectly.

delete Library folder and open unity, it let unity remakes Library folder. and reopen unity, it fixed for my case.

Get it 100% of the time when creating a new blank Unity project in 5.3.3 and when I open previous projects. Deleting Library directory does nothing except waste precious time!

Does UT have an answer/suggestion?

PS. does seem harmless but who knows with Unity!

+1
This is happening all the time in Unity 5.3.4p1