How to set a persistent instance name?

Hello,

In cryoSPARC Live, an administrator user can set the instance name, but this name is always reset to “Structura Bio” after a restart of cryoSPARC. Is there any way to set this instance name permanently? (We have two installations of cryoSPARC, so it would be helpful to have the instance name set, so we always know which installation we are working on.)

Thank you in advance!

Hi @Guillaume,

This might be a bug on our part. The instance name is stored in the database and should persist across restarts of the cryoSPARC instance. To confirm, could you please perform the following steps:

  1. Ensure cryoSPARC is running (cryosparcm start)
  2. Log into the cryoSPARC MongoDB shell: cryosparcm mongo
  3. Query the configuration collection for the instance state: > db.config.find({ name: 'instance_state' }).pretty()
  4. If there is a key-value pair named cryosparc_instanceName with a set value, it should persist across restarts. Please let me know if this is not the case after verifying it is stored in the database correctly
  5. Exit the MongoDB shell: > exit

Thanks,
Suhail

So, from a running cryoSPARC after I set the instance name in cryoSPARC Live, here is what I got from the database:

{
"_id" : ObjectId("885042c8faf868160d9fb928"),
"name" : "instance_state",
"value" : {
	"cryosparc_instanceName" : "\"asterix.icm.uu.se\""
    }
}

Now same thing, but after a restart of cryoSPARC and without logging in or doing anything in cryoSPARC Live:

{
"_id" : ObjectId("885042c8faf868160d9fb928"),
"name" : "instance_state",
"value" : {
	"cryosparc_instanceName" : "\"asterix.icm.uu.se\""
    }
}

And finally, when I log into cryoSPARC Live again, the top left doesn’t show this instance name but instead “Structura Bio”.

Screen Shot 2021-10-14 at 16.37.51

So, it looks like the database contains the correct information, but the web app doesn’t read it correctly from the database?

Hi @Guillaume,

That’s correct, there must be an issue on the application side. If you open up the browser console (right click → inspect element → ‘console’ tab) and refresh the page, are there any logs that begin with Error (getInstanceStateVal) on?

- Suhail

Yes, I see the following error:

Error (getInstanceStateVal) on cryosparc_instanceName 
Object { stack: "r@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:1:4173\n_livedata_result@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:61:17753\nonMessage@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:61:20094\n_launchConnection/this.socket.onmessage/<@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:59:2681\nforEachCallback@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:59:3747\n_launchConnection/this.socket.onmessage@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:59:2650\nt/a</r.prototype.dispatchEvent@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:59:6254\nt/a</k.prototype._dispatchMessage@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:59:19887\nt/a</k.prototype._didMessage@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:59:20789\nt/a</k.websocket/o.ws.onmessage@http://asterix.icm.uu.se:39006/e46087a5cea0470bfe33c956a8e24333c6d22c58.js?meteor_js_resource=true:59:22942\n", isClientSafe: true, error: "unauthorized", reason: "Must be authenticated", details: undefined, message: "Must be authenticated [unauthorized]", errorType: "Meteor.Error" }

Hi @Guillaume,

Thanks very much for the traceback. We’ve identified the error and will resolve it for the next release.

- Suhail

Great, thank you. :+1: