Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

warning: <x> FS.syncfs operations in flight at once, probably just doing extra work

Discussion in 'WebGL' started by Aurigan, Dec 21, 2016.

  1. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    290
    I'm getting an old game running on webGL for the first time ever, using Unity 5.5p1. So far I have everything working but the (chrome) console every 8 seconds is spitting out 3 warnings:

    warning: 2 FS.syncfs operations in flight at once, probably just doing extra work
    warning: 3 FS.syncfs operations in flight at once, probably just doing extra work
    warning: 4 FS.syncfs operations in flight at once, probably just doing extra work

    From a quick google search FS.syncfs appears to be something to do with the javascript / indexed db filesystem so presumably *something* is doing a file op 4x at the same time ... I have no idea what that might be though, still happens after disabling save games (which use player prefs).

    Has anyone seen this / have a solution for it?
     
    twobob likes this.
  2. Arsinx

    Arsinx

    Joined:
    Apr 14, 2014
    Posts:
    55
    I recently built a game for webgl using 5.5 and i am getting the same warnings as soon as the unity logo appears after which it gets stuck there, if any one knows how to solve this issue it will be really appreciated.
     
    twobob likes this.
  3. DSL-TailorIt

    DSL-TailorIt

    Joined:
    Jan 2, 2017
    Posts:
    6
    This warning also appears in my builds, although it doesn't prevent me from actually using my application.

    In my case I think it might have something to do with loading AssetBundles, but I haven't verified it yet.

    I worry more about warnings than actual errors, so if anyone knows something about this, I would be also be thankful to get some possible solution.

    Thanks in advance :)
     
    twobob likes this.
  4. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    290
    bump! getting this in a completely new game also
     
    twobob likes this.
  5. Schubkraft

    Schubkraft

    Unity Technologies

    Joined:
    Dec 3, 2012
    Posts:
    1,054
    This seems to be harmless, we'll look into it though.
     
    XUJIE_HAH, twobob, Zaelot and 2 others like this.
  6. Aurigan

    Aurigan

    Joined:
    Jun 30, 2013
    Posts:
    290
    Thank you - it DOES appear to be harmless in practice but vexing to have unneeded log spam.
     
    twobob likes this.
  7. AzureByte

    AzureByte

    Joined:
    Apr 25, 2017
    Posts:
    2
    For me I think this is a symptom of another problem. I am getting random fps drops throughout the game while running a WebGL build in browser. No performance issues on mobile/PC builds
     
  8. 3DNewsman

    3DNewsman

    Joined:
    Nov 3, 2012
    Posts:
    13
    Bumping this. We've had it on our app for a long time, and seems like it would be helpful to get to the bottom of it.
     
    twobob likes this.
  9. therealao

    therealao

    Joined:
    Feb 13, 2017
    Posts:
    5
    Bump, I've a feeling this is causing some performance issues. I'm only getting about 25% of the framerate of a native x86-64 build in WebGL, for a much smaller scene.. Any insight would be greatly appreciated
     
  10. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    how many "FS.syncfs operations..." warnings are you seeing? just a few or a continuous flow?

    The gap in performance might be simply be caused by the fact that Unity WebGL is single-threaded at the moment.
     
    twobob likes this.
  11. hromoyDron

    hromoyDron

    Joined:
    Jan 24, 2013
    Posts:
    90
    I have the same message (unity 2017.3)

    When I start using AssetBundleManager I see much more warnings

    What to do?
     
  12. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    If everything works well, do nothing :)
     
    hromoyDron likes this.
  13. keeves_test14

    keeves_test14

    Joined:
    Dec 5, 2016
    Posts:
    13
    Hi, I'm using unity 5.6.3f3 and when I run webgl build I'm getting the following warning.

    warning: 2 FS.syncfs operations in flight at once, probably just doing extra work.

    I've AI player in my game,when AI turn occurs, the warning is occured and ai player can't take its move for this.Please help me to solve the issue.
     
    twobob likes this.
  14. ProgrammingWhileSleeping

    ProgrammingWhileSleeping

    Joined:
    Nov 10, 2017
    Posts:
    17
    Hi, I have found a solution but I'm not sure I could say this is a great one, it would disable all the logging and it would only work for WebGL. Just add these lines of code before the game is instantiated.


    var DEBUG = false;
    if(!DEBUG){
    if(!window.console) window.console = {};
    var methods = ["log", "debug", "warn", "info"];
    for(var i=0;i<methods.length;i++){
    console[methods] = function(){};
    }
    }

    Source: https://stackoverflow.com/questions...disable-all-console-log-statements-in-my-code

    WARNING: This will completely remove all console logs, so if you have any intended clues for the game in the logs, then it would not be recommended.
     
    twobob likes this.
  15. ProgrammingWhileSleeping

    ProgrammingWhileSleeping

    Joined:
    Nov 10, 2017
    Posts:
    17
    Full code in case anyone gets confused with my answer, just replace your index.html code with this:

    <!DOCTYPE html>
    <html lang="en-us">
    <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Unity WebGL Player | Your Title</title>
    <link rel="shortcut icon" href="TemplateData/favicon.ico">
    <link rel="stylesheet" href="TemplateData/style.css">
    <script src="TemplateData/UnityProgress.js"></script>
    <script src="Build/UnityLoader.js"></script>
    <script>
    var DEBUG = false;
    if(!DEBUG){
    if(!window.console) window.console = {};
    var methods = ["log", "debug", "warn", "info"];
    for(var i=0;i<methods.length;i++){
    console[methods] = function(){};
    }
    }
    var gameInstance = UnityLoader.instantiate("gameContainer", "Build/Your Title.json", {onProgress: UnityProgress});
    </script>
    </head>
    <body>
    <div class="webgl-content">
    <div id="gameContainer" style="width: 960px; height: 600px"></div>
    <div class="footer">
    <div class="webgl-logo"></div>
    <div class="fullscreen" onclick="gameInstance.SetFullscreen(1)"></div>
    <div class="title">Your Title</div>
    </div>
    </div>
    </body>
    </html>
     
    twobob and unknownsk like this.
  16. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058
    Hmmm.. this seems like a nothing error all in. that said. Roll-on threading

    EDIT: and yes, I have it too
     
  17. VMS_Lab

    VMS_Lab

    Joined:
    Dec 31, 2013
    Posts:
    3
    I think this error is related to my game crashing in WebGL. When I do a build with No Exceptions enabled my the game crashes in the browser. When I do a build with Full Exceptions enabled this error is the first pop up and and the game loads fine. No other exceptions are thrown. Could this error cause a game to crash?
     
  18. emirkoskenli

    emirkoskenli

    Joined:
    Oct 7, 2018
    Posts:
    5
    Looks like this error causing high CPU usage and my game getting slower in time. It is continuous flow at console.
    "warning: 65 FS.syncfs operations in flight at once, probably just doing extra work"
    Spammed this error like 60-100 times in a minute. Searched google but no luck.
     
  19. hsallander

    hsallander

    Joined:
    Dec 19, 2013
    Posts:
    41
    Hi all, we're seeing this issue as well in our WebGL game, using Unity 2019.2. Any progress on this issue, or a workaround we can use, @Marco-Trivellato or @Schubkraft ?
     
  20. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    830
    FS.syncfs() is triggered by a call that either saves or loads persistent content to IndexedDB. I am not sure exactly which all Unity APIs can trigger this, but look for a connection with PlayerPrefs, writing to disk/filesystem or asset bundles.

    The warning itself is not about anything bad/incorrect happening, but it is a performance warning of redundant work that occurs - a previous save/load operation has not yet finished, but a new save/load operation is already being attempted.
     
  21. TheJimz

    TheJimz

    Joined:
    Jun 26, 2015
    Posts:
    50
    Sounds like this warning itself is causing a lot more slowdown than what it's warning about. Can we please disable it?
     
  22. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    830
    You can disable the warning by editing C:\Program Files\Unity\Hub\Editor\<unity_version>\Editor\Data\PlaybackEngines\WebGLSupport\BuildTools\Emscripten\src\library_fs.js around line ~496, delete line

    console.log('warning: ' + FS.syncFSRequests + ' FS.syncfs operations in flight at once, probably just doing extra work');
     
    adamgolden and twobob like this.
  23. forzabo

    forzabo

    Joined:
    Aug 28, 2015
    Posts:
    47
    For any one on macOS (like me) wondering where this file is:

    /Applications/Unity/PlaybackEngines/WebGLSupport/BuildTools/Emscripten/src/library_fs.js

    Commenting out lines 495-497 does the trick.
     
  24. dblaw

    dblaw

    Joined:
    Oct 16, 2020
    Posts:
    9
    As a potential help to others who may be googling this:

    I had the same problem. Things fine in the editor, crash in WebGL, when turning on the warnings things worked fine with the error "FS.syncfs operations" as described here.

    I had been using a .Find on a game object (I know I know). But, that game object was not there because I had moved things around and renamed stuff. Getting rid of my bad .Find fixed things right up. Really wish there would have been some kind of error telling me what I had done.
     
  25. salqadri

    salqadri

    Joined:
    Nov 1, 2013
    Posts:
    7
    I see this warning as well. If this should not be a warning, how about not use the word 'warning' in the log, or better yet, how about Unity get rid of that message unless you can give concrete documentation on why this message is something we should act on and how.
     
  26. twobob

    twobob

    Joined:
    Jun 28, 2014
    Posts:
    2,058

    HOW ABOUT YOU READ UP - ABOUT 3 MESSAGES.
    since we all so keen to be shoutily telling other what to do.


    jukka_j

    Unity Technologies

    States very clearly what it is - why it is - and what you can do.
     
  27. mickfcna

    mickfcna

    Joined:
    May 13, 2019
    Posts:
    46
    Got the same error on Unity 2019.4, any update ?
     
  28. sebj

    sebj

    Joined:
    Dec 4, 2013
    Posts:
    67
    In our game, the number of FS.syncFSRequests increases continuously (up to the thousands over an hour or so). Is that also expected or are we leaking something?
     
  29. EduTech_dev

    EduTech_dev

    Joined:
    Oct 13, 2022
    Posts:
    1
    I solved the issue by just limiting the FPS to 30p/second.

    Application.targetFrameRate = targetFrameRate;
     
  30. ExNinja

    ExNinja

    Joined:
    Dec 4, 2013
    Posts:
    26
  31. kenorbik

    kenorbik

    Joined:
    Jan 9, 2023
    Posts:
    6
    Same warning, and nothing loads, stuck on the black screen.

    Code (Boo):
    1. Initialize engine version: 2021.3.16f1 (4016570cf34f)
    2. [UnityCache] 'http://localhost:8000/Build/WebGL.data' successfully revalidated and served from the indexedDB cache
    3. WebGL.loader.js:80
    4. warning: 2 FS.syncfs operations in flight at once, probably just doing extra work
    5.  
    6. printErr @ WebGL.loader.js:80
    7. syncfs @ WebGL.framework.js:5329
    8. sync @ WebGL.framework.js:1641
    9. (anonymous) @ WebGL.framework.js:1650
    10. setInterval (async)
    11. setInterval @ WebGL.loader.js:66
    12. _JS_FileSystem_Initialize @ WebGL.framework.js:1649
    13. $main @ WebGL.wasm:0x22d13c5
    14. (anonymous) @ WebGL.framework.js:1060
    15. callMain @ WebGL.framework.js:18515
    16. doRun @ WebGL.framework.js:18558
    17. run @ WebGL.framework.js:18570
    18. runCaller @ WebGL.framework.js:18498
    19. removeRunDependency @ WebGL.framework.js:1015
    20. (anonymous) @ WebGL.loader.js:1104
    21.