Authentication Failed Code 18

Hi,

I have a cryosparc instance with a master and multiple worker nodes. I am currently trying to add an additional lane with a slurm cluster. The whole progress is a bit complicated as the cluster is shared with a different group and is therefore in a different network segment and user a different user management.

I successfully installed the cryosparc worker and connected the cluster to the cryosparc master. It shows up in the lane list and I can submit jobs to it. However, the jobs don’t run. The sbatch command gets executed and the job starts at the computing node of the slurm cluster. Then, something goes wrong and I suspect, the reason is, that the worker cannot access the cryosparc database (I found errors regarding pymongo and authentication in the job log).

Do you have an Idea what may cause this error? Is that a network issue? Or maybe a user issue?

OperationFailure: Authentication failed., full error: {‘ok’: 0.0, ‘errmsg’:
‘Authentication failed.’, ‘code’: 18, ‘codeName’: ‘AuthenticationFailed’,
‘operationTime’: Timestamp(1777019948, 23), ‘$clusterTime’: {‘clusterTime’:
Timestamp(1777019948, 23), ‘signature’: {‘hash’:
b’\x15V\xc2k\x0eR\xd8\x97\x15t\xda\xa76\xf7\x8e\xb8&\xb1t6’, ‘keyId’:
7593353178322567184}}}

can be caused by a mismatch between

  1. the CRYOSPARC_LICENSE_ID values defined for the master (usually inside cryosparc_master/config.sh) and for the worker (usually inside cryosparc_worker/config.sh), respectively.
  2. master and worker settings for the CRYOSPARC_DB_ENABLE_AUTH environment variable.

Please ensure matching values between the master and all worker installations of this CryoSPARC instance.
[Post updated 2026-05-06]

Sorry for the late reply, I just got around today to work on this.

Thanks a lot, setting CRYOSPARC_DB_ENABLE_AUTH to false in the Master config.sh solved the issue for me.

What does this variable actually do, btw? Is setting this to false weakening the security? If yes, is there something I could do on the worker side to achieve the same thing without opening the DB too much?

Database authentication mitigates the risk of database corruption that may result, for example, from a misconfigured additional CryoSPARC installation that is (incorrectly) configured to use the same master host and port range.

Yes. Ensure that the effective worker configuration is compatible with the master configuration when CRYOSPARC_DB_ENABLE_AUTH is enabled.

Specific steps depend on your configuration. Please can you initially share with me (via forum private message) the outputs of these commands:

cat /path/to/cryosparc_master/config.sh
cluster_worker_path=/path/to/cluster/cryosparc_worker/
cat ${cluster_worker_path}/config.sh
realpath $cluster_worker_path
# CryoSPARC v4
cryosparcm cli "get_scheduler_targets()"
# CryoSPARC v5
cryosparcm resources

Thanks @niklas for sharing configuration details privately. I noticed a mismatch between the CRYOSPARC_LICENSE_ID values for the master and worker, respectively. The mismatch could be the cause of the AuthenticationFailed error, and ensuring the IDs match may allow re-enabling database authentication. Can the master value also be used for the worker, or is the worker installation also used by another CryoSPARC master installation?

Yes, setting the worker to the correct License ID solved the issue also with DB Auth enabled.

That was my stupid mistake, I probably copied the ID from the wrong Cryosparc instance, when installing the cluster :man_facepalming:

Thanks a lot for your help, tracking this down

1 Like