server-client-python
server-client-python copied to clipboard
TSC Flow Download fails intermittently
Describe the bug When I use the download function for a Flow in tableauserverclient under flows_endpoint.py, it fails intermittently. I am just running it with the same flow id and path every time, it will run successfully a few times, then fail, then run . I do NOT have this issue with the workbook download function.
Versions Details of your environment, including:
- Tableau Server version: 2021.3 (API 3.13)
- Python version: 3.11.1
- TSC library version: "^0.25"
To Reproduce Below is the simple version of the code I am running - anything between <> would be replaced with actual values If I just keep running this for 1 flow id over and over, it will succeed sometimes and fail sometimes.
import tableauserverclient as TSC
tableau_auth = TSC.PersonalAccessTokenAuth('<token_name>', '<token_secret>', site_id='<site_name>')
server = TSC.Server('https://<servername>.com/', use_server_version=True)
with server.auth.sign_in(tableau_auth):
server.flows.download("<flow_id>","<download_folder>/<flow_name>.tfl")
Results when it fails I get the error in the attached screenshot. See the part where it says "nonXMLResponseError: 'b" from my debugging, I see the response I get is wrapped in single quotes with a b prefix - which in python denotes a byte string. e.g.
b'
<?xml version=\'1.0\' encoding=\'UTF-8\'?>
<tsResponse xmlns="http://tableau.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableau.com/api http://tableau.com/api/ts-api-3.13.xsd">
...<rest of xml here>...
<tags/>
</flow>
</tsResponse>
'
I've been seeing the same error lately. I was wondering whether it might have anything to do with the architecture of Tableau Server, and how processes "serving" a Flow for download might work on one node or not the other.
I never thought that the problem might be with TSC, but... who knows? For what it's worth, I'm getting the exact same response ("The page you were looking could not be found") and overall behavior seems to match as well...