Skip to main content

#With0 diskutieren mit

I'm struggling to use Tableau Server Client to connect to my Tableau Server (using https). When using the basic TSC code to connect to my server the following error gets thrown immediately. I have found a few similar questions on the web but have not found an answer that works with https.

 

Error:

requests.exceptions.SSLError: HTTPSConnectionPool(host='x.y.com', port=443): Max retries exceeded with url: /api/2.4/serverInfo (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1129)')))

 

Code:

tableau_auth = TSC.TableauAuth(USERNAME, PASSWORD, site_id='MySite')

server = TSC.Server(TABLEAU_SERVER, use_server_version=True)

3 Antworten
  1. 8. Okt. 2021, 09:07

    Thanks for your answer. I've tried both options already but was still getting the same error message. Turns out the solution for me was to make sure to run the add_http_options() function before the use_server_version(). The reason being that the use_server_version was failing due to cert as the http options was not set yet.

0/9000

Hi,

 

I'm trying to update server name in the connection info for multiple workbooks.

Few of my workbooks have multiple embedded data sources. My below script is able to update new server name in some of the workbooks but its failing to update server name in few workbooks where I have multiple data sources.

Can someone help me to fix this script ?

 

import tableauserverclient as TSC

tableau_auth = TSC.TableauAuth('ID', 'PWD', site_id='SITE')

server = TSC.Server('ServerURL')

server.auth.sign_in(tableau_auth)

book = xlrd.open_workbook('Excel Sheet containing LUIDs of workbooks')

xl_sheet = book.sheet_by_name('Sheet1')

for i in range(xl_sheet.nrows):

row = xl_sheet.row_values(i)

for cell in row:

#with server.auth.sign_in(headers):

print("here1 , starting with row number: " + str(i))

print(cell)

try: with open("Logs.txt", "a") as f1:

workbook = server.workbooks.get_by_id(cell)

print("below mentioned is workbook id")

f1.write("\nworkbook id is " + workbook.id)

print(workbook.id)

  server.workbooks.populate_connections(workbook)

print("\nThe connections for {0}: ".format(workbook.name))

print([connection.datasource_name for connection in workbook.connections])

print([connection.id for connection in workbook.connections])

connection = workbook.connections[0]

connection.server_address='new server address'

connection.username = 'username'

connection.password = 'pwd'

connection.embed_password=True

server.workbooks.update_connection(workbook, connection) except:

print("inside except block")

 

Or if there is any other better solution , pls let me know.

 

TIA !!

 

Regards,

Arun

1 Antwort
0/9000

Started Weekly program called #Sunday #with #Lightning #Web #Component 2 months back to share my Knowledge as #LightningChampion

 

Total Session so far - 9 

Watch recorded session here:- https://www.youtube.com/playlist?list=PLwqE28C2--ZQ6OP3Poq6ZOh36B63JC_wH

0/9000