Skip to content

TSC Flow Download fails intermittently #1251

@rozbear

Description

@rozbear

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>
'

Screenshot 2023-07-07 at 17 24 10

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions