Search Unity

My permissions on the project have been revoked and I do not know why

Discussion in 'Editor & General Support' started by EnriquePage91, Apr 20, 2020.

  1. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67
    Hello,

    As I was updating some assets I own yesterday, and incorporating the changes needed on these to utilize ASMDEFs with them (restructuring certain folders and what not).

    I tend to do a lot of this kind of work through the Windows Explorer (I move both the files and their meta files with them so Unity doesn't lose track of these "pieces"), which makes me wonder if perhaps this had something to do with my problem:

    While I was re-structuring "Mesh Slicer" by BzKovSoft, I had to create a new folder for his test scripts so that I could isolate those in their own assembly. Everything should have worked fine, the dependencies seemed ok at this point... However there was this one script belonging to another assembly (which the test assembly had a reference to) which just kept throwing the same error over and over. Unfortunately, my project won't open anymore so I can't tell you exactly what the error was, but in essence it was simply saying that I do not have write/read permissions to access such file.

    After a little while, I realized that I was no longer even able to rename my folders IN WINDOWS EXPLORER! Holy smokes, I have no idea what happened. I have verified the permissions of my root folder and even allowed them to propagate across its children - however Unity kept telling me the same thing "you do not have write/read permissions for this file" blablabla. I did try opening Unity as an admin and even added myself as user with full control permissions for the whole root folder and its children, but it never did the trick. The same issue kept popping up.

    At this point, I close Unity, and go to bed. It is 4 am. whatever.

    When I woke up the next day, my engine wouldn't even start (it would crash before starting the import phase). Omg.... Unity seems to struggle tremendously with projects that have a decent amount of assets - or is this just my experience?

    I try to cut (should have made a copy first, I messed up) my root folder (for the project) outside of its location. Windows gets stuck at 0% for ages, I cancel it.... and somehow the original folder is no longer in it's location eventhough the process got stuck at 0%. It "somehow" seems, it actually DID cut my whole project into another location, however as I write this I am starting Unity and waiting for it to re-import.

    Hopefully this will do the trick, however it would be great to know about any thing that might have triggered this whole mess - I'd really appreciate any input on how to either solve this in the future or perhaps even solve it right now (in case you somehow already know that re-locating and re-importing a project under these conditions won't solve my issue).



    Thank you in advance!
     
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You can get weird file copy freezing or access issues if your drive is failing or has an intermittent connection.
     
  3. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67
    Thank you,

    for the past few hours it's what I've been considering... My C drive is full though so I gotta clear it up and check over there first.

    If my D drive is the issue, would you suggest getting a new one? Or would a re-format be enough? It's a laptop so I'd prefer not to have to replace the internal drive.

    Thanks once again, in advance!
     
  4. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    If it were a physical problem with the drive, reformatting won't resolve it. Normally I'd check the drive's SMART data as a first step.
     
  5. Crayz

    Crayz

    Joined:
    Mar 17, 2014
    Posts:
    194
    Not sure about your other issues but my Unity editor really enjoys spending a ton of time importing assets every time I open it. My projects are probably medium sized, I imagine anybody with a large project simply dreads the idea of closing Unity or having it crash and having to re-open it.
     
  6. EnriquePage91

    EnriquePage91

    Joined:
    Jul 2, 2015
    Posts:
    67
    Yep, I can almost confirm it's not a hardware issue though, I've moved it to my C drive and the error persisted. After tons of more testing I managed to find the problem, an asset called Avatar Maker. I have to be very clear, the reviews for it are great and it does do some pretty neat stuff tbh - but it does not come with ASMDEF files, something that I have on ALL of my assets precisely because of what Crayz said, compile times can be HORRIBLE otherwise.

    In a new project without modifying Avatar Maker (by including ASMDEFs), and with a few other plugins, I haven't had any issues. However, on my main project, the minute i bring in the "modified" asset, my project crashes and it won't even allow me to reopen it until I remove this asset from the folder hierarchy of my project. Sometimes I even have to delete the library for a full re-import.

    After this happened a few times, my permissions on my project got completely corrupted. The only solution I have been able to utilize has been setting in the folder's preferences the permissions for the whole project as public. This is not an ideal solution at all but for some reason even if I add myself as a user there (I am also the only user of this computer, and obviously ADMIN), I run Unity as admin, or whatever else I do, it just simply keeps throwing the same error.

    I'm gonna have to look back into this as I don't like the idea of my project having public permissions but for now this has been the only thing that solved the whole "you can't write here" thing.

    I do have to emphasize this started after I had terrible issues with Avatar Maker crashing my project (worked on that for around 4 days till I figured it out), so it is very possible something got screwed along the way. The crashes generated by Avatar Maker are also pretty weird and don't even trigger the crash handler so I get a feeling that they are both probably related somehow.


    Crayz, as a side note, I was on that same situation and after doing what I had to do (moved my folder to C, which is SD, and essentially re-imported my project from 0 to 100 (getting rid of all the nasty garbage I had been generating all across it for over 2 years)) it is substantially faster.

    I used to have to wait upwards of 20 minutes to compile changes because of how messed up my project was; after a few months of work re-structuring things (it's not my full-time job and a lot of research had to happen first) with ASMDEFs and doing what I just said, now my project compiles VERY quickly in comparison. It's still nowhere as good as it would be on an fresh new project obviously, but at least it allows me to work without feeling like I'm staring at a screen without doing anything for half of my day.

    I'd suggest you consider investing a few days or weeks doing the same, as trust me although it is a pain and a lot of dead hours, it is seriously worth it.

    I have certainly also cut down the number of assets on my project, but I do at least have 30 or 40 in there and things are looking great. Getting rid of the default CSharp assemblies and all of those did help and then re-importing the project made the biggest difference (although I am sure the assemblies helped substantially too, but I was only able to notice after doing a clean re-import).