server-client-python icon indicating copy to clipboard operation
server-client-python copied to clipboard

Update datasource script corrupted hyper file with SQLSTATE:08001 error

Open pakosel opened this issue 2 years ago • 1 comments

Bug description I've used https://github.com/tableau/server-client-python/blob/master/samples/update_datasource_data.py script to delete some rows from a hyper file. I was testing condition arguments and deleting 1k-10k rows worked fine. Then I tried to delete random 20k rows from this hyper and it failed, connection was closed by the server with the following message:

INFO:tableau.endpoint.jobs:Job eb23d972-5a9a-41ef-be67-2a38c1136e0a Completed: Finish Code: 1 - Notes:['com.tableausoftware.nativeapi.exceptions.ConnectivityException: [SQLSTATE:08006] The Hyper server closed the connection unexpectedly: pqsecure_raw_read\r\nThe server process may have been shut down or terminated before or while processing the request.\nUnable to connect to the Tableau Data Extract server "". Check that the server is running and that you have access privileges to the requested database.']
INFO:tableau.endpoint.auth:Signed out
Traceback (most recent call last):
  File "E:\dev\server-client-python\samples\update_datasource_data.py", line 107, in <module>
    main()
  File "E:\dev\server-client-python\samples\update_datasource_data.py", line 82, in main
    job = server.jobs.wait_for_job(job)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\***\Python\Python311\site-packages\tableauserverclient\server\endpoint\jobs_endpoint.py", line 72, in wait_for_job
    raise JobFailedException(job)
tableauserverclient.server.endpoint.exceptions.JobFailedException: Job eb23d972-5a9a-41ef-be67-2a38c1136e0a failed with notes ['com.tableausoftware.nativeapi.exceptions.ConnectivityException: [SQLSTATE:08006] The Hyper server closed the connection unexpectedly: pqsecure_raw_read\r\nThe server process may have been shut down or terminated before or while processing the request.\nUnable to connect to the Tableau Data Extract server "". Check that the server is running and that you have access privileges to the requested database.']

After this, the hyper file becomes unusable - cannot trigger incremental or full refresh - each job finishes with the following message:

An internal error occurred. Contact your administrator. com.tableausoftware.server.status.reporting.TableauRuntimeException: System error: TableauException: [SQLSTATE:08001] Could not connect to the Hyper server: Connection refused (0x0000274D/10061) Is the server running on host "localhost" (::1) and accepting TCP/IP connections on port 8711? An internal error occurred. Contact your administrator. 

Versions

  • Tableau Server version: 2022.3.8 (20223.23.0710.1931) 64-bit Windows
  • Python version: 3.11.4
  • TSC library version: 3.17,

To Reproduce Try to delete random 20k rows from the hyper file by including 20k "OR" conditions in the args action and passing it to server.datasources.update_hyper_data method of TSC

Results Hyper file becomes corrupted

pakosel avatar Oct 13 '23 14:10 pakosel

@vogelsgesang have you seen errors like this before?

jacalata avatar Jan 13 '24 14:01 jacalata