Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

How to install Navigator Metadata Server using Python CM Api?

How to install Navigator Metadata Server using Python CM Api?




I am trying to add roles for Management Service. I could add all the roles, except Navigator Metadata Server. I get "NullPointerException" as my code touches the create_role for Navigator Metadata Server.

cm_api.api_client.ApiException: <ns1:XMLFault xmlns:ns1=""><ns1:faultstring xmlns:ns1="">java.lang.RuntimeException: java.lang.NullPointerException</ns1:faultstring></ns1:XMLFault> (error 500)


The debug logs from Cloudera Manager shows the following error:

{"items": [{"type": "NAVIGATORMETADATASERVER", "name": "NAVIGATORMETADATASERVER-1", "hostRef": {"hostId": "my-host-name"}}]}
2015-04-23 04:56:37,280 WARN 1161865304@scm-web-140:com.cloudera.cmf.persist.ReadOnlyDatabaseTaskCallable: Error while executing read only database task


2015-04-23 04:56:37,282 WARN 1161865304@scm-web-140:org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {}ApiRootResourceImpl has thrown exception, unwinding now
java.lang.RuntimeException: java.lang.NullPointerException


Caused by: java.lang.NullPointerException


My code is as follows:


mgmt = ApiResource(<my_configs_here>).get_cloudera_manager().create_mgmt_service(<my_configs_here>)
mgmt.create_role(navms_role_name + '-1', navms_role_type, cm_host_name)

Any help or pointers would be appreciated.