Search Unity

EBUSY: resource busy or locked

Discussion in 'Package Manager' started by angel1st, Mar 12, 2020.

  1. angel1st

    angel1st

    Joined:
    Nov 16, 2019
    Posts:
    35
    Hi there,
    I have just downloaded 2019.3.5f1 and I wanted to add Entities package to a new project. This is what I have got as an error message in Console:

    Cannot perform upm operation: EBUSY: resource busy or locked, open '-----\Library\PackageCache\.tmp6760amsihKOTPeMr\copy\Unity.Entities\ConverterVersionAttribute.cs' [NotFound]
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    Error adding package: com.unity.entities@0.6.0-preview.24.
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()

    Let me know how to fix it.
     
  2. supita_unity

    supita_unity

    Unity Technologies

    Joined:
    Dec 13, 2019
    Posts:
    226
    Hello,

    Sorry to see that you are having this issue. Could you please include the editor logs. It could be some kind of permission issue on the folder. Maybe a super eager antivirus removing the files?

    If you try in other Unity versions do you have this problem?

    Cheers,

    Supi
     
    zuchor likes this.
  3. leCrazydude

    leCrazydude

    Joined:
    May 18, 2017
    Posts:
    1
    I had the same issue recently. Simply go to the folder location specified, open the folder properties window and make sure to have Read Only unchecked so that Unity could have read/write access to that directory. Hope this helps!
     
  4. behemothdan

    behemothdan

    Joined:
    Jul 24, 2017
    Posts:
    9
    Mine was due to having VS Code open for editing my scripts. Once I closed that, it solved my issue.
     
  5. nights007

    nights007

    Joined:
    Aug 12, 2014
    Posts:
    17
    Same issue, happens a LOT. And theres usually no way to move forward, you can try removing your library folder etc reimporting everything. Been seeing this for ages now! Unity need to actually solve these type of issues asap, essentially they brick the whole damn package manager, and in extension the whole engine.
     
  6. KroNu5

    KroNu5

    Joined:
    Nov 7, 2017
    Posts:
    1
    Me too.

    Thanks
     
    osama2o1ooo, Zirki, dcd777 and 7 others like this.
  7. FusionPoint

    FusionPoint

    Joined:
    Nov 10, 2020
    Posts:
    1
    i got this in console
    Error adding package: com.unity.ml-agents@1.0.5.
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
     
    thanhcongchien likes this.
  8. Galse22

    Galse22

    Joined:
    Jun 25, 2020
    Posts:
    2
    Thanks, mate.
     
  9. streetbranson3

    streetbranson3

    Joined:
    Nov 29, 2020
    Posts:
    1
    this is the one. i love you
     
  10. AfsoonB

    AfsoonB

    Joined:
    Oct 29, 2019
    Posts:
    1
    Problem solved! Thanks!
     
  11. thedrhax14

    thedrhax14

    Joined:
    Aug 7, 2014
    Posts:
    38
    It fixes it, thanks
     
  12. ALGNam

    ALGNam

    Joined:
    Sep 2, 2018
    Posts:
    2
    thank you
     
    eggertjanphillip likes this.
  13. Fangpower

    Fangpower

    Joined:
    May 26, 2019
    Posts:
    1
    solved it. thanks
     
    ShakkDK and gabrieldaduya like this.
  14. falconfetus8

    falconfetus8

    Joined:
    Feb 4, 2013
    Posts:
    17
    Closing VSCode fixed this for me, too...and that disturbs me. Why is VSCode locking files that I'm not even opening?
     
    Flofoof, eggertjanphillip and Gasimo like this.
  15. cdibbs

    cdibbs

    Joined:
    May 3, 2019
    Posts:
    17
    It seems to try to be smart behind the scenes to facilitate code completion, "go to definition," and other features. It probably has to open a lot of files to maintain that sort of context.
     
    eggertjanphillip likes this.
  16. matiasavallejos

    matiasavallejos

    Joined:
    Nov 1, 2019
    Posts:
    1
    Gracias my brother!!
     
  17. PavelLangweil

    PavelLangweil

    Joined:
    Mar 4, 2014
    Posts:
    28
    Worked for me too.
     
  18. darklordkrish

    darklordkrish

    Joined:
    Aug 5, 2020
    Posts:
    1
    Had the same issue.But once i close vscode and tried again,it worked
     
    osama2o1ooo likes this.
  19. Akai1411

    Akai1411

    Joined:
    Jun 20, 2021
    Posts:
    1
    Another one solved thanks to closing VSCode
     
    osama2o1ooo likes this.
  20. DevboxBrasil

    DevboxBrasil

    Joined:
    Dec 26, 2020
    Posts:
    3
    Oh man! You saved my night! hahahaha
    Closing VsCode solved the problem... f***
    xD
     
  21. hawaiian_lasagne

    hawaiian_lasagne

    Joined:
    May 15, 2013
    Posts:
    123
    Worked me me too! Thanks!
     
  22. ZombieMan_0901

    ZombieMan_0901

    Joined:
    Jan 21, 2020
    Posts:
    6
    Closing VS Code worked for me!
     
    osama2o1ooo likes this.
  23. picklepops

    picklepops

    Joined:
    Jul 18, 2019
    Posts:
    1
    This fixed it for me :D
     
  24. MHDante

    MHDante

    Joined:
    Aug 20, 2013
    Posts:
    11
    Hey. For anyone that's running into this issue when vscode is closed, I found a much more insidious culprit.

    The git integrated filesystem monitor.

    I, for example, was getting the error:
    [Package Manager Window] EBUSY: resource busy or locked, rmdir 'C:\ProjectPath\Library\PackageCache\.tmp19804vubalWIte5Cz\clone'
    UnityEditor.EditorApplication:Internal_CallUpdateFunctions ()


    After looking at task manager I saw that there were a bunch of git instances that unity was creating and were getting stuck with the cmd-line arguments: `fsmonitor--daemon run`

    This is because when I installed Git, I activated the (experimental) integrated filesystem watcher.

    You can disable it by going to
    C:\Program Files\Git\etc\gitconfig
    and setting

    useBuiltinFSMonitor = false


    ....

    I need to stop enabling experimental features
     
  25. WeirdBeardDev

    WeirdBeardDev

    Joined:
    Feb 16, 2013
    Posts:
    14
    Chalk up another one to closing VS Code FTW, thanks!!
     
  26. sensyup

    sensyup

    Joined:
    Jun 20, 2021
    Posts:
    1
    Solve my problem and thank you
     
  27. zlaw777

    zlaw777

    Joined:
    Mar 9, 2015
    Posts:
    7
    you're a hero
     
  28. JQV

    JQV

    Joined:
    Jun 30, 2015
    Posts:
    1
    THANK YOU !!! Your method helped me
     
  29. devilhunterxl

    devilhunterxl

    Joined:
    Dec 19, 2018
    Posts:
    14
    :eek: Close the goddamn VS Code!
    That must be a big banner in this topic.
    Thanks for the advice. I couldn't imagine VS Code has something to do with it.
     
  30. SpeedingBois

    SpeedingBois

    Joined:
    Oct 8, 2021
    Posts:
    1
    You have changed my life. With just a button you have done it, thanks a lot
     
    behemothdan and UnityMaru like this.
  31. Thommynator

    Thommynator

    Joined:
    Mar 29, 2020
    Posts:
    1
    Thank you! That helped.
     
  32. Germud

    Germud

    Joined:
    Feb 16, 2018
    Posts:
    1
    Genius!
     
    behemothdan likes this.
  33. unity_Usw1NA-DrcweCg

    unity_Usw1NA-DrcweCg

    Joined:
    Oct 18, 2021
    Posts:
    1
  34. nonemec

    nonemec

    Joined:
    Nov 13, 2018
    Posts:
    9
    I struggled for ages until I found this post and had the issue resolved by closing VSCode.

    Since VSCode does not seem to be the only culprit, it might be an idea for Unity to alleviate the problem by adding a tiny loop around the file opening code that retries for a few times. This would at least reduce the number of sporadic failures caused by other programs scanning the directory.
     
    AhmedJarad likes this.
  35. stickylab

    stickylab

    Joined:
    Mar 16, 2016
    Posts:
    92
    you are the best
     
    behemothdan likes this.
  36. Ov-aDose

    Ov-aDose

    Joined:
    Jan 19, 2021
    Posts:
    2
    it worked for me
     
    behemothdan likes this.
  37. jpvanmuijen

    jpvanmuijen

    Joined:
    Aug 23, 2012
    Posts:
    13
    Another fun case; my project was located in a Dropbox folder, where a sync issue was causing this error. Pausing sync resolved it (or moving the project out of Dropbox of course).
     
  38. BKGcode

    BKGcode

    Joined:
    Feb 10, 2017
    Posts:
    3
    Thanks! Silly error, I hope it's fixed soon x(
     
    behemothdan likes this.
  39. unity_B5F269F0EEFD6E1498D9

    unity_B5F269F0EEFD6E1498D9

    Joined:
    Nov 24, 2021
    Posts:
    1
    This solved it for me.. Thanks!
     
    behemothdan likes this.
  40. cspotcode

    cspotcode

    Joined:
    Jun 26, 2020
    Posts:
    1
    I'm pretty sure Unity should still implement a fix for this. VSCode and git's filesystem watcher don't permanently lock files, do they? I bet Unity needs to implement some retry and backoff to avoid this issue. Unity probably tries to do too much too fast without any retry logic.
     
  41. maximeb_unity

    maximeb_unity

    Unity Technologies

    Joined:
    Mar 20, 2018
    Posts:
    551
    Unity copies the package files to a temporary staging folder next to the final location, then renames the staging folder to the package name. This makes the installation "atomic", i.e. either the package is present and complete, or it's not; you will never have a package with some files missing due to interrupting the process, for instance. (That doesn't really seem doing "too much too fast", but you're right, there should be some safety mechanism, and we're looking into that issue.)

    Unfortunately, the problem, as I understand it, is that VS Code's file watcher immediately detects the new files are added in this staging folder and immediately opens them for reading the contents, probably to build some metadata cache and/or IntelliSense db. During that time, it's not possible to rename one of the ancestor folders. If a package contains a lot of files, the folder will therefore remain "un-renamable" because of a VS Code for a longer time, and this increases the likelihood of Unity failing to rename the folder. A typical "race condition", if you will.

    The same probably happens with other software like OneDrive and Dropbox, for instance. And to be fair, it might not be VS Code itself that's the problem, but one (or more) of the extensions loaded in it (including third-party extensions). The simple workaround for now is to close VS Code (or whatever software is eagerly opening and locking files) before opening/creating a project. Another workaround might be (disclaimer: I haven't tried it) to make the problematic VS Code extensions ignore folders with a '.' prefix, if that is possible for those extensions.
     
  42. CNicoF

    CNicoF

    Joined:
    Sep 28, 2021
    Posts:
    1

    Thanks! You saved me :D
     
  43. Saucyminator

    Saucyminator

    Joined:
    Nov 23, 2015
    Posts:
    61
    This worked for me as well! Had trouble getting it to work even after closing VS code.
     
  44. xucian

    xucian

    Joined:
    Mar 7, 2016
    Posts:
    846
    I had to close Chrome as well
     
  45. gegagome

    gegagome

    Joined:
    Oct 11, 2012
    Posts:
    392
    Wow this is madness. I closed VS and I regained control of the package manager.

    Thanks everyone who contributed @behemothdan
     
  46. CoffeePython

    CoffeePython

    Joined:
    Dec 31, 2021
    Posts:
    1

    It solved my issue.Thanks
     
  47. ZeuS6667

    ZeuS6667

    Joined:
    Nov 12, 2021
    Posts:
    1
    thanks man same issue here :)
     
  48. mattouBatou

    mattouBatou

    Joined:
    Sep 2, 2016
    Posts:
    20
    Yup, I just had this issue, was driving me crazy. Closed VS Code and the Input System package did indeed install correctly!
     
    andymikulski likes this.
  49. madmarvin

    madmarvin

    Joined:
    Jan 31, 2018
    Posts:
    3
    Every time this happens I just close whatever is open in VS Code, that solves it. :)
     
    andymikulski likes this.
  50. SUfIaNAHMAD_

    SUfIaNAHMAD_

    Joined:
    Jun 19, 2019
    Posts:
    18
    The package cache was invalidated and rebuilt because the following immutable asset(s) were unexpectedly altered:
    Packages/com.unity.textmeshpro/Scripts/Runtime/Unity.TextMeshPro.asmdef