简体   繁体   中英

Cannot connect to Tableau Server using Tableau Server Client (TSC-Python)

My script (Iam not using saml for authentication):

import tableauserverclient as TSC


tableau_auth = TSC.TableauAuth('myusername', 'mypassword', site_id='sitename')

server = TSC.Server('tableauserverurl')

server.auth.sign_in(tableau_auth)

Error:

Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 70, in _check_status
    raise ServerResponseError.from_response(server_response.content, self.parent_srv.namespace)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\tableauserverclient\server\endpoint\exceptions.py", line 17, in from_response
    parsed_response = ET.fromstring(resp)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\xml\etree\ElementTree.py", line 1315, in XML
    parser.feed(text)
xml.etree.ElementTree.ParseError: mismatched tag: line 31, column 79

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:/Users/Admin/PycharmProjects/T_SERVER_test/server_description.py", line 7, in <module>
    server.auth.sign_in(tableau_auth)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 127, in wrapper
    return func(self, *args, **kwargs)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\tableauserverclient\server\endpoint\auth_endpoint.py", line 32, in sign_in
    self._check_status(server_response)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python37\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 76, in _check_status
    raise NonXMLResponseError(server_response.content)
tableauserverclient.server.endpoint.exceptions.NonXMLResponseError: b'<!DOCTYPE html><html><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Page Not Found</title><style>html {\n  height: 100%;\n  width: 100%;\n}\nbody {\n  position: absolute;\n  width: 100%;\n  margin: 0;\n  top: 20%;\n  font-family: Verdana, Geneva, sans-serif;\n  text-align: center;\n  color: #4E4E4E;\n}\n\nh1 {\n  font-size: 32px;\n  margin-bottom: 22px;\n}\n\nh1, h3 {\n  font-weight: normal;\n}\n\nh3 {\n  font-size: 19px;\n}\n\n#requestIdContainer {\n  font-size: 19px;\n  display: none;\n}</style><script src="/embeddedErrorPage.js?2020_2_150_ue2837ac2bm"></script></head></html><body><h1>The page you were looking for could not be found.</h1><h3>Check the URL for errors.</h3><p id="requestIdContainer"><span>Request ID</span>&nbsp;<span id="requestId"></span></p></body>'

Thanks for replay!

Personal access tokens are now implemented and may be used as an alternative authentication strategy for users who have this problem.

Credit to this comment on a related github issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM