Backing up database issue

Hi,

I am trying to update our CS installation to v4.2.1, as we are currently running v4.1.2. Before trying to update, I was going to make a backup of the database before proceeding but ran into an issue. See the error below. I am happy to provide any logs, but due to any IP concerns, I would prefer to send these via DM or in a secure fashion. When trying to backup the database, I get an error saying that the database is not running. cryosparcm status returns that nothing is currently running, but this is false as I can access the web GUI, start and run jobs, control via python/cryosparc-tools and the cryosparcm icli.

This is running on an EC2 AWS instance.

I’m not sure exactly what is going on, please advise.

(base) [user~]$ crontab -l
0 4 1 * * cryosparcm backup --dir=/path/cryosparc-backups --file=database_backup_$(date +"%A").archive
(base) [user~]$ cryosparcm backup --dir=/path/cryosparc-backups --file=database_backup_$(date +"%A").archive

Backing up to /path/cryosparc-backups/database_backup_Monday.archive

CryoSPARC is not already running.

Starting the database in case it's not already running.
Starting cryoSPARC database
database: ERROR (spawn error)
(base) [user ~]$ cryosparcm status
----------------------------------------------------------------------------
CryoSPARC System master node installed at
/shared/cryosparc/cryosparc_master
Current cryoSPARC version: v4.1.2
----------------------------------------------------------------------------

CryoSPARC process status:

app                              STOPPED   Not started
app_api                          STOPPED   Not started
app_api_dev                      STOPPED   Not started
app_legacy                       STOPPED   Not started
app_legacy_dev                   STOPPED   Not started
command_core                     STOPPED   Not started
command_rtp                      STOPPED   Not started
command_vis                      STOPPED   Not started
database                         FATAL     Exited too quickly (process log may have details)

----------------------------------------------------------------------------
License is valid
----------------------------------------------------------------------------

global config variables:
export CRYOSPARC_LICENSE_ID="our_ID"
export CRYOSPARC_MASTER_HOSTNAME="ip-10-0-0-4"
export CRYOSPARC_DB_PATH="/shared/cryosparc/cryosparc_db"
export CRYOSPARC_BASE_PORT=45000
export CRYOSPARC_DEVELOP=false
export CRYOSPARC_INSECURE=false
export CRYOSPARC_CLICK_WRAP=true
export CRYOSPARC_FORCE_USER=true
export CRYOSPARC_FORCE_HOSTNAME=true```

Hi @kyestachowski,

This happens when either a user is managing CryoSPARC using the wrong username, or somehow the process that was managing the CryoSPARC services has terminated/become orphaned.

First, make sure you’re using the correct user account and you’re in the right folder.

If thats all correct, you will next need to shutdown/kill any orphaned CryoSPARC services. You can do this by first running cryosparcm stop, then enumerating any leftover processes using the command ps -eopid,cmd | grep 'cryosparc\|mongo', and run kill <pid> on those processes.
You can then also check if /tmp/mongodb-*.sock or /tmp/cryosparc-supervisor-*.sock that belonged to the cryosparc process just terminated exist, and delete them as well.

Once that’s done and you’ve confirmed that you’re no longer able to access your CryoSPARC instance, you can then turn it back on (cryosparcm start) and perform a backup before updating.

3 Likes

This worked great, thanks for the prompt response!