I want to list the configuration values of CM. So I have this code that is working on differents clusters (5.9.1, 5.10.0 and 5.8.3) :
from cm_api.api_client import ApiResource
cm_host = "XX.XX.70.12"
api = ApiResource(cm_host, username="supervision-user", password="XXXXXX" )
cm_config = api.get_cloudera_manager().get_config(view='full')
for item in cm_config:
print("%s => %s" % (item , cm_config[item]))
here are the error :
Traceback (most recent call last):
File "./test.py", line 17, in <module>
cm_config = api.get_cloudera_manager().get_config(view='full')
File "build/bdist.linux-x86_64/egg/cm_api/endpoints/cms.py", line 115, in get_config
File "build/bdist.linux-x86_64/egg/cm_api/endpoints/types.py", line 340, in _get_config
File "build/bdist.linux-x86_64/egg/cm_api/resource.py", line 110, in get
File "build/bdist.linux-x86_64/egg/cm_api/resource.py", line 73, in invoke
File "build/bdist.linux-x86_64/egg/cm_api/http_client.py", line 174, in execute
cm_api.api_client.ApiException: (error 403)
So I don't have any clue where the problem come from. What could it be ?
Thank you,
Ps : I user python cloudera API v 11.
Can you validate user password? 403 error means forbidden
I answer my own question: in fact, it come from the user right. I was not querying my different clusters with the same user. So my reading user is able to query :
the Services
the Group Roles
but not the Cloudera Manager Parameters !
it need an admin account to be able to query everything...
Related
I'v been trying to launch project(example_setup folder):
https://github.com/OTA-Insight/djangosaml2idp/tree/master/example_setup
I can anybody answer to men according with documentation. But it does not working. First problem, as I undesrtand is in date of methadata in SP(idp_metadata.xml)- validUntil="2020-12-27T12:41:18Z"> . It does not valid at the moment, and was changed to future date, as example(validUntil="2030-12-27T12:41:18Z"). But next I got another problem when trying to sign in to SP(localhost:8000) in my browser, I have more problem:
Error during SAML2 authentication
IncorrectlySigned
In attempts to find problem, I found the place where it is occured. In original it iis in tryexcept block, and can't be found easy.
Traceback (most recent call last):
File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/djangosaml2idp/views.py", line 251, in get
req_info = idp_server.parse_authn_request(request.session['SAMLRequest'], binding)
File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/server.py", line 238, in parse_authn_request
return self._parse_request(enc_request, AuthnRequest,
File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/entity.py", line 1036, in _parse_request
_request = _request.loads(xmlstr, binding, origdoc=enc_request,
File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/request.py", line 110, in loads
return self._loads(xmldata, binding, origdoc, must,
File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/request.py", line 51, in _loads
print(self.signature_check(xmldata, origdoc=origdoc,
File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/sigver.py", line 1662, in correctly_signed_authn_request
return self.correctly_signed_message(decoded_xml, 'authn_request', must, origdoc, only_valid_cert=only_valid_cert)
File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/sigver.py", line 1653, in correctly_signed_message
return self._check_signature(
File "/home/dmitriy/projects/djangosaml2idp/example_setup/idp/venv/lib/python3.8/site-packages/saml2/sigver.py", line 1503, in _check_signature
raise MissingKey(_issuer)
saml2.sigver.MissingKey: http://localhost:8000/saml2/metadata/
Internal Server Error: /idp/login/process/
Some key is missing:
Error during SAML2 authentication
MissingKey
http://localhost:8000/saml2/metadata/
My idp_metada in the SP is like in the [example_setup][1] folder of project, only validUntil has been changed as I said above, user in IDP has been created as superuser, I also tried to create user in the SP, the same as in the IDP, but nothing changed
Can anybody anser to me, what my problem is?
It's no any information in docs. But you need to create SP inside IDP from admin panel. That was resolved my problem.
today I'm updated the elastic search from 1.6 to 2.1, because 1.6 is vulnerable version, after this update my website not working, give this error :
Traceback (most recent call last):
File "manage.py", line 8, in <module>
from app import app, db
File "/opt/project/app/__init__.py", line 30, in <module>
es.create_index(app.config['ELASTICSEARCH_INDEX'])
File "/usr/local/lib/python2.7/dist-packages/pyelasticsearch/client.py", line 93, in decorate
return func(*args, query_params=query_params, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pyelasticsearch/client.py", line 1033, in create_index
query_params=query_params)
File "/usr/local/lib/python2.7/dist-packages/pyelasticsearch/client.py", line 285, in send_request
self._raise_exception(status, error_message)
File "/usr/local/lib/python2.7/dist-packages/pyelasticsearch/client.py", line 299, in _raise_exception
raise error_class(status, error_message)
pyelasticsearch.exceptions.ElasticHttpError: (400, u'index_already_exists_exception')
make: *** [run] Error 1
the code is this :
redis = Redis()
es = ElasticSearch(app.config['ELASTICSEARCH_URI'])
try:
es.create_index(app.config['ELASTICSEARCH_INDEX'])
except IndexAlreadyExistsError, e:
pass
where is wrong ? what is new on this new version ?
You're getting the following error: index_already_exists_exception
This means that you're trying to create an index that already exists. The second time you run your program you either need to delete your index first or create it only if it doesn't exist.
You have handled the exception using IndexAlreadyExistsError. Try using TransportError to handle the exception.
And you can also add a check like :
exist = es.indices.exists(index_name)
if not exist:
es.create_index(app.config['ELASTICSEARCH_INDEX'])
I was trying to run a query for data in one of my google docs, and it's worked for several months. Starting yesterday or the day before, I noticed that my script no longer works. Has Google updated their api for spreadsheets? Has anybody found a workaround?
My error looks like this:
Traceback (most recent call last):
File "build_packer_image.py", line 311, in <module>
for index, entry in enumerate(client.GetWorksheetsFeed(doc_key).entry):
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/gdata/spreadsheet/service.py", line 129, in GetWorksheetsFeed
converter=gdata.spreadsheet.SpreadsheetsWorksheetsFeedFromString)
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/gdata/service.py", line 1074, in Get
return converter(result_body)
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/gdata/spreadsheet/__init__.py", line 411, in SpreadsheetsWorksheetsFeedFromString
xml_string)
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/atom/__init__.py", line 93, in optional_warn_function
return f(*args, **kwargs)
File "/build/toolchain/mac-10.5-32/lib/python2.7/site-packages/atom/__init__.py", line 127, in CreateClassFromXMLString
tree = ElementTree.fromstring(xml_string.replace('doctype','DOCTYPE'))
File "<string>", line 125, in XML
cElementTree.ParseError: no element found: line 1, column 0
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I am using:
Python 2.7.5
gdata 2.0.18
I am just using an document key and no oauth in my code, if that makes a difference (I am passing in the username and password to the ClientLogin method)
Actually here is the answer to the problem:
The use of client login (using username/password instead of oauth2) is
likely the cause of the error. That protocol was deprecated 3+ years
ago and was just shutdown. If you capture the HTTP response (which
appears to have some HTML content), that might confirm if it is
related to the shutdown. Migrating to OAuth 2 would get your apps
working again.
After sending xml for update in spreadsheet google respond with a login page.
It means the authentication is not working for gdata now
https://code.google.com/a/google.com/p/apps-api-issues/issues/detail?id=3851#c2
I'm testing ebaysdk Python library that lets you connect to ebay. Now I'm trying examples from: https://github.com/timotheus/ebaysdk-python/
So far I got stuck at this example:
from ebaysdk.shopping import Connection as Shopping
shopping = Shopping(domain="svcs.sandbox.ebay.com", config_file="ebay.yaml")
response = shopping.execute('FindPopularItems',
{'QueryKeywords': 'Python'})
print response.disct()
When I run it. It gives me this error:
Traceback (most recent call last):
File "ebay-test.py", line 13, in <module>
{'QueryKeywords': 'Python'})
File "/usr/local/lib/python2.7/dist-packages/ebaysdk-2.1.0-py2.7.egg/ebaysdk/connection.py", line 123, in execute
self.error_check()
File "/usr/local/lib/python2.7/dist-packages/ebaysdk-2.1.0-py2.7.egg/ebaysdk/connection.py", line 193, in error_check
estr = self.error()
File "/usr/local/lib/python2.7/dist-packages/ebaysdk-2.1.0-py2.7.egg/ebaysdk/connection.py", line 305, in error
error_array.extend(self._get_resp_body_errors())
File "/usr/local/lib/python2.7/dist-packages/ebaysdk-2.1.0-py2.7.egg/ebaysdk/shopping/__init__.py", line 188, in _get_resp_body_errors
dom = self.response.dom()
File "/usr/local/lib/python2.7/dist-packages/ebaysdk-2.1.0-py2.7.egg/ebaysdk/response.py", line 229, in dom
return self._dom
File "/usr/local/lib/python2.7/dist-packages/ebaysdk-2.1.0-py2.7.egg/ebaysdk/response.py", line 216, in __getattr__
return getattr(self._obj, name)
AttributeError: 'Response' object has no attribute '_dom'
Am I missing something here or it could be some kind of bug in library?
Do you have a config file? I had a lot of problems getting started with this SDK. To get the yaml config file to work, I had to specify the directory that it was in. So in your example, it would be:
shopping = Shopping(domain="svcs.sandbox.ebay.com", config_file=os.path.join(os.path.dirname(os.path.realpath(__file__)), 'ebay.yaml'))
You should also be able to specify debug=true in your Shopping() declaration as in Shopping(debug=True).
Make sure if you have not, to specify your APP_ID and other necessary values in the config file.
You have the wrong domain, it should be open.api.sandbox.ebay.com. See this page on the ebaysdk github.
Has anybody had any recent success with accessing the Crowd SOAP API via the Suds Python library?
I've found a few people successfully doing it in the past but Atlassian seems to have changed their WSDL since then to make the existing advice not entirely helpful.
Below is the simplest example I've been trying:
from suds.client import Client
url = 'https://crowd.hugeinc.com/services/SecurityServer?wsdl'
client = Client(url)
Unfortunately that generates the following error:
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Users/soconnor/.virtualenvs/hugeface/lib/python2.6/site-packages/suds/client.py", line 116, in __init__
sd = ServiceDefinition(self.wsdl, s)
File "/Users/soconnor/.virtualenvs/hugeface/lib/python2.6/site-packages/suds/servicedefinition.py", line 58, in __init__
self.paramtypes()
File "/Users/soconnor/.virtualenvs/hugeface/lib/python2.6/site-packages/suds/servicedefinition.py", line 137, in paramtypes
item = (pd[1], pd[1].resolve())
File "/Users/soconnor/.virtualenvs/hugeface/lib/python2.6/site-packages/suds/xsd/sxbasic.py", line 63, in resolve
raise TypeNotFound(qref)
TypeNotFound: Type not found: '(AuthenticatedToken, http://authentication.integration.crowd.atlassian.com, )'
I've tried to both binding and doctors to fix this problem to no avail. Neither approach resulted in any change. Any further recommendations or suggestions would be incredibly helpful.
There is a patch for the Crowd WSDL here:
http://jira.atlassian.com/browse/CWD-159