Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

"Unable to parse YAML file" error

Discussion in 'Editor & General Support' started by mantler, Feb 21, 2014.

  1. mantler

    mantler

    Joined:
    Oct 30, 2013
    Posts:
    47
    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!
     
  2. Graham-Dunnett

    Graham-Dunnett

    Administrator

    Joined:
    Jun 2, 2009
    Posts:
    4,287
  3. mantler

    mantler

    Joined:
    Oct 30, 2013
    Posts:
    47
    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.
     
  4. benhumphreys

    benhumphreys

    Joined:
    Jan 20, 2013
    Posts:
    30
    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.
     
  5. mantler

    mantler

    Joined:
    Oct 30, 2013
    Posts:
    47
    +1 for letting us know *which* file is causing the error.
     
    bfreitag likes this.
  6. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    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.
     
  7. drussilla

    drussilla

    Joined:
    Mar 20, 2014
    Posts:
    9
    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
     
  8. serseralci

    serseralci

    Joined:
    Nov 24, 2012
    Posts:
    5
    Simply search for the occurrence of "<<<<" in your '.meta' files; it is caused by merging improperly in GIT as mentioned before.
     
    JonnyHilly likes this.
  9. shkar-noori

    shkar-noori

    Joined:
    Jun 10, 2013
    Posts:
    833
    [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?
     
  10. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    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.
     
  11. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    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.
     
  12. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    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.
     
  13. jtsmith1287

    jtsmith1287

    Joined:
    Aug 3, 2014
    Posts:
    787
    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?
     
  14. Pix10

    Pix10

    Joined:
    Jul 21, 2012
    Posts:
    850
    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 :p
     
  15. MrEsquire

    MrEsquire

    Joined:
    Nov 5, 2013
    Posts:
    2,712
    This still happens on 4.6.6x
     
  16. cryptoforge

    cryptoforge

    Joined:
    Jan 21, 2015
    Posts:
    60
    STILL HAPPENS >:[
     
    pangotraudbhav likes this.
  17. gulfam131

    gulfam131

    Joined:
    Aug 1, 2013
    Posts:
    10
    Close Unity and from explorer search all .meta files and delete them. Now open the Unity. Works perfectly.
     
  18. SAM-tak

    SAM-tak

    Joined:
    May 14, 2014
    Posts:
    7
    delete Library folder and open unity, it let unity remakes Library folder. and reopen unity, it fixed for my case.
     
  19. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    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!
     
  20. peterahou

    peterahou

    Joined:
    May 19, 2015
    Posts:
    53
    +1
    This is happening all the time in Unity 5.3.4p1
     
  21. yakm

    yakm

    Joined:
    Sep 12, 2014
    Posts:
    24
    +1
    This is happening all the time in Unity 5.3.4p1 for me too, i have "force text" enabled
     
  22. thylaxene

    thylaxene

    Joined:
    Oct 10, 2005
    Posts:
    716
    From what I can see (in my case) it is related to the opening splash screen when Unity launches. Not the projects themselves. As I get the same error with a brand new project with nothing in it. No scene files etc.

    So I'm ignoring it...
     
  23. taxvi

    taxvi

    Joined:
    Feb 18, 2013
    Posts:
    30
    Same: 5.3.5f1 here. Created blank project:
    Code (CSharp):
    1. Unable to parse YAML file: [Control characters are not allowed] at line 0
    checked release notes of patched releases till 5.3.5p3. Non of them have a fix for now.
     
  24. JonnyHilly

    JonnyHilly

    Joined:
    Sep 4, 2009
    Posts:
    749
    THIS ^^^
     
  25. Deleted User

    Deleted User

    Guest

    Just happened to me after a merge conflict using Git. The conflict turned out to be in ProjectSettings/ProjectVersion.txt
     
    Ultroman likes this.
  26. HankDeTank05

    HankDeTank05

    Joined:
    Feb 15, 2017
    Posts:
    1
    so, how did you fix it...? I tried to change the version number in the .txt file but I "didn't have permission" to save the changes
     
  27. whizzkid

    whizzkid

    Joined:
    Nov 2, 2016
    Posts:
    8
    Still having this problem with 5.5.1p4 5.5.2p1 5.6.0b10

    I removed the entire unity folder from my appdata. start unity, create new project. bam, yaml problem is there..

    heres the logfile
    (fun detail, editor is 5.5.2p1 while a bit further down unity says its 5.3.0



    Code (csharp):
    1.  
    2. LICENSE SYSTEM [201738 13:21:55] Next license update check is after 2017-03-09T10:16:49
    3.  
    4. Built from '5.5/patch-release' branch; Version is '5.5.2p1 (9360c5517afe) revision 9658565'; Using compiler version '160040219'
    5. OS: 'Windows 7 Service Pack 1 (6.1.7601) 64bit' Language: 'en' Physical Memory: 24575 MB
    6. BatchMode: 0, IsHumanControllingUs: 1, StartBugReporterOnCrash: 1, Is64bit: 1, IsPro: 1
    7. Initialize mono
    8. Mono path[0] = 'C:/Program Files/Unity552p1/Editor/Data/Managed'
    9. Mono path[1] = 'C:/Program Files/Unity552p1/Editor/Data/Mono/lib/mono/2.0'
    10. Mono path[2] = 'C:/Program Files/Unity552p1/Editor/Data/UnityScript'
    11. Mono config path = 'C:/Program Files/Unity552p1/Editor/Data/Mono/etc'
    12. Using monoOptions --debugger-agent=transport=dt_socket,embedding=1,defer=y,address=0.0.0.0:56612
    13. ListPackages failed, output: {
    14.   "name": "unity-editor",
    15.   "version": "5.3.0",
    16.   "problems": [
    17.     "invalid: unity-editor-home@0.6.17 C:\\Users\\MY_USER_NAME\\AppData\\Roaming\\Unity\\Packages\\node_modules\\unity-editor-home",
    18.     "invalid: unityeditor-collab-history@0.6.10 C:\\Users\\MY_USER_NAME\\AppData\\Roaming\\Unity\\Packages\\node_modules\\unityeditor-collab-history",
    19.     "invalid: unityeditor-collab-toolbar@0.6.15 C:\\Users\\MY_USER_NAME\\AppData\\Roaming\\Unity\\Packages\\node_modules\\unityeditor-collab-toolbar"
    20.   ],
    21.   "dependencies": {
    22.     "unity-editor-home": {
    23.       "version": "0.6.17",
    24.       "from": "unity-editor-home.0.6.17.tgz",
    25.       "resolved": "file:unity-editor-home.0.6.17.tgz",
    26.       "invalid": true,
    27.       "problems": [
    28.         "invalid: unity-editor-home@0.6.17 C:\\Users\\MY_USER_NAME\\AppData\\Roaming\\Unity\\Packages\\node_modules\\unity-editor-home"
    29.       ]
    30.     },
    31.     "unityeditor-collab-history": {
    32.       "version": "0.6.10",
    33.       "from": "unityeditor-collab-history.0.6.10.tgz",
    34.       "resolved": "file:unityeditor-collab-history.0.6.10.tgz",
    35.       "invalid": true,
    36.       "problems": [
    37.         "invalid: unityeditor-collab-history@0.6.10 C:\\Users\\MY_USER_NAME\\AppData\\Roaming\\Unity\\Packages\\node_modules\\unityeditor-collab-history"
    38.       ]
    39.     },
    40.     "unityeditor-collab-toolbar": {
    41.       "version": "0.6.15",
    42.       "from": "unityeditor-collab-toolbar.0.6.15.tgz",
    43.       "resolved": "file:unityeditor-collab-toolbar.0.6.15.tgz",
    44.       "invalid": true,
    45.       "problems": [
    46.         "invalid: unityeditor-collab-toolbar@0.6.15 C:\\Users\\MY_USER_NAME\\AppData\\Roaming\\Unity\\Packages\\node_modules\\unityeditor-collab-toolbar"
    47.       ]
    48.     },
    49.     "unityeditor-cloud-hub": {
    50.       "version": "0.0.15",
    51.       "from": "unityeditor-cloud-hub-0.0.15.tgz",
    52.       "resolved": "file:unityeditor-cloud-hub-0.0.15.tgz"
    53.     }
    54.   }
    55. }
    56.  
    57. Unable to parse YAML file: [mapping values are not allowed in this context] at line 1
    58.  
    59.  
    60. (Filename: C:\buildslave\unity\build\Runtime/Serialize/TransferFunctions/YAMLRead.cpp Line: 180)
    61.  
    62. Unable to parse YAML file: [mapping values are not allowed in this context] at line 1
    63.  
    64.  
    65. (Filename: C:\buildslave\unity\build\Runtime/Serialize/TransferFunctions/YAMLRead.cpp Line: 180)
    66.  
    67. IsTimeToCheckForNewEditor: Update time 1488978151 current 1488975872
    68. Unable to parse YAML file: [mapping values are not allowed in this context] at line 1
    69.  
    70.  
    71. (Filename: C:\buildslave\unity\build\Runtime/Serialize/TransferFunctions/YAMLRead.cpp Line: 180)
    72.  
    73.  
     
  28. voldemarz

    voldemarz

    Joined:
    Sep 19, 2011
    Posts:
    25
    In my case the problem NUL control characters at the end of meta files of two materials which was reserialized after upgrading from Unity 5.5.1f1 to Unity 5.6.3.
     
  29. AccentDave

    AccentDave

    Joined:
    Nov 16, 2015
    Posts:
    43
    2017.2.1 and it still happens, and I'm talking an new empty project. Right? No assets, no Git. Create empty new project, see errors.
     
  30. toon159

    toon159

    Joined:
    Nov 30, 2017
    Posts:
    1
    2017.3.1f1 I got this problem
     
  31. FlyingKiwi

    FlyingKiwi

    Joined:
    Jun 14, 2013
    Posts:
    12
    Same. Maybe file a bugreport?
     
  32. snarlynarwhal

    snarlynarwhal

    Joined:
    Jan 16, 2014
    Posts:
    30
    Four years later and still not addressed? I guess Unity expects us to just ignore it though I do not find that an acceptable solution.
     
  33. Dam-Pete

    Dam-Pete

    Joined:
    Jun 11, 2010
    Posts:
    54
    I get this error even when I create a brand new project from scratch. On whichever version of Unity, just happened on a fresh install of Unity 2018.2 beta on a brand new project. Twice, as always, except apparently now they let us know which file causes the problem, in my case: ProjectSettings/ProjectVersion.txt. Opening the file however gives me no indication of any problems, as it has this single line:
    m_EditorVersion: 2018.2.0b1
     
  34. FlyingKiwi

    FlyingKiwi

    Joined:
    Jun 14, 2013
    Posts:
    12
    Same thing here, Unity 2018.1.b13
     
  35. better_walk_away

    better_walk_away

    Joined:
    Jul 12, 2016
    Posts:
    291
    Still happen on 2017.4.0f1, I created a brand new project, then I got this error.
     
  36. Phoera

    Phoera

    Joined:
    Mar 10, 2015
    Posts:
    9
    Still in 2018.1.5
     
  37. Fr0stst0rm42

    Fr0stst0rm42

    Joined:
    Sep 26, 2015
    Posts:
    6
    You really have to find all mege conflicts in everey .meta file and in every .txt file in ALL your projects. Even if the project has nothing to do with your current project.
     
    Last edited: Aug 5, 2018
  38. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    Elaborate. Meta files and library data is not shared between projects.
     
  39. Dam-Pete

    Dam-Pete

    Joined:
    Jun 11, 2010
    Posts:
    54
    Not saying you're wrong... But that makes no sense to me. If that is in fact true, I'd rather just press "Clear" every time I open Unity instead of scouring through all my projects.
     
  40. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    It is not true.
     
  41. Fr0stst0rm42

    Fr0stst0rm42

    Joined:
    Sep 26, 2015
    Posts:
    6
    I don't know how Unity handles Meta files between different projects, but I had this error in all my projects including newly created ones.

    I used the "find in files" function in Notepad++ to search in all .meta files in my "Unity Projects" folder which showd me merge conflicts in 1 of my 14 projects. (I simply searched for "<<<<<<"). I fixed all merge conflicts I found and voila! No annoying yaml errors appered ever again. :D

    So it's definitely true, at least in my case.
     
  42. TornWorm

    TornWorm

    Joined:
    Oct 12, 2018
    Posts:
    1
    Oh it's an old friend.Let's clear it ahhhh..
     
  43. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    Unity really does not handle meta files between projects and it is not really supposed to touch files outside the project you are opening either. If it does in any way, that is a serious bug, you should reproduce and report it, as something is very not right. You can check what files it opens on launch with http://www.nirsoft.net/utils/process_activity_view.html, if you see anything unexpected then report the bug. I did attempt to myself, even injected the usual <<<<<< in various assets and meta files across multiple test projects and it did not access any of them.

    The only files it does open across "all" projects are ProjectSettings.asset and ProjectVersion.txt files for every project that is in the recently opened projects, when the select project dialog opens on launch. That will cause those errors if there are merge conflicts in any of those files, but none of the other ones that I could find.

    It's not that I don't believe what you are saying, I just think that the workaround you are applying is masking what is really occurring and that you should investigate more fully and report it to Unity.
     
    blackstaffgames likes this.
  44. blackstaffgames

    blackstaffgames

    Joined:
    Jul 10, 2014
    Posts:
    19
    [RESOLVED] Because this is the top search on Google, confirming fix for this.

    This was caused in our project due to an unresolved merge conflict in ProjectSettings\ProjectVersion.txt.
    (ie <<<<<<<)

    Remove merge conflict lines and problem resolves.

    If you have a merge conflict in ANY ProjectVersion.txt in your recently opened projects the error will appear. Check this file in your other projects and fix as above to remove error across all.

    What is likely happening is the error is happening in the "Projects" pop up when you first open unity, but then doesn't display until you select and open a project.
     
    Ony and AlkisFortuneFish like this.
  45. AlkisFortuneFish

    AlkisFortuneFish

    Joined:
    Apr 26, 2013
    Posts:
    970
    Cool, cheers for getting to the bottom of this! I have an aversion towards solutions that make no sense and moving on without getting to the true cause of problems, as it usually results in problems down the line.
     
  46. AnomalusUndrdog

    AnomalusUndrdog

    Joined:
    Jul 3, 2009
    Posts:
    1,551
    For me this happened because the project had meta files whose contents are all just repeated null characters inside. Supposedly this happens if you get a power failure/cutoff while a file is open, and I do have a teammate whose old laptop keeps turning off on its own, and he inadvertently added those files to the repository. I suppose the best thing to do in such cases is to delete those affected meta files and let Unity recreate them, if no backup can be retrieved from version control.
     
    lrb likes this.