Micromamba crash issue during installation

$ echo $SHELL
/bin/bash
$ grep "$(df . | tail -n 1 | awk '{print $NF}') " /proc/mounts
XX:XX nfs rw,relatime,vers=3,rsize=131072,wsize=131072,namlen=255,hard,proto=rdma,port=XX,timeo=XXX,retrans=2,sec=sys,local_lock=none,addr=XXX 0 0

@selefant2 Would you like to try the following inside the freshly unpacked cryosparc_master/ and cryosparc_worker/ directories: Replace the the existing

deps_bundle_hashes/python/install_python.sh

files with the following script

set -e
cd ${CRYOSPARC_ROOT_DIR}
echo "  ------------------------------------------------------------------------"
mkdir -p ${CRYOSPARC_ROOT_DIR}/deps/anaconda
rm -rf ${CRYOSPARC_ROOT_DIR}/deps/anaconda
echo "  Installing anaconda python..."
echo "  ------------------------------------------------------------------------"
bash ${CRYOSPARC_ROOT_DIR}/deps_bundle/python/anaconda.sh -b -p "${CRYOSPARC_ROOT_DIR}/deps/anaconda"
echo "  ------------------------------------------------------------------------"
echo "    Done."
echo "    anaconda python installation successful."
echo "  ------------------------------------------------------------------------"
echo "  Extracting all conda packages..."
echo "  ------------------------------------------------------------------------"
conda_config_file="${CRYOSPARC_ROOT_DIR}/deps/anaconda/.condarc"
conda_env_path="${CRYOSPARC_ROOT_DIR}/deps/anaconda/envs/${CRYOSPARC_CONDA_ENV}"
mkdir -p "${conda_env_path}"
tar --checkpoint=.1000 -xzf deps_bundle/python/python_packages/anaconda_packages/${CRYOSPARC_CONDA_ENV}.tar.gz --directory "${conda_env_path}"
source "${conda_env_path}/bin/activate"
conda-unpack
echo ""
echo "  ------------------------------------------------------------------------"
echo "    Done."
echo "    conda packages installation successful."
echo "  ------------------------------------------------------------------------"
echo "  Main dependency installation completed. Continuing..."
echo "  ------------------------------------------------------------------------"

Does installation succeed after this replacement?

Dear wtempel,

thank you very much for your help, I indeed made the replacemente you mentioned. Unfortunately installation still breaks. This is the error

Done.
    anaconda python installation successful.
  ------------------------------------------------------------------------
  Extracting all conda packages...
  ------------------------------------------------------------------------
.................................................................................................
  ------------------------------------------------------------------------
    Done.
    conda packages installation successful.
  ------------------------------------------------------------------------
  Main dependency installation completed. Continuing...
  ------------------------------------------------------------------------
  Completed.
  Currently checking hash for mongodb
  Dependencies for mongodb have changed - reinstalling...
  ------------------------------------------------------------------------
  mongodb 3.6.23 installation successful.
  ------------------------------------------------------------------------
  Completed.
  Completed dependency check. 
Traceback (most recent call last):
  File "XXX/cryosparc_master/deps/anaconda/bin/conda", line 12, in <module>
    from conda.cli import main
ModuleNotFoundError: No module named 'conda'
Warning: Could not activate conda environment; this indicates that a cryoSPARC installation is either incomplete or in progress
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'libtiff'

Thanks @selefant1 for trying that. Please can make a change in addition to the change in Micromamba crash issue during installation - #22 by wtempel before retrying the install.sh command:
Inside cryosparc_master/bin/cryosparcm, replace the definition of the activate_conda_env

     52 activate_conda_env() {
     53     if [[ -f "$CRYOSPARC_ROOT_DIR/deps/anaconda/etc/profile.d/conda.sh" ]]; then
     54         source "$CRYOSPARC_ROOT_DIR/deps/anaconda/etc/profile.d/conda.sh"
     55         conda activate $CRYOSPARC_CONDA_ENV || echo "Warning: Could not activate conda environment; this indicates that a cr     55 yoSPARC installation is either incomplete or in progress" 1>&2
     56     else
     57         echo "Warning: conda environment not found; this indicates that a cryoSPARC installation is either incomplete or in      57 progress" 1>&2
     58     fi
     59 }

with just

activate_conda_env() {
    if ! command source "$CRYOSPARC_ROOT_DIR/deps/anaconda/bin/activate" ${CRYOSPARC_CONDA_ENV} ; then
        echo "Warning: Could not activate conda environment; this indicates that a CryoSPARC installation is either incomplete or in progress" 1>&2
    fi
}

Similarly, replace inside cryosparc_worker/bin/cryosparcw

     78 activate_conda_env() {
     79     if [[ -f "$CRYOSPARC_ROOT_DIR/deps/anaconda/etc/profile.d/conda.sh" ]]; then
     80         source "$CRYOSPARC_ROOT_DIR/deps/anaconda/etc/profile.d/conda.sh"
     81         conda activate $CRYOSPARC_CONDA_ENV || echo "Warning: Could not activate conda environment; this indicates that a cr     81 yoSPARC installation is either incomplete or in progress" 1>&2
     82     else
     83         echo "Warning: conda environment not found; this indicates that a cryoSPARC installation is either incomplete or in      83 progress" 1>&2
     84     fi
     85 }

with

activate_conda_env() {
    if ! command source "$CRYOSPARC_ROOT_DIR/deps/anaconda/bin/activate" ${CRYOSPARC_CONDA_ENV} ; then
        echo "Warning: Could not activate conda environment; this indicates that a CryoSPARC installation is either incomplete or in progress" 1>&2
    fi
}

Do these changes resolve the problem?

Dear wtempel,

please installation still crashes, this is the error

   micromamba run -p /path/redacted/cryosparc_master/deps/anaconda mycommand

installation finished.
  ------------------------------------------------------------------------
    Done.
    anaconda python installation successful.
  ------------------------------------------------------------------------
  Extracting all conda packages...
  ------------------------------------------------------------------------
.................................................................................................
  ------------------------------------------------------------------------
    Done.
    conda packages installation successful.
  ------------------------------------------------------------------------
  Main dependency installation completed. Continuing...
  ------------------------------------------------------------------------
  Completed.
  Currently checking hash for mongodb
  Dependencies for mongodb have changed - reinstalling...
  ------------------------------------------------------------------------
  mongodb 3.6.23 installation successful.
  ------------------------------------------------------------------------
  Completed.
  Completed dependency check. 
Traceback (most recent call last):
  File "/path/redacted/cryosparc_master/deps/anaconda/bin/conda", line 12, in <module>
    from conda.cli import main
ModuleNotFoundError: No module named 'conda'
Warning: Could not activate conda environment; this indicates that a CryoSPARC installation is either incomplete or in progress
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'libtiff'

Dear wtempel,

please could you confirm the following:

  1. Is this instruction for the installation correct?
    env -i ./install.sh --license ${LICENSE_ID} --port ${PORTN} 2>&1
    
  2. I am also running this instruction with a clean environment, is this correct? I don’t load any conda, miniforge … etc …

Thank you very much for your help and support

Yes, provided cryosparc_master/ was/is the current working directory. 2>&1 at the end could have been omitted if there was not attempt to collect the command’s output in a file.

Correct. We wanted to ensure no conda/miniforge installation or environment would interfere with the installation.
Right after an installation fails with
ModuleNotFoundError: No module named 'libtiff', would you be able to create an archive with the command (this command will create an ≈ ½ a gigabyte file)

tar zcvf master_deps_anaconda.tar.gz /path/redacted/cryosparc_master/deps/anaconda

and share the resulting master_deps_anaconda.tar.gz with the CryoSPARC developers? I will send you a direct message with upload instructions.

@selefant2 Our testing indicated that the absolute path that contains cryosparc_master/ or cryosparc_worker/ must not exceed 83 characters, after dereferencing possible symbolic links. Please can you identify an installation directory such that the output of the command inside that directory:
echo -n $(pwd -P) | wc -c
does not exceed 83 and let us know if installation succeeds.

Hi everyone, quick update on this: We’ve made a change in the latest CryoSPARC v4.7 that prevents installation within a long path that will trigger this crash. Thank you all very much for your feedback and for providing detailed and helpful troubleshooting information; going to consider this resolved.

Hello, I’d like to report that today we tried to update our CryoSPARC 4.4.1 to 4.7.1 using the cryosparcm update but failed on the same error as this thread talks about.

I am from the same institute as @selefant @selefant1 @selefant2 :slight_smile:

We made a database backup of the 4.4.1 instance and have the original cryosparc_master.tar.gz and cryosparc_worker.tar.gz so we can restore the original 4.4.1 instance in order to access our projects and data. But we need to update to 4.7.1.

After running cryosparcm update we get a bunch of positively looking outputs such as:

# ============================
Updating to version v4.7.1.

# …

# Successfully updated master to version v4.7.1.

And after this, we get the good old:

Traceback (most recent call last):
File “/nfs/somfolder/anotherfolder/yetanotherfolder/cryosparc_v4.4.1_xxxxxxx_PORT_xxxxxx_LIC_xxxxxxxxxxx_Debian12/cryosparc_master/deps/anaconda/bin/conda”, line 12, in
from conda.cli import main
ModuleNotFoundError: No module named ‘conda’
Warning: Could not activate conda environment; this indicates that a CryoSPARC installation is either incomplete or in progress

@nfrasser in the previous post mentioned this should be fixed in v4.7, but maybe it is not fully fixed? Is there any standard procedure how to recover from this? Thank you for any info.

Best regards

Welcome to the forum @paloha. An update from v4.4.1 to v4.7.1 is still subject to some limitation of v4.4.1. You may want to identify a sufficiently short installation path and install (rather than update) CryoSPARC v4.7.1 there.
Some special precautions are required for the continued use of the existing database, based on your specific circumstances:

  1. Do not try to restore a database back-up that us older than the latest changes in your project directories (such as newer or recently re-run jobs, guide)
  2. What is the type of your current CryoSPARC installation: “single worker”, “master + worker nodes”, or “master + cluster workers”?

We are currently utilizing a system with a master server and cluster workers.

Initially, we installed version 4.4.1 with a shortened name, and later, we upgraded to version 4.7.1.
The update seemed successful, and we restored the backup file that was generated from the older 4.4.1 version.

However, we’re encountering issues as it appears that the worker environment is not being recognized.

When attempting to execute a job, I receive the following error:

[CPU Importing job modules for the type blob_picker_gpu

File XX/cuda_kernels.py line 10, in init cryosparcm_master.cryosparc_compute_engine
File XX/driver.py line 12 in
from cuda import cuda, cudart, nvrtc
ModuleNotFoundError: No module named ‘cuda’

Hi all, I would like to document our user experience with an update from 4.4.1 to 4.7.1 - for other users and maybe for CryoSPARC team to know where things get messy in some cases.

Our installation type is master server and cluster workers. We had CryoSPARC installed in a too long path causing the issue discussed in this thread, however, we were not aware of that.

So according to the documentation, we killed all the jobs, did a DB backup, killed the instance, etc. and run `cryosparcm update`. All seemed to work, so we restorer the old DB and tried to run some jobs to test it - did not work due to the aforementioned conda error. OK, so we installed the 4.4.1 in a shorter path, restored the DB, tried to run some jobs to test it - it did not work again, failing on some worker paths mismatch (my bet is that the DB has the install path stored somewhere and it did not like the new instance path).

This whole thing took quite some time because more people from various deparements were involved. But our group already really needed to run processing, so we decided to simply install a completely fresh install of 4.7.1, but then we had to manually recreate all the users, reconfigure all the cluster lanes, then from the old instance still running we had to detach the projects, then attach them in the new instance. Then I as admin had to change the ownership of the newly attached projects, because the new instance thought I am the owner, since I attached them. Now all seems to work. But it was a pain. These are the commands to change the ownership:

cryosparcm listusers # to find out which user_id belongs to which user
cryosparcm "set_project_owner(project_uid='P1', user_id='ab243720f351f6186928deff')" # to set the ownership of the project

I think it would be great if the official docs contained more information on what to do when an update fails, how to restore a DB from a different version and different location into a new installation without all these troubles.

This is correct. @selefant1 Please can you check the output of the following command on the CryoSPARC master

cryosparcm cli "get_scheduler_targets()"

to see whether the targets’ worker_bin_path records point to the new, shorter /new/path/cryosparc_worker/bin/cryosparcw path. The records can be updated

  • for target nodes, with the command
    /new/path/cryosparc_worker/bin/cryosparcw connect --worker $(hostname -f) --master XXX --port YYY --update
    
  • for target clusters, using the cryosparcm cluster connect command with appropriate cluster info and template files in the working directory