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?
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
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.
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>
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: