DataStax Help Center

Unable to generate Diagnostics Report in OpsCenter 5.2.0 with error "'str' object has no attribute 'role_name'"


Attempts to generate a Diagnostics Report in OpsCenter 5.2.0 fails.


Users who try to generate a Diagnostics Report are presented with a dialog box that contains the error message:

Error: 'str' object has no attribute 'role_name'


As a result of a bug in OpsCenter 5.2.0, credentials are not being passed to the function which generates the Diagnostic Report via the web user interface (internal defect ID OPSC-6172) when authentication is enabled.

Workaround A

In some setups, it is possible to generate a report using OpsCenter API calls on the command line. In order for this to work, the pre-requisites are:

  • run the commands below using the OpsCenter user, e.g. root
  • ensure you have sufficient disk space available in the directory where the command is run

Step A1 - Generate a session token using your OpsCenter credentials (replace "admin" below with the appropriate username and password):

$ curl -X POST -d '{"username":"admin","password":"admin"}' 'http://<opscenterd_IP>:8888/login'

This will return a session ID to use in the next step. Here is an example output:

{"sessionid": "ffd6b01481fcb9d855ba45af00148cf9"}

Step A2 - Using the session ID from the previous step, generate the Diagnostics Report using the API as follows:

$ curl -H 'opscenter-session: ffd6b01481fcb9d855ba45af00148cf9' http://<opscenterd_IP>:8888/<opscenter_cluster_name>/diagnostics.tar.gz > diagnostics.tar.gz

NOTE - The opscenter_cluster_name in the step above is an "encoded" version of the cluster's name in cassandra.yaml. For example for the cluster name "My Prod Cluster", the equivalent name in OpsCenter is "My_Prod_Cluster", i.e. the spaces are replaced with the underscore (_) character.

NOTE - The diagnostics.tar.gz file will be created where the curl command is run above.

Step A3 - Download the resulting diagnostics.tar.gz zipped tarball from the OpsCenter server and attach it to the relevant Support ticket as appropriate.

Workaround B

An easier way to get around the problem is to temporarily disable OpsCenter authentication as follows:

Step B1 - Edit opscenterd.conf:

enabled = False

Step B2 - Restart OpsCenter.

Step B3 - Generate the Diagnostics Report as normal.

Step B4 - Re-enable authentication and restart OpsCenter:

enabled = True

NOTE - This will not delete the existing password DB and is safe to do.

Workaround C

It is also possible to generate a Diagnostic for a single node. Simply follow the instructions in the article How to generate an OpsCenter Diagnostics Report for a specific node.


Defect OPSC-6172 has been fixed in OpsCenter release 5.2.1. Upgrade to the latest version of OpsCenter to resolve this issue.

See also

KB article - How to generate an OpsCenter Diagnostics Report for a specific node

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request


Powered by Zendesk