Support Questions
Find answers, ask questions, and share your expertise

Error "Requested URL not found" while creating cluster using CM-api

Error "Requested URL not found" while creating cluster using CM-api

New Contributor

Hi All,

I have been trying to use the CM-api python client to create the cluster. As i have already pushed the cloudera onto the 5 nodes using the Puppet tool and the services cloudera-scm-server/agent/server-db are running, But i am facing issues to create the cluster by modifying the example file given in  "". 


I have modified the file with parameters and hostnames as shown below. And i am executing "python" from one of the nodes by storing modified example file in it.

cm_host = ""
cm_port = 7180
host_list = ['', '', '', '']
cluster_name = "Cluster 1"
cdh_version = "CDH5" 
cdh_version_number = "5.4.5" 
hive_metastore_host = ""
hive_metastore_name = "hive"
hive_metastore_password = "admin" 
hive_metastore_database_type = "postgresql"
hive_metastore_database_port = 7432
reports_manager_host = ""
reports_manager_name = "reports_manager"
reports_manager_username = "rman"
reports_manager_password = "admin" 
reports_manager_database_type = "postgresql"
cm_username = "admin"
cm_password = "admin"
cm_service_name = "mgmt"
host_username = "root"
host_password = "cloudera"
cm_repo_url =  None
# cm_repo_url = "deb lucid-cm5 contrib" # OPTIONAL: only if you want to use a specific repo; this is specific to Debian


Error i am facing is 

[root@n2 ~]# python
Traceback (most recent call last):
  File "", line 238, in <module>
  File "", line 235, in main
  File "", line 62, in set_up_cluster
  File "/usr/lib/python2.6/site-packages/cm_api/endpoints/", line 451, in begin_trial
    self._post("trial/begin", None, api_version=6)
  File "/usr/lib/python2.6/site-packages/cm_api/endpoints/", line 362, in _post
  File "/usr/lib/python2.6/site-packages/cm_api/endpoints/", line 380, in _call
  File "/usr/lib/python2.6/site-packages/cm_api/endpoints/", line 139, in call
    ret = method(path, params=params)
  File "/usr/lib/python2.6/site-packages/cm_api/", line 148, in post
  File "/usr/lib/python2.6/site-packages/cm_api/", line 73, in invoke
  File "/usr/lib/python2.6/site-packages/cm_api/", line 174, in execute
    raise self._exc_class(ex)
cm_api.api_client.ApiException: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!--
 Stylesheet for Squid Error pages
 Adapted from design by Free CSS Templates
 Released for free under a Creative Commons Attribution 2.5 License

/* Page basics */
* {
        font-family: verdana, sans-serif;

html body {
        margin: 0;
        padding: 0;
        background: #efefef;
        font-size: 12px;
        color: #1e1e1e;

/* Page displayed title area */
#titles {
        margin-left: 15px;
        padding: 10px;
        padding-left: 100px;
        background: url('') no-repeat left;

/* initial title */
#titles h1 {
        color: #000000;
#titles h2 {
        color: #000000;

/* special event: FTP success page titles */
#titles ftpsuccess {

/* Page displayed body content area */
#content {
        padding: 10px;
        background: #ffffff;

/* General text */
p {

/* error brief description */
#error p {

/* some data which may have caused the problem */
#data {

/* the error message received from the system or other software */
#sysmsg {

pre {

/* special event: FTP / Gopher directory listing */
#dirmsg {
    font-family: courier;
    color: black;
    font-size: 10pt;
#dirlisting {
    margin-left: 2%;
    margin-right: 2%;
#dirlisting tr.entry td.icon,td.filename,td.size, {
    border-bottom: groove;
#dirlisting td.size {
    width: 50px;
    text-align: right;
    padding-right: 5px;

/* horizontal lines */
hr {
        margin: 0;

/* page displayed footer area */
#footer {
        font-size: 9px;
        padding-left: 10px;

:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; float: right; }
<div id="titles">
<h2>The requested URL could not be retrieved</h2>

<div id="content">
<p><b>Invalid Request</b> error was encountered while trying to process the request:</p>

<blockquote id="data">
<pre>POST /api/v10/cm/trial/begin HTTP/1.1
Accept-Encoding: identity
Content-Type: application/json
Connection: close
User-Agent: Python-urllib/2.6

<p>Some possible problems are:</p>
<li><p>Missing or unknown request method.</p></li>
<li><p>Missing URL.</p></li>
<li><p>Missing HTTP Identifier (HTTP/1.0).</p></li>
<li><p>Request is too large.</p></li>
<li><p>Content-Length missing for POST or PUT requests.</p></li>
<li><p>Illegal character in hostname; underscores are not allowed.</p></li>
<li><p>HTTP/1.1 <q>Expect:</q> feature is being asked from an HTTP/1.0 software.</p></li>

<p>Your cache administrator is <a href="mailto:root?subject=CacheErrorInfo%20-%20ERR_INVALID_REQ&amp;body=CacheHost%3A%20tslinux01%0D%0AErrPage%3A%20ERR_INVALID_REQ%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Mon,">root</a>.</p>

<div id="footer">
<p>Generated Mon, 12 Oct 2015 14:28:38 GMT by tslinux01 (squid/3.1.10)</p>
 (error 411)

Please help me to fix this.


Re: Error "Requested URL not found" while creating cluster using CM-api


did you manage to resolve the issue? I'm facing the same problem with cdh5.5

Re: Error "Requested URL not found" while creating cluster using CM-api

New Contributor

No luck. I am still facing the issues. Did u try using any other versions?

Re: Error "Requested URL not found" while creating cluster using CM-api

I'm guessing that the installed CM version is not the latest, so the v10 endpoint doesn't exist. To fix this, you can specify the API version that the python client bindings will use, or just download an older version of the python client bindings.

The python client bindings will default to the latest API version at the time the client was published.

Re: Error "Requested URL not found" while creating cluster using CM-api


I'm using the latest CM, re-submitting the ApiResource call with version 10 and this is now working for me:

api = ApiResource(cm_host, cm_port, cm_username, cm_password, version=10)


thanks Darren