-
Notifications
You must be signed in to change notification settings - Fork 425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
server_address doesn't get updated on workbook publish #337
Comments
The In any case, what error do you get? I've never been able to get the list of TSC.ConnectionItem() objects embedded to to work. The error I have gotten is ServerResponseError:
400000: Bad Request
Payload is either malformed XML/JSON or incomplete This is at the Committing file upload stage, after chunking the file already. I am using the Development branch so as to have this commit incorporated. |
I am trying to do the same thing and getting same result - CODE: |
The same problem but it appears to be, at least in my case, a Tableau Server issue. When I try to upload a workbook using the following code:
It only uploads the workbook if the conn.server_address is correct (or not defined) and if the datasource server, defined in the workbook, is correct also. If one of the IP addresses, mentioned before, is incorrect it will not upload the workbook giving the following message:
The xml generated by TSC library appears to be fine:
Tableau Server Version: 2018.3.2 (20183.18.1214.0808) 64-bit Windows |
This is still very much an issue. The documentation seems to be incorrect as OP pointed out, and for whatever reason the python client still gives off that 403007 error when attempting to publish a workbook that has any live connections/datasources attached to it. UPDATE ---- Looking into this more, I found that the REST API call to publish a workbook has all of the parameters you need for adding a new workbook with datasources that require credentials:
https://onlinehelp.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#publish_workbook But when you look inside of the request factory module, you find the following:
and you will receive the error stating "You cannot add both" should you try to, even though clearly both are needed should you want to do this via the tableauclientserver module. Once I write the code in python to do the API call (which will be using JSON, not the overly complicated XML) I will post here if I can confirm it working. ---- UPDATE It currently looks like by adding in the connection info into the request payload as shown in the documentation, the server returns that it is malformed. Im hoping to find out the proper way to add it in there, after which this issue might actually get resolved for some of us. ---- UPDATE I was able to successfully combine the connection and credentials fields but I had to use XML as there is no documentation on what form the JSON must be in to be accepted, and following the usual conversion from the doc caused a malformed error. At this point the only thing it could be is something server side, either with the workbook/embeded connections or the server itself. If I can confirm this to be the case, I will submit a PR with the fixed XML generators. |
I believe this is built in behavior to server that would require extensive changes in our infrastructure. I'll follow up with some other teams. |
Facing the same issue. As a workaround, I have included in a script some logic to create a temporary copy of the workbook that gets modified by using https://github.com/tableau/document-api-python, in order to align the datasource in the workbook with the one in the connection. source_wb = Workbook(file_path)
for ds in source_wb.datasources:
for conn in ds.connections:
conn.server = host
conn.port = port
conn.username = user where With these modifications, publishing works again in my scenario |
It's hard for me to follow what each person is doing here, and whether we're talking about published or embedded connections. In general, updating a connection is a different action to publishing a new connection. To update the workbook connection, this is the API that tsc is calling: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_workbooks_and_views.htm#update_workbook_connection The request format is
Publishing a workbook
|
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:
This seems to work if the workbook was exported with the server_address set to the same thing as my
rds_host
above. So ifrds_host
and the server address in the workbook are bothdev.example.com
, it will update the credentials and publish correctly.However, if
rds_host
isproduction.example.com
and the workbook hasdev.example.com
, Tableau returns afailed 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: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 theconnections=
attribute at all, onlyconnection_credentials
. There was a warning message logged saying it was deprecated that lead me to useconnections
.https://tableau.github.io/server-client-python/docs/api-ref#connections under
ConnectionCredentials class
mentionsserver_address
andserver_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#L38Please 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.
The text was updated successfully, but these errors were encountered: