Search Unity

Resolved Cannot access database - Locked Library/ArtifactDB error

Discussion in 'Editor & General Support' started by Skelbo, Dec 25, 2021.

  1. Skelbo

    Skelbo

    Joined:
    Dec 28, 2020
    Posts:
    38
    I am getting this error whenever I try to open my project:

    Locked file.jpg

    First time happening. Did some googling and some suggestions were to make sure any changes to the ArtifactDB file are commited to source control or to delete temp files or entire Library folder altogether. Most other search matches were unanswered threads.

    I tried committing any changes on local device and that didn't fix it, but I haven't tried the other suggestions since I've seen different opinions on whether or not it's good to delete the whole Library folder. I'm very wary of deleting stuff since I very recently just dodged a bullet with almost losing most of my project files. Hope this has an easy fix if anyone can help out. Thanks!
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,745
    Interesting. I've never seen this one. You should never source control anything in Library/ or Temp/ within your project. Are you properly ignoring those two directories?

    If your source control is properly configured, you should be able to fearlessly delete Library and Temp when Unity is closed, but I understand your wariness from the issues out had in the other thread.

    One interim test solution is to try copying the Assets/ and ProjectSettings/ and Packages/ file to a brand new directory somewhere, then try opening that.

    And of course there's always the tried-and-true "Reboot Windows" approach, just in case some process died with a lock on that database file. :)
     
    Batracien333, zzk20020612 and Skelbo like this.
  3. Skelbo

    Skelbo

    Joined:
    Dec 28, 2020
    Posts:
    38
    It seems Library and Temp are tracked on my git... Yeah my .gitignore is not configured for Unity projects specifically it seems. I cannot recall where I got the .gitignore file from, it's been so long.
    I'll try to replace it with one specific for Unity projects, delete the current Library and Temp folders on my Git repository and hopefully there won't be any more weird editor issues.

    Does this .gitignore file seem good enough?
     
  4. Skelbo

    Skelbo

    Joined:
    Dec 28, 2020
    Posts:
    38
    And of course, as I've just found out, there is no straightforward way to delete a directory from GitLab. Using the Web IDE to delete a folder freezes the whole tab. And there's way too many files to delete them manually one by one. I suppose the only option in this situation is to clone the repository locally again then delete everything on the device and push the empty project and then paste the working version again locally and push that in the empty repository. Will try that and update the thread with the result.
     
  5. Skelbo

    Skelbo

    Joined:
    Dec 28, 2020
    Posts:
    38
    Update: It's all working now. Only the necessary files and folders are being tracked on Git and the project opens without any errors.
    Thanks for the help! Let's hope it lasts this time. :)
     
    Kurt-Dekker likes this.
  6. Keir-NZXR

    Keir-NZXR

    Joined:
    Apr 28, 2021
    Posts:
    1
    In my case it was an automated backup agent (Backblaze) that happened to be processing the Library folder as I was trying to open the project.
     
    jasperstocker and armenfes like this.
  7. DeadHigh

    DeadHigh

    Joined:
    May 22, 2021
    Posts:
    4
    I found a fix for anyone having this locked file issue! This has worked for me multiple times:
    Close unity hub
    Open task manager
    Scroll down into your background proccess
    Find unity and unity crash handler and close the tasks
    Open up your project in unity hub!
    Hope this helps someone!
     
  8. Ish_melo

    Ish_melo

    Joined:
    Nov 14, 2019
    Posts:
    2
    hi when you say delete everything on the device you mean the laptop or on github ?
     
  9. Ish_melo

    Ish_melo

    Joined:
    Nov 14, 2019
    Posts:
    2
    Did anyone find any solution to this with fair steps I've tried many different things
     
  10. Tsondre

    Tsondre

    Joined:
    Apr 9, 2016
    Posts:
    30
    Not ideal, but I deleted my Library Folder and Unity re-installed it when opening the project again. Had to re-set some settings here and there but works like a charm now.
     
    sinewu likes this.
  11. armenfes

    armenfes

    Joined:
    Jan 21, 2021
    Posts:
    7
    Your comment saved my day. I had Backblaze as well!
     
  12. adreNAEline

    adreNAEline

    Joined:
    Jan 13, 2022
    Posts:
    2
    Two years late but, finally! Thank you
     
  13. unity_6410110470

    unity_6410110470

    Joined:
    Jan 7, 2024
    Posts:
    1
    Thank youuuuuuuuuuuuuu soooooooooooooooo muchhhhhhhhhhhhhhhhhhhhhhhhh ♥ I love u brooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
     
  14. AuraInteract

    AuraInteract

    Joined:
    Mar 6, 2023
    Posts:
    1
    cut past that file out and try to open