tableau / server-client-python

A Python library for the Tableau Server REST API
https://tableau.github.io/server-client-python/
MIT License
648 stars 416 forks source link

bulk pdf export results in 'Connection aborted.'-Error (VizPortal Server shutting down) #1420

Open BerndRos opened 1 week ago

BerndRos commented 1 week ago

Describe the bug We run a script that exports a total of ~16.000 Views/PDF-pages from Tableau Server. The export is parallelized with 6 exports at a time (see below). When everything works fine, the script takes about 8 hours to complete. However, more often than not the script runs into the error: 'Connection aborted.', RemoteDisconnected('Remote end closed connection without response',) What we see server-side is that one of the VizPortal-servers ist shutting down. The Tableau Support has suggested that this may be a problem with the TSC-package.

Has anyone experienced the same problem with a bulk pdf-export?

Versions

Results 'Connection aborted.', RemoteDisconnected('Remote end closed connection without response',)

jorwoods commented 1 week ago

How are you authenticating to the server? How are you parallelizing the exports?

BerndRos commented 1 week ago

Hey @jorwoods, thanks for your reply.

We authenticate with this function:

def login() -> TSC.Server:
    """Login to the Tableau-Server

    Returns:
        TSC.Server: Returns the Tableau-Server-Object
    """    
    tableau_auth = TSC.TableauAuth(USERNAME, PASSWORD)
    tableau_server = TSC.Server(TABLEAU_SERVER_URL, use_server_version=True)
    tableau_server.auth.sign_out()
    tableau_server.auth.sign_in(tableau_auth)
    return tableau_server

And we use starmap_async from the multiprocess package to parallelize. First thing we do in the parallelized processes is login, then it is basically a huge for-loop, where we export pdf with views.populate_pdf().

jorwoods commented 1 week ago

Is it a VizQL process that goes down, or is it the entire server? Have you looked at TabMon to measure load on the server? Or perhaps LogShark to see if you're running into resource utilization issues?

It sounds like you're hitting the servers pretty hard over long durations. Are you ensuring to do it at off-peak times?

BerndRos commented 1 week ago

It is a VizPortal process that goes down, not the entire server. As we do not have many users and the Tableau-Server runs locally in our company there is not much traffic otherwise. We don't use TabMon or LogShark. For monitoring we use the Windows Performance Monitor. During the export the server utilization is constant at around 40% for 6 processes. Increasing the number of processes results as expected in higher server utilization. For 24 parallel processes the server utilization is close to 100%. Higher utilization results in quicker crashes.

We've found one improvement by increasing the number of VizPortal processes to three und reconnnecting to the Tableau Server after an error occured during the export.

jacalata commented 1 week ago

TSC is simply API traffic. It is an officially supported tool and reps are expected to look into a problem with using it the same they would our other tools. If support has some kind of evidence that there's a problem with TSC here, then they should write up a bug and send it to the dev team internally. Did they give you any explanation for this suggestion of theirs?

BerndRos commented 2 days ago

Hey @jacalata, thanks for your reply. Unfortunately they did not give me any explanation. To be honest, I don't think the problem has anything to do with TSC either. But after Tableau Support had suggested a post here, I wanted to give it a try to see if anyone has faced a similar issue.