question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

server_address doesn't get updated on workbook publish

See original GitHub issue

I’m working on a script that would push one workbook to multiple Tableau sites. Each site has a different database to connect to, so the embedded connection needs to be updated appropriately.

I’m trying to accomplish this by updating the embedded datasource connection information in the packaged workbook. Feel free to let me know if there’s a better way to do this as I’m new to Tableau in general.

Currently, I have this:

    conn_creds = TSC.ConnectionCredentials(name=rds_user,
                                           password=rds_pass)

    # Create a connection and add the above credentials to it
    connection = TSC.ConnectionItem()
    connection.server_address = rds_host
    connection.server_port = rds_port
    connection.connection_credentials = conn_creds

    # Publish the workbook to tableau
    publish_item = server.workbooks.publish(new_workbook,
                                            workbook_file,
                                            publish_mode,
                                            connections=[connection])

This seems to work if the workbook was exported with the server_address set to the same thing as my rds_host above. So if rds_host and the server address in the workbook are both dev.example.com, it will update the credentials and publish correctly.

However, if rds_host is production.example.com and the workbook has dev.example.com, Tableau returns a failed to establish a connection to your datasource error message even though the credentials are correct.

Before I tried the above solution, I was using the (now deprecated?) connection_credentials attribute like this:

    conn_creds = TSC.ConnectionCredentials(name=rds_user,
                                           password=rds_pass)

    # Publish the workbook to tableau
    publish_item = server.workbooks.publish(new_workbook,
                                            workbook_file,
                                            publish_mode,
                                            connection_credentials=conn_creds)

This had the same effect of updating the username/password correctly, but would not update the server_address.

https://tableau.github.io/server-client-python/docs/api-ref#workbooks under workbooks.publish actually does not mention the connections= attribute at all, only connection_credentials. There was a warning message logged saying it was deprecated that lead me to use connections.

https://tableau.github.io/server-client-python/docs/api-ref#connections under ConnectionCredentials class mentions server_address and server_port attributes, but they don’t seem to exist in https://github.com/tableau/server-client-python/blob/v0.7/tableauserverclient/models/connection_credentials.py and aren’t used in https://github.com/tableau/server-client-python/blob/v0.7/tableauserverclient/server/request_factory.py#L38

Please let me know if I need to clarify anything or if more information is needed. I haven’t looked at the code too much for this library yet, but when I get some time I planned on testing the same process with the rest api directly to verify that it isn’t an issue with the server api itself.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
jabycommented, Feb 25, 2020

Same issue here. Any updates on this ?

0reactions
pavankumartableaucommented, Nov 25, 2021

I am also facing the same issue, let me know if anyone found any solution to this. Datasource of my Workbook connected to Dev database, I am just changing hostname to Prod while publishing. This is the error I see.

image

Read more comments on GitHub >

github_iconTop Results From Across the Web

Workbook Data Doesn't Update After Successfully Refreshing ...
In Tableau Desktop, connect to the data source published on Tableau Server. · Navigate to Data > Replace Data Source... to replace the...
Read more >
Publishing data sources to Tableau Server & Tableau Cloud
Publishing data sources to Tableau Online or Tableau Server is integral to maintaining a single source for your data.
Read more >
Refresh a dataset created from an Excel workbook - Power BI
It then loads updated data into the dataset. Refreshing a dataset from within Power BI doesn't refresh the data in the workbook on...
Read more >
Why won't Tableau refresh my data? - The Information Lab
Refreshing in Tableau can get a bit confusing, mainly due to the ... the extract on the server to allow the workbook to...
Read more >
How to Publish a Tableau Dashboard to the Tableau Server
Email a packaged workbook and have people access and interact with it via Tableau Reader (a great place to start if you don't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found