[
https://issues.apache.org/jira/browse/RANGER-3668?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17509017#comment-17509017
]
Jeevan p commented on RANGER-3668:
----------------------------------
so when i tried curling regardless of if i used the right user and pass in
"admin:admin" i get the same error
{code:java}
* Trying 20.75.146.125:443...
* Connected to ************.com (20.75.146.125) port 443 (#0)
* Server auth using Basic with user 'sbadmin'
> GET /service/public/v2/api/roles HTTP/1.1
> Host: **********.com:443
> Authorization: Basic c2JhZG1pbjpUYWtlbWVpbjEz
> User-Agent: curl/7.79.1
> Accept: application/json
> Content-Type: application/json
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
HTTP/1.1 400 Bad Request
< Date: Fri, 18 Mar 2022 18:46:42 GMT
Date: Fri, 18 Mar 2022 18:46:42 GMT
< Content-Type: text/html
Content-Type: text/html
< Content-Length: 248
Content-Length: 248
< Connection: close
Connection: close<
<html>
<head><title>400 The plain HTTP request was sent to HTTPS port</title></head>
<body>
<center><h1>400 Bad Request</h1></center>
<center>The plain HTTP request was sent to HTTPS port</center>
<hr><center>nginx</center>
</body>
</html>
* Closing connection 0 {code}
> JSONDecodeError
> ---------------
>
> Key: RANGER-3668
> URL: https://issues.apache.org/jira/browse/RANGER-3668
> Project: Ranger
> Issue Type: Bug
> Components: Ranger
> Affects Versions: 2.2.0
> Environment: ranger is hosted on azure k8s service, im trying to
> connect to it using apache-ranger python library
> Reporter: Jeevan p
> Priority: Major
> Labels: JSON, apache-ranger, python
>
> {code:java}
> from trino.dbapi import connect
> from trino.auth import BasicAuthentication
> from apache_ranger.model.ranger_service import *
> from apache_ranger.client.ranger_client import *
> from apache_ranger.model.ranger_policy import *
> ranger_url = "http://dummy_host:0000"
> ranger_auth = ("dummy_user", "dummy_pass")
> ranger = RangerClient(ranger_url, ranger_auth)
> for role in ranger.find_roles():
> print(str(role.id)) {code}
> when i try to run the above code i get the below error
> {code:java}
> Traceback (most recent call last):
> File "c:\Users\j.shimoga.prakash\Desktop\pls work - Copy\test.py", line 17,
> in <module>
> for role in ranger.find_roles():
> File "C:\Users\j.shimoga.prakash\Desktop\pls work -
> Copy\venv\lib\site-packages\apache_ranger\client\ranger_client.py", line 254,
> in find_roles
> resp = self.__call_api(RangerClient.FIND_ROLES, filter)
> File "C:\Users\j.shimoga.prakash\Desktop\pls work -
> Copy\venv\lib\site-packages\apache_ranger\client\ranger_client.py", line 334,
> in __call_api
> raise RangerServiceException(api, response)
> File "C:\Users\j.shimoga.prakash\Desktop\pls work -
> Copy\venv\lib\site-packages\apache_ranger\exceptions.py", line 39, in __init__
> respJson = response.json()
> File "C:\Users\j.shimoga.prakash\Desktop\pls work -
> Copy\venv\lib\site-packages\requests\models.py", line 910, in json
> return complexjson.loads(self.text, **kwargs)
> File "C:\Users\j.shimoga.prakash\Desktop\pls work -
> Copy\venv\lib\site-packages\simplejson\__init__.py", line 525, in loads
> return _default_decoder.decode(s)
> File "C:\Users\j.shimoga.prakash\Desktop\pls work -
> Copy\venv\lib\site-packages\simplejson\decoder.py", line 370, in decode
> obj, end = self.raw_decode(s)
> File "C:\Users\j.shimoga.prakash\Desktop\pls work -
> Copy\venv\lib\site-packages\simplejson\decoder.py", line 400, in raw_decode
> return self.scan_once(s, idx=_w(s, idx).end())
> simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
> {code}
> also worth noting, giving in-correct user or pass does not change the error
> received but changing the host or port does give a diff error (max retries
> exceeded)
--
This message was sent by Atlassian Jira
(v8.20.1#820001)