Search Unity

All assets deleted / project reset when launched through UnityHub

Discussion in 'Editor & General Support' started by julesbro, Aug 16, 2021.

  1. Mattis

    Mattis

    Joined:
    Aug 21, 2012
    Posts:
    4
    Happened for me to. I've used Unity for 10+ years and never (as far as i can remember) had this happened before.

    After some (a lot) of testing i have managed to reproduce this problem, it seems to have something to do with being signed out of the unity account (in editor) when new project is created (via unity hub).
    Se below steps, note that this will not help anyone get any files back, for that i have no solution. But it would be interesting to know if anyone else gets the same result.

    1- Make sure you are NOT signed in in unity hub or the unity editor. Make sure editor is closed.
    2- While signed out, in Unity Hub: Create a new project. For example, a 3D (URP) Core.
    3- When project is created and opens up in Unity Editor, sign in to your account from the Editor. (Edit menu -> sign in or use the sign-in button in upper left or go via the package manager)
    4- Create something, a cube and a plane. Import an asset or two. Save scene and project.
    5- Close the project (Exit the editor).
    6- Open the project again, via unity hub.
    7 - Everything in the project, changes in scene and imported assets are gone. However, changes to the editor layout (if you made any changes) remains.

    I have tried this on 3 different machines (one of them was a total fresh install of win 11). Every time with the same result. But i have only used my account so i don't know if that can be a factor.

    I have been using Unity Hub version 3.3.0 and 3.4.1. And Unity Editor 2021.3.10f1
    Using PC with windows 10 and 11.

    I have submitted a bug report.
     
  2. AltairWinner

    AltairWinner

    Joined:
    May 30, 2017
    Posts:
    1
    Happened to me yesterday. Can confirm that the steps were nearly the same.
    Unity 2023.2, latest version, Unity Hub 3.4.1
    1. Created a project using 3D URP template.
    2. Worked on prototype for some time. Decided to use a library from Asset Store.
    3. Signed in using editor to import asset. So, a chain of logins in browser, hub and editor took place.
    4. Some time after I saved scene and closed Unity.
    5. Opened the project again using Unity Hub.
    6. 2 hours of work gone, unrecoverable because deleted files on SSD are hard to recover. The only thing that was found was a trace of scene file (that was most likely unrecoverable too). No scripts, no folder structure. The project was reverted to 3D URP template state.
    An interesting thing is that the library (Zenject) wasn't removed. Only Assets folder was wiped.
     
    Last edited: Feb 22, 2023
    Mattis and nasos_333 like this.
  3. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    Spot on. I reproduced this on my M1 Mac, using the 2021.3.18f1 editor and the 3.4.1 Hub. It recreated the project from the template.

    Great work! Let us know if the bug becomes public, so that we can vote on it.
     
    AldeRoberge and Tukoda like this.
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Wow... it feels like somebody official from Unity should be paged for this, if three people can reliably repro it.

    I only know @MelvMay so I'm gonna page him here and hopefully he can get some eyeballs on this ASAP.
     
    AldeRoberge and nasos_333 like this.
  5. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    I made four Git commits at four points:
    • Before logging in
    • After logging in
    • After adding a cube
    • After closing and reopening, triggering the bug
    I noticed that, at step 3 (not step 2!), a file in ProjectSettings file called SceneTemplateSettings.json appeared, then vanished in step 4 after the project was re-created from a template.

    However, copying that file into an existing project and reopening it doesn't cause the bug to happen. I was hoping I'd found a "smoking gun", but it looks a little more complex than that.

    I also tried making the cube, saving, then logging in and closing. That also worked. No changes happened to the project after logging in -- only after closing the editor. I guess there's some state stored elsewhere?
     
  6. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Can you repro it in a "normal" directory, such as
    c:/unity/myproj
    (or
    ~/unity/myproj
    in a posix context)?

    Or does it only fail when done in whatever directory Unity choses by default these days?

    And does it unlink the entire directory? Or would a
    .git
    directory survive?

    Anyway, I always 100% structure my Unity games in a subfolder from the project. That way if I need to make another Unity project in there for testing or whatever, it's just another peer in the repo.

    For instance, Jetpack Kurt looks like:

    ~/unity/jetpack/
    ~/unity/jetpack/jetpack
    ~/unity/jetpack/jetpack/Assets
    ~/unity/jetpack/jetpack/ProjectSettings
     
  7. nasos_333

    nasos_333

    Joined:
    Feb 13, 2013
    Posts:
    13,360
    Indeed would be interesting to see if github keeps the files, but i gather if it syncs would also erase them
     
  8. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    I put my projects in ~/wkspaces

    I think that got created by PlasticSCM at some point, and I've just kinda...put the rest of my stuff in there.

    The .git directory survived. It looks like it just resets your Assets directory.

    Git, not GitHub :p

    As long as the .git directory isn't deleted, you'll still have all of your data. Of course, you could commit all those deletions...but the old commits aren't going anywhere!
     
    Kurt-Dekker and nasos_333 like this.
  9. Cam_Fox

    Cam_Fox

    Joined:
    Nov 23, 2018
    Posts:
    29
    Kind of wondering if it's a DRM thing Unity is implementing that goes haywire due to a bug. For example a feature that would let Unity nuke projects for accounts that violate TOS. Affected projects seem to get wiped out very thoroughly.

    Maybe the Unity team can shed some light if vanishing project assets is is a pipeline problem or related to broken DRM.
     
    Last edited: Mar 4, 2023
  10. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    No, it's very clearly a bug involving the project getting re-created from a template. The real world does not work like those creepypasta Nintendo anti-piracy screens.
     
  11. Tukoda

    Tukoda

    Joined:
    Feb 1, 2017
    Posts:
    1
    And it also happened to me just now :(
    Luckily it was on a fresh project for some editor enhancements, so I just lost a couple of hours.
     
  12. Tom-Mensink

    Tom-Mensink

    Joined:
    Jul 27, 2017
    Posts:
    17
    Happened to me just now. Complete project wiped clean, was just doing some tidying up before I would add a git. Only thing I did was change the manifest.json with some version manual swaps. No way this should wipe clean my complete project, what a horrible bug.
     
  13. myazuid

    myazuid

    Joined:
    Jan 29, 2019
    Posts:
    26
    This also just happened to me. I saved the project last night, opened it this morning and it had been reverted to the URP template. Tried to restore from Plastic SCM and all of the prefab GUIDs are missing, I guess because the metadata wasn't in the backup? Not sure. Trying a PC backup that I had also run last night and see if that helps.

    I have never encountered such an extremely impactful bug in any software I have ever used. This is really quite astonishing.
     
  14. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    Has your bug report wound up on the public tracker yet? It seems like something that should really be looked at sooner, rather than later...
     
  15. Mattis

    Mattis

    Joined:
    Aug 21, 2012
    Posts:
    4
    Nothing had happened with the bug report until yesterday, when its status was changed to "In Review". So hopefully something will happen soon.

    Sad to hear that more people have been affected, it's a serious bug.
    For me, it has only occurred when opening a newly created project for the second time. No older projects or projects I have worked on for multiple sessions have been deleted. That can be good to know for anyone that feels they really can't trust Unity Hub. I know i felt that way when it happened to me. (i'm still suspicious, especially when working on new projects)

    There should at least be a "The folder is not empty" warning when Unity tries to create a new project in a folder that's full of stuff but should be empty.
     
  16. jriggle

    jriggle

    Joined:
    Mar 29, 2023
    Posts:
    1
    First post.. greetings. Found this thread trying to figure out where my project files went, but alas, Unity nuked my files. At least I am not alone in my disappointment. I didn't lose anything important.. would have been in git.. but I lost several hours and a lot of faith in Unity. Any word from the Unity team?

    -- edit: suggestions for best practice to avoid this issue going forward?

    thanks
     
  17. Zarkow

    Zarkow

    Joined:
    Jul 27, 2015
    Posts:
    92
    Create your project, do minimal amount of work (perhaps set the name of the project in settings), check in the files to your favorite source code repository system, turn off Unity - re-verify all is good. Package up all files to a .rar/.zip file, as a disaster recovery solution incase your code repo cannot handle all files and/or you don't source-control large files.

    Restart Unity Hub, start up your project in Unity again, verify it opens correctly.

    If the problem happens, you can at least roll back - and perhaps even be able to package a repro-case. Else, now you are safe to continue. It only happens on second start-up of new projects.
     
    Angurvadal likes this.
  18. Mantic

    Mantic

    Joined:
    Jan 5, 2013
    Posts:
    4
    Just happened to me on 2022.2.13f1 with the URP template. :/ I thought my SSD was failing so panicked and purchased a new one... but it happend again the next day. Glad I found this thread! Can we get some official Unity responses to this bug?

    If you have your project folder open, and open the project for the second time, you'll see the directories disappearing and then re-appearing with the default template data. Definitely not a function of anti-virus or failing drive.
     
  19. schouffy

    schouffy

    Joined:
    Mar 8, 2015
    Posts:
    10
    It just happened to me too today.
    I have literally never seen anything like that in any development environment ever.

    Oddities I noted before that happened:

    - Unity hub pretended it didn't have the 3D URP template when I tried to create new Project X, but I create new URP projects all the time and I do have the template.
    - When I tried to open some other project (let's name it Y) through Hub in another instance of Unity, it said to me that Hub can't open Project X (despite I wanted to open Y) because it's open in another instance and I can't open the same project in two instances (I tried it twice just in case I misclicked).
     
  20. TomH

    TomH

    Joined:
    Jul 10, 2012
    Posts:
    41
    I chime in with having the same problem as well using Unity 2022.2.14. Used the 3D URP template to start with, wanted to import assets and had to log in. All imported assets, packages etc. are gone and the project is exactly like the template.

    Happened to me a couple of times over the years. I retraced my steps including logging out and could also reproduce the behavior again.
     
  21. Mattis

    Mattis

    Joined:
    Aug 21, 2012
    Posts:
    4
    I just noticed that my bug report was made public last week:
    https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-32874

    Title and wording differ a bit from what I wrote in my bug report. I think the main problem became a bit unclear, namely that everything you have done is deleted from the hard drive without a trace.
    Others who have experienced the same problem might not recognize it as the same bug based on how it is described in the issue tracker.
    But any way, good that things are starting to move. Please go ahead and upvote the bug!
     
  22. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    Well, that's interesting. I left a comment mentioning that.
     
  23. NakedUnicorns

    NakedUnicorns

    Joined:
    Feb 22, 2023
    Posts:
    11
    This happened to me, and I stopped using GitHub. I now "old school" backup the entire project to a 4 TB SSD hard drive with a 3.2 USB connection (it is pretty fast).

    I do this every 30 minutes (or sooner)

    A little drastic, but I feel more confident knowing I have a full, complete backup on an external disk (and on another computer -- backup of a backup) that cannot be destroyed.
     
  24. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,742
    Once you have git set up, just keep a terminal window open in the root of your project.

    Every time you want to commit all changes and push to a remote computer (like github, bitbucket, etc., or even you own thumb drive), just save scene / save project from Unity and do:

    $ git add . ; git commit -m "creep-and-save"; git push


    That takes a timestamped snapshot of ONLY what changed and pushes it remotely, safely copied off your computer.

    The benefit is that it leaves a complete log of what you have done, each file, each change. If you screw one tiny thing up ten steps ago you can undo that one line trivially, without having unzip and restart over, being unsure what actually screwed things up.

    Once you have typed that once, just press up-arrow and return and another snapshot is made!
     
  25. BjoUnity3d

    BjoUnity3d

    Joined:
    Jul 24, 2012
    Posts:
    60
    Thank you @Mattis and @Zarkow for your investigation and advice to avoid this bug. I will close and reopen all new projects a few times before investing significant time. This happened to me today and I lost yesterday's entire day of work. I can luckily recover it from my daily backup, but the feeling of horror when I opened the project today and found it wholly reset will never be forgotten. I too have been using Unity for 10+ years and this is the first time it happened. Using 2022.2.15 on Macbook Pro M1 16GB. And yes there was a sign in issue with Unity hub while I was working yesterday. I'm glad I found this thread so don't have to spend hours trying to reproduce this. I hope it gets fixed soon. If I couldn't see the entire project with all my work sitting on IDrive, I would have thought I hallucinated the entire day of work.
     
  26. Senathorius

    Senathorius

    Joined:
    Oct 7, 2020
    Posts:
    2
    This issue still persists.
    Unbelievable, have been using unity for almost a decade now, never had any issue like this, like a lot of people in this thread, I did not set up source control as I was quickly prototyping a game idea. Lost some good day or two of progress.

    What saved me from questioning my sanity is the fact that I still have the builds of the game. Otherwise I would have thought I was hallucinating the entire game jam.
     
  27. djgaven588

    djgaven588

    Joined:
    Nov 11, 2016
    Posts:
    2
    Issue just occurred for me as well, following the general trend of all the before mentioned info.

    Thankfully have a build I can pull the majority of code back out of, but, lost all my scene and asset data.

    I did during this have the following conditions met:
    - Only launched the project once, reloading it caused the bug
    - Relaunched using Unity Hub
    - Saw the template loading in the editor log
    - Signed in during that session using the editor sign in, not the hub sign in, and imported Asset Store assets
    - No antivirus, drive backup, or other interfering software running

    This is the first occurrence that has happened for me, and seems to be that the Editor when loading using the create template argument will bypass any file checks. A simple "does directory contain anything" check and a confirmation dialog in editor would go a long way for fixing this. Very disappointed to not see any Unity staff responding here, and I can't access the issue page previously mentioned here to vote on it.
     
  28. MediaEngineering

    MediaEngineering

    Joined:
    Jul 5, 2022
    Posts:
    1
    To me, this happened already twice. I can confirm, this is an issue. And I can only say: This MUST NOT happen.

    Statements like "you should close Visual Studio first" and other hints are NOT acceptable. I need to be sure, that my changes are never gone when I close my project. Even if Unity crashes, it MUST NOT clear the project back to some initial state. Something corrupt may be ok, but completely deleting scenes (as happend to me today) and package references is a complete no go.
     
  29. Neonage

    Neonage

    Joined:
    May 22, 2020
    Posts:
    287
    How tf this is still an issue that is not being fixed nor addressed. This happend to me TWICE already, IN ONE MONTH.
    I've tried to version update a project that was just cloned from github, and it decided to WIPE A PREVIOUSLY OPENED PROJECT, and open it instead (it was in the same root folder, but even the Unity version is different, 2020.3.29 vs 2021.3.22). It did not even trigger a version update.
    Entire day of work on a prototype is lost.
    Is there NO ONE left to actually work at Unity?
     
  30. loldi

    loldi

    Joined:
    Aug 11, 2015
    Posts:
    4
    Confirming this happened to me today, thankfully it was just in a prototyping playground and not a full-fledged project.
     
  31. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    The issue has been renamed. Here's the new link:

    Unity Issue Tracker - "Failed to import package project" when opening a project that was created by a signed-out user who edited it after signing in (unity3d.com)

    The bug is still alive. I just helped someone on the Unity Discord who got hit by it, and I just reproduced it again on my macbook.

    Note that, on my PC, I got a different error:



    Sounds like an unquoted path to me. I guess that saved me from the wipe.
     
    Last edited: Jun 4, 2023
  32. AlexGone

    AlexGone

    Joined:
    Feb 11, 2022
    Posts:
    5
    Just happened to me.
    Project was created when signed-out from 3D URP template.
    I signed in with the project still running, saved multiple times.
    After closing and reopening everything was gone.
    Unity Version 2021.3.18f1

    @chemicalcrux this seems to be a different issue
     
  33. chemicalcrux

    chemicalcrux

    Joined:
    Mar 16, 2017
    Posts:
    720
    That's exactly the issue. It doesn't matter how much work you do after the sign-in.

    Are you referring to how the linked issue looks different? Yeah...but it was created by Mattis above, who reproduced the bug in the first place!
     
  34. Mattis

    Mattis

    Joined:
    Aug 21, 2012
    Posts:
    4
    Just installed 2022.3.1f1 LTS version (and updated the unity Hub). First thing i tried was of course to reproduce the bug. And sad to say it is still there.

    However i have still only encountered this bug on brand new project where i have logged in after creation.
    I have not managed to delete any old projects or new ones that have been opened more than one time.

    So first thing to do after you have created a new project in Unity, make sure you are signed in in the editor (in the menu: Edit -> Sign in). Then close and reopen the project again.

    I usually create something, just a cube with a new material or something. If that is still there when i reopen the project, I feel fairly certain that the project will not be deleted (by this bug) in the future.

    Hope this helps any of you who have just encountered the bug and have that feeleing that you can't trust anything in Unity anymore :)
     
  35. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,550
    The fix for this is "in review" for the 3.5.x branch of Unity Hub, which is currently in Beta. So the fix shouldn't be tooo far off hopefully.
     
  36. jadenbalogh

    jadenbalogh

    Joined:
    Jun 6, 2017
    Posts:
    8
    Holy crap. To say the least.

    Adding on to the pile - just encountered this bug for the first time, following the same pattern I've used on dozens of prototypes and projects across several Unity versions for years:
    - Create a new Unity project via Unity Hub
    - Place the project in my usual Unity project folder
    - Open the project, rename "SampleScene" to "Main"
    - Open GitHub Desktop and create a new repository in the newly-created project folder
    - Commit the new Unity project to the repo (with a standard Unity .gitignore in place)
    - Do a few scene changes - lighting, a couple game objects - and save the changes
    - Confirm in GitHub Desktop that the scene changes are all visible and correct

    Here's where things go absolutely haywire:
    - Close the Unity project
    - Re-open the project from Unity hub again
    - Confirm in GitHub Desktop that all scene changes have been utterly wiped from the Changes panel
    - Note also that ProjectSettings.productGUID has been reset to a new value since the initial commit

    I've created several full projects on my current Unity version (2021.2.8f1) - same computer, same everything - with no issues. The only thing I did differently today was install Unity 3D (URP) in Unity Hub, and create the project with that template.

    I also noticed that as I was trying to install packages for my new URP project, the "My Assets" tab in the Package Manager had me signed out. When I click Sign In, nothing happens. Refreshing the list does nothing. Attempting to "Sign In..." from the Edit context menu also does nothing.

    These two differences seem to match with what everyone else here has been saying: creating a new 3D URP project while signed out.

    Needless to say, mirroring the other comments in this thread - this is a cataclysmic issue on Unity's end. It's beyond astonishing that an issue of magnitude could have made it to a released product, let alone still be in full effect several months after reports started pouring in.
     
  37. Angurvadal

    Angurvadal

    Joined:
    Jul 19, 2013
    Posts:
    11
    Same thing happened to me today... I'm a bit disappointed to see that this still isn't addressed... gonna create empty projects and add my stuff from that...
     
  38. Funsockman

    Funsockman

    Joined:
    Jul 19, 2022
    Posts:
    1
    The same thing just happened to me as well.
     
  39. nosyrbllewe

    nosyrbllewe

    Joined:
    Oct 18, 2012
    Posts:
    182
    I just had it happen to me too. I can't believe such a significant bug hasn't been fixed for almost 2 years.
     
  40. AldeRoberge

    AldeRoberge

    Joined:
    Jun 23, 2017
    Posts:
    60
    Happened to me as well. 3D URP template. 5 hours of work. Real glad I committed to git before re-opening the editor. Feels like a Unity Hub problem, where it re-creates the project from the template.



     
  41. bam8r4

    bam8r4

    Joined:
    Jul 12, 2023
    Posts:
    1
    Just chiming in to say this has happened to me twice in one week. The second time was today which sent me looking and I found this thread.

    2D URP template. Latest version of unity hub and lts editor.

    Very sad this is still an issue.
     
    AldeRoberge likes this.
  42. Korno

    Korno

    Joined:
    Oct 26, 2014
    Posts:
    518
    Today I unhappily join this club too. I lost about 3 hours prototyping work on a FPS controller. No source control as I was just playing around and hadn't decided if was going to keep the work or not.

    As far as I recall, this is what happened to me:

    I created the project while not logged in Unity Hub,
    I wanted to download an FPS asset to see how they were doing something that I was planning to implement too.
    I had to log in to download (via the editor) the package.
    Finished work for lunch, closed the project in a good state (no errors, everything compiling)
    Came back later and opened the project via unity hub
    Boom, project is exactly like a brand new HDRP template.

    The fille are gone from the computer, not hidden or renamed but completely deleted. Including the FPS package I had downloaded.I spent a while searching directories, using windows file search, to confirm this.

    I'm amazed some code path in UnityHub (I am assuming it is not connected to the editor as it was fine, and seems to happen in multiple versions of it - I am using 2023 beta) has logic to wipe user directories whithout at least checking for the presense of files and asking for confirmation if it finds something that it doesnt expect. If that file path was ever corrupted it could wipe random directories.
     
  43. alfraprog

    alfraprog

    Joined:
    Aug 26, 2017
    Posts:
    1
    Same situation with Unity 2022.2.8f1 using the URP template. After installing a couple of packages (First person starter assets and probuilder), and prototyping a level I saved and loaded between different levels while Unity was open. As soon as I closed the program (gracefully) and reopened the project it looked like it reverted back to the URP template. There is no mention of the installed packages, or any reference to the map that I was working on. I also know that the map that I was working on was saved correctly because I jumped between the First Person starter asset and my own map that I created, so technically, the files were saving correctly.
    It's pretty obvious that loading a project from Unity Hub can cause this issue.
    Unity HUB version: 3.4.1
    And yes: I've used Unity for thousands of hours over 15 years and I haven't had it happen before, but it has happened now, and I'm pretty sure this is the type of bug that can really deter anyone from using this piece of software. Saving a file and closing a project is standard practice.

    We should't have to use GIT after closing a Unity project only because Unity might decide to blow it up next time you rn it but that's just my opinion I guess.
     
    AldeRoberge likes this.
  44. norrath-hero

    norrath-hero

    Joined:
    Sep 28, 2020
    Posts:
    4
    Unity 2022.3.22f1 lts Bug still here, happened 3 time this week