Cryptic JSON error trying to attach project

Hi all,

Using CryoSPARC v5.0.4

When trying to attach a project to our CryoSPARC instance we receive an error that says:

Project attachment failed, check api log for details. To recover, address the issue(s) and attach again.

The relevant lines in the api log are below (paths and ip addresses have been obfuscated for security):

2026-06-08 15:22:01,178 app                  attach           INFO   | Created project P188 from directory /nfs/path/to/project/CS-xxxxxxx
2026-06-08 15:22:01,178 uvicorn.access       send             INFO   | xxx.xxx.xxx.xxx:51430 - "POST /projects%3Aattach?path=%2Fnfs%2Fpath%2Fto%2Fproject%2FCS-xxxxxxx HTTP/1.1" 200
2026-06-08 15:22:01,178 core.data_management attach_project_d INFO   | Importing project data for P188 from directory /nfs/path/to/project/CS-xxxxxxx
2026-06-08 15:22:01,180 core.data_management attach_project_d ERROR  | Project attachment failed with Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/usr/local/cryosparc/cryosparc_master/core/data_management.py", line 83, in attach_project_data
    workspace_manifest = load_workspace_manifest(project)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/cryosparc/cryosparc_master/core/data_management.py", line 342, in load_workspace_manifest
    return json_utils.mongo_load(fp)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/cryosparc/cryosparc_master/util/json_utils.py", line 43, in mongo_load
    return json.load(fp, object_hook=mongo_object_hook, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/cryosparc/cryosparc_master/.pixi/envs/master/lib/python3.12/json/__init__.py", line 293, in load
    return loads(fp.read(),
           ^^^^^^^^^^^^^^^^
  File "/usr/local/cryosparc/cryosparc_master/.pixi/envs/master/lib/python3.12/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/cryosparc/cryosparc_master/.pixi/envs/master/lib/python3.12/json/decoder.py", line 338, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/cryosparc/cryosparc_master/.pixi/envs/master/lib/python3.12/json/decoder.py", line 356, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
2026-06-08 15:22:01,183 core.data_management attach_project_d ERROR  | Unable to import project from /nfs/path/to/project/CS-xxxxxxx

I’m unsure what file it is complaining about but the job_mainfest.json, project.json, and workspaces.json files seem to be correct json files to my untrained eyes.

Any suggestions?

Just in case another pair of (similarly untrained) eyes may spot a problem, please can you post metadata and contents of the file:

cd /nfs/path/to/project/CS-xxxxxxx/ # use real path
ls -ls workspaces.json
cat workspaces.json
$ ls -ls workspaces.json
0 -rwxrwxrwx. 1 username group_name 0 Jun  5 17:21 workspaces.json
$ cat workspaces.json
<empty>

Well I think we just figured out the issue… The file is blank :man_facepalming:

I guess I neglected to examine that file. My apologies, I must have multi-tasking poorly.

Do you have a hypothesis about why the file might be blank? The following details may also matter to a recovery strategy:

  1. Had the project been regularly detached from the previous CryoSPARC instance, or did the project transfer involve (not recommended) manual deletion of the cs.lock file?
  2. What was the CryoSPARC software version that previously hosted the project?
  3. Did the project function properly before being detached from the previous CryoSPARC instance?

I’ll ask the user I was helping troubleshoot and see what they say.

Thank you for your help

The project was detached from CryoSPARC v4.7.1 and functioned correctly in that version of CryoSPARC.

It may have had the cs.lock file deleted at some point.

If you have access to the previous (v4.7.1) instance and the project data have not yet been deleted from the CryoSPARC database, the following commands on that previous instance would provide some information on the workspaces:

cryosparcm icli # from shell to CryoSPARC cli
cs_project_id = "P99" # replace with actual old project ID
list(db.projects.find({'uid': cs_project_id}, {'uid': 1, 'detached': 1}))
list(db.workspaces.find({'project_uid': cs_project_id}, {'uid': 1}))

Unfortunately, the instance it was detached from is the same instance it is being imported into but we have update it to v5.0.4 since then and do not have database backups that far back.

Some records of the “pre-detach” state of the project may still be available. Does the project still show in the UI when the Detached button is enabled?