We have had a CS database corruption (unknown reason), tried to repair it with
mongod --dbpath ./ --repair
but that failed after just a couple of seconds.
We had a backup and restored the database from that.
CS is now running and I tried to import a project that was created after the latest database backup.
I get this error in the CS GUI:
Unable to attach project: ServerError: attach error: project already locked to instance
There is a file named cs.lock in the project folder.
Is this how the project is locked to instance?
Should i manually remove this file before trying to import it?
It is okay to remove cs.lock provided it was created after the database backup that you restored (and you have not successfully attached the project in the meantime), then again try to attach.
What would you recommend in the case where the project was already present in the latest database backup but a large number of jobs (~50) was created between the latest backup and database corruption?
We can import one by one right?
But would it make more sense to make a copy of the project folder with all the jobs, delete the project from the CS interface and then reimport the ‘whole’ project again?
Both approaches are feasible, right?
Ensure all CryoSPARC-related processes have been terminated, using a ps command like
ps -eopid,ppid,cmd | grep -e cryosparc_ -e mongo
Adjust the command according to the specific circumstances of your installation. Be aware of potential additional CryoSPARC instances running on the server (possible subject to certain constraints). kill, but notkill -9, any left-over CryoSPARC-related processes that belong to the specific CryoSPARC instance in question.
Rename the project directory. Ensure the new directory name
is unique.
is distinct from the project directory path of any project that may be present in the database, even if the directory itself may not exist.
Restore the database from the backup.
Run: cryosparcm restart
Open the CryoSPARC interactive command line interface (icli) cryosparcm icli
Inside the icli, run the command (after substituting the actual project uid)