Unable to unarchive P4: ServerError: unarchive error: project is detached

Hi, I faced a problem in data managment. I archived my project first, then I detached the same project. Now I want to unarchive the project. but it has an error “Unable to unarchive P4: ServerError: unarchive error: project is detached”. How can I fix this project?

Best,

Feng

@Feng What happens if you try to attach the project?

Oh, I just want to delete the project. But there is no option to delete the whole project after your archived the project.

Best,

Feng

EDIT: This command does not work for this situation.

In that case, you may try this command (CORRECTED):

csm cli "update_project('P4', {'archived': False})"
and then try delete the project. Does that work?

Hi, It doesn’t work. Below is the output:
Error for “update_project” with params (‘P4’, {‘archived’: False}):
ServerError: validation error: project P4 is archived
Traceback (most recent call last):
File “/data2/cryosparc2/cryosparc_master/cryosparc_command/commandcommon.py”, line 200, in wrapper
res = func(*args, **kwargs)
File “/data2/cryosparc2/cryosparc_master/cryosparc_command/commandcommon.py”, line 262, in wrapper
assert not project[‘archived’], f"validation error: project {project_uid} is archived"
AssertionError: validation error: project P4 is archived

Best,

Feng

EDIT: the command provided here is not correct.
@Feng Please can you try this icli command instead

cryosparcm icli
db.projects.update_one({'project_uid': 'P4'}, {'archived': False})
before attempting to delete the project.

Thanks for your help. After I tried this command. It shows valueError. Like below:
/data2/cryosparc2/cryosparc_master/deps/anaconda/envs/cryosparc_master_env/lib/python3.8/site-packages/pymongo/common.py in validate_ok_for_update(update)
563 first = next(iter(update))
564 if is_document and not first.startswith(“"): --> 565 raise ValueError("update only works with operators”)
566
567

ValueError: update only works with $ operators
It didn’t change the status of the project.

Best,

Feng

Hi @Feng,

The previous command is missing a few characters, apologies for the confusion. Could you please try

cryosparcm icli
db.projects.update_one({'project_uid': 'P4'}, {'$set': {'archived': False}})

Hi nwong,
I tried your new order and then restart the cryosparc, but the status of the project P4 didn’t update. When I input your order, the output color is red. I guess it may wrong? Thank you so much.

In [1]: db.projects.update_one({‘project_uid’: ‘P4’}, {‘$set’: {‘archived’: False}})

Out[1]: <pymongo.results.UpdateResult at 0x2aaacb069500>

Best,

Feng

@Feng,

That output is expected, are you able to attach the project ‘P4’ now? If you need to do so manually you can use the same command with the ‘detached’ field instead:

db.projects.update_one({‘project_uid’: ‘P4’}, {‘$set’: {‘detached’: False}})

and if you want to simply mark the project is deleted so it doesn’t appear in the UI anymore:

db.projects.update_one({‘project_uid’: ‘P4’}, {‘$set’: {‘deleted’: True}})

Hi nwong,

I cannot attach the project, and I cann’t delete the project by the order either. My cryosparc version is V4.2.1.

In [2]: db.projects.update_one({‘project_uid’: ‘P4’}, {‘$set’: {‘archived’: False}})

Out[2]: <pymongo.results.UpdateResult at 0x2aaacb818c00>

In [3]: db.projects.update_one({‘project_uid’: ‘P4’}, {‘$set’: {‘deteched’: False}})

Out[3]: <pymongo.results.UpdateResult at 0x2aaab4371500>

In [4]: db.projects.update_one({‘project_uid’: ‘P4’}, {‘$set’: {‘deleted’: False}})

Out[4]: <pymongo.results.UpdateResult at 0x2aaacaf730c0>

Best,

Feng

@Feng,

In [3]: db.projects.update_one({‘project_uid’: ‘P4’}, {‘$set’: {‘deteched’: False}})
Out[3]: <pymongo.results.UpdateResult at 0x2aaab4371500>

It seems you misspelled ‘detached’ in the command above.

In [4]: db.projects.update_one({‘project_uid’: ‘P4’}, {‘$set’: {‘deleted’: False}})
Out[4]: <pymongo.results.UpdateResult at 0x2aaacaf730c0>

Please try using the correct command with {‘deleted’: True}.

db.projects.update_one({‘project_uid’: ‘P4’}, {‘$set’: {‘deleted’: True}})
2 Likes

Sorry about that. Actually I had realized it after I replied to you. I had used the right orders, but it didn’t work.

Best,

Feng

Sorry about that. Actually I had realized it after I replied to you. I had used the right orders, but it didn’t work.

Best,

Feng

Please can you post the exact command you used, the command’s output, and any indications of the command’s failure to help with the underlying issue.

Hi
I followed your suggestions. run cryosparcm icli orders first.


Then restart my cryosparc

but the project P4 is still the same with the previous state. Can’t be deleted.

Thanks a lot for your help.

Best,

Feng

Hi @Feng,

I realized I’ve been sending you the command with the wrong search key, could you please retry them with:

db.projects.update_one({'uid': 'P4'}, {'$set': {'archived': False}})

(note that project_uid is replaced with just uid)

and similarly for the other commands.

Hi nwong,

Yes. it works after change the new order. Thank so much.

Best,
Feng