Skip to main content
iEason8
Silver ⭐️⭐️⭐️
September 15, 2020
Solved

Failed to get clientConfig via API /clusters/{clusterName}/services/{serviceName}/clientConfig

I upgraded Cloud Manager from 5.10.0 to 6.3.0, then i tried to run 'wget http://10.0.0.209:7180/api/v13/clusters/{clusterName}/services/{serviceName}/clientConfig', got a error 404. Checked the log file of cloudera-scm-server, got the following:

2020-09-15 04:11:57,977 INFO scm-web-16747:com.cloudera.api.ApiExceptionMapper: Exception caught in API invocation. Msg:Service 'yarn' not found in cluster 'platform-pod10-eason-cdh'.
java.util.NoSuchElementException: Service 'yarn' not found in cluster 'platform-pod10-eason-cdh'.
at com.cloudera.api.dao.impl.ManagerDaoBase.findService(ManagerDaoBase.java:484)
......

but I checked the services via accessing API /clusters/{clusterName}/services/{serviceName}, actually the service 'yarn' is in this cluster, ref:

[root@rhel76x64 ~]# curl http://<user>:<password>@10.0.0.209:7180/api/v13/clusters/platform-pod10-eason-cdh/services/yarn/
{
"healthChecks" : [ {
"name" : "YARN_JOBHISTORY_HEALTH",
"summary" : "GOOD",
"suppressed" : false
}, {
"name" : "YARN_NODE_MANAGERS_HEALTHY",
"summary" : "GOOD",
"suppressed" : false
}, {
"name" : "YARN_RESOURCEMANAGERS_HEALTH",
"summary" : "GOOD",
"suppressed" : false
}, {
"name" : "YARN_USAGE_AGGREGATION_HEALTH",
"summary" : "DISABLED",
"suppressed" : false
} ],
"maintenanceOwners" : [ ],
"name" : "yarn",
"type" : "YARN",
"clusterRef" : {
"clusterName" : "cluster"
},
"serviceUrl" : "http://ip-10-0-0-209.us-west-2.compute.internal:7180/cmf/serviceRedirect/yarn",
"roleInstancesUrl" : "http://ip-10-0-0-209.us-west-2.compute.internal:7180/cmf/serviceRedirect/yarn/instances",
"serviceState" : "STARTED",
"healthSummary" : "GOOD",
"configStalenessStatus" : "FRESH",
"clientConfigStalenessStatus" : "FRESH",
"maintenanceMode" : false,
"displayName" : "YARN (MR2 Included)",
"entityStatus" : "GOOD_HEALTH"

 

In addition, i can get clientConfig successfully by running 'wget http://10.0.0.209:7180/api/v13/clusters/{clusterName}/services/{serviceName}/clientConfig --user=xxx --password=xxx --auth-no-challenge', but base on the specification of API, this API does not require any authentication.

 

Does anyone have a clue about it? Thanks!

Bender
BenderAnswer
Gold ⭐️⭐️⭐️
September 17, 2020

Hello @iEason8 ,

 

you've got a good point. The main page for the doc (which I've cited earlier) says you need authentication for API calls for CM6 however, the section you've found says explicitly it does not require authentication.

 

So I've done some research in our records and found that the desired behaviour for CM6 is to enforce authentication for API calls (internal jira reference OPSAPS-44459) and that there is a bug in our doc (internal jira reference DOCS-4659) that explains "Doc wrongly suggests that clientConfig API call does not require any authentication" and this jira is unresolved at this moment.

 

Sorry for the inconvenience caused. You need to get authenticated to be able to use the API in CM6.

 

Kind regards:

Ferenc

Ferenc Erdelyi, Technical Solutions Manager Was your question answered? Make sure to mark the answer as the accepted solution. If you find a reply useful, say thanks by clicking on the thumbs up button. Learn more about the Cloudera Community: - Community Guidelines (https://community.cloudera.com/t5/custom/page/page-id/Community_Guidelines) - How to use the forum (/t5/help/faqpage)

11 replies

Bender
Gold ⭐️⭐️⭐️
Gold ⭐️⭐️⭐️
September 15, 2020

Hello @iEason8 ,

 

thank you for reaching out to Community! I've noticed that you are using v13 API for CM6.3, however CM6.3 uses v33 API. Please see this reference doc for the API.

 

If you adjust your request accordingly to the new API, do you still have the issue?

 

Kind regards:
Ferenc

Translate
Ferenc Erdelyi, Technical Solutions Manager Was your question answered? Make sure to mark the answer as the accepted solution. If you find a reply useful, say thanks by clicking on the thumbs up button. Learn more about the Cloudera Community: - Community Guidelines (https://community.cloudera.com/t5/custom/page/page-id/Community_Guidelines) - How to use the forum (/t5/help/faqpage)
iEason8
iEason8Author
Silver ⭐️⭐️⭐️
September 15, 2020

@Bender yes, the issue still exists even if i use v33 API.

 

The strange points are:

  1. This API /clusters/{clusterName}/services/{serviceName}/clientConfig is supposed to not require any authentication, but i need to specify credential to access it succesfully via curl/wget.
  2. If i don't specify credential, the error message is "Service 'yarn' not found in cluster 'platform-pod10-eason-cdh'.", but 'yarn' is actually in the cluster, which is confusing.

Is there a switch of the authentication (e.g. turn on/off)? or did i miss anything? Thanks in advance!

 

Translate