server-client-python
server-client-python copied to clipboard
400011: Bad Request when publishing .hyper datasource
After reviewing issue #488 , I found that I am experiencing the issue on single table extracts as opposed to multi.
any help and suggestions would be appreciated. I have tried several variations in specifying file paths and publish modes but all fail with a bad request.
Thanks!
Here is my code
import tableauserverclient as TSC
import os
cwd = os.getcwd()
file = 'Groups.hyper'
tableau_auth = TSC.TableauAuth(username,password)
server = TSC.Server('http://'+server_name)
server.use_server_version()
server.add_http_options({'verify': False})
with server.auth.sign_in(tableau_auth):
new_datasource = TSC.DatasourceItem(project_id, 'Groups Extract python')
new_datasource = server.datasources.publish(new_datasource,
os.path.join(cwd,file),
'CreateNew')
Running with error
Traceback (most recent call last):
File "tester.py", line 20, in <module>
'CreateNew')
File "C:\Users\amsmith1\Desktop\tableauUserMgmt\venv\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 127, in wrapper
return func(self, *args, **kwargs)
File "C:\Users\amsmith1\Desktop\tableauUserMgmt\venv\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 165, in wrapper
return func(self, *args, **kwargs)
File "C:\Users\amsmith1\Desktop\tableauUserMgmt\venv\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 165, in wrapper
return func(self, *args, **kwargs)
File "C:\Users\amsmith1\Desktop\tableauUserMgmt\venv\lib\site-packages\tableauserverclient\server\endpoint\datasources_endpoint.py", line 204, in publish
server_response = self.post_request(url, xml_request, content_type)
File "C:\Users\amsmith1\Desktop\tableauUserMgmt\venv\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 102, in post_request
content_type=content_type)
File "C:\Users\amsmith1\Desktop\tableauUserMgmt\venv\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 55, in _make_request
self._check_status(server_response)
File "C:\Users\amsmith1\Desktop\tableauUserMgmt\venv\lib\site-packages\tableauserverclient\server\endpoint\endpoint.py", line 70, in _check_status
raise ServerResponseError.from_response(server_response.content, self.parent_srv.namespace)
tableauserverclient.server.endpoint.exceptions.ServerResponseError:
400011: Bad Request
There was a problem publishing the file 'Groups.hyper'.
tableauserverclient==0.9 python==3.7.4 tableau server==2019.4.4
I'm not exactly quite sure about this as well and I have the exact same issue. I think I read somewhere to handle this exception by changing the server.version to a number that is compatible with your server?
Any help from the community would be appreciated it
I am also trying to pass use_server_version = True into TSC.Server() with no success.
Is this what you were referencing or a hard-coded sever version? @williamxnguyen
EDIT: Found solution for my situation. I was using option 2 in this link https://help.tableau.com/current/api/hyper_api/en-us/docs/hyper_api_publish.html#publish-single-table-hyper-files
The key was to create a table object called "Extract" in schema "Extract" for hyper file publish to work. Not sure if same as others but when I did that with python code ala below it worked
my_table = TableName("Extract", "Extract")
Then pass my_table into the frame_to_hyper call...
original message: I am also having same issue
tableauserverclient==0.11 python==3.6.5 tableau server==2019.2.3 (20192.19.0818.2120)
I have tried using different REST api versions to no avail. Also, I can publish a workbook successfully using all the same set up code, only my attempt to publish a datasource (hyper file) fails with 400011
In my situation, I would get an error such as: 400011: Bad Request There was a problem publishing the file '26353:e93e1c2aa6fd41169169a8de2a438ca4-1:0'. when publishing very large extracts.
This was fixed by utilizing the as_job=True option on server.datasources.publish()
May i please know if there is any workaround ? I am facing the same issue .
Feel free to reopen the issue if you think that the issue is not solved
I would double check to make sure the hyper file is good, I was converting from a CSV to a hyper using this example and was also getting the 400011 error until I added the as_job=True value. I imagine it is because hyper files are bulky (it turned my 50 Byte csv file into a 66 KB hyper file), and according to the Tableau REST API docs, this setting changes the publishing from synchronous to asynchronous.
Perhaps if that is the case, and if Tableau want to really push hyper as a go to data source format, then this flag should be default as True?
And perhaps I spoke too soon. I wasn't receiving any response errors from Tableau, but the data source still is not being published for me.
I was getting this same error when publishing datasources from .tdsx files. I found that this only happened with datasources that existed with extracts, so when downloading I included the extracts and it seems to work fine
I get the same error when I try to publish data sources without their extract. But I can't afford to download/unzip/zip/upload data sources with 25GB extracts. Any workaround?
If someone happens to be making any edits to an extract, I highly recommend defragmenting your extract prior to publishing - see Rewrite your Hyper file in an optimized format. As I recall, I had issues in the past with Tableau Server running out of memory on very large extracts after being edited and it would throw this error. After defragmenting in my unique case, it would publish correctly.
Same problem here... I can't use the include_extract=True.. it's a lot of data . I created the .tdsx file (tds + hyper) and didn't work
I am not able to publish 351MB of hyper file even after using as_job=True in publish method getting same error . Can any one help me here
I have the same error. Did anyone find something ?
We face the same issue even with hyper files as small as in few hundred KBs. Is there a solution yet?
Updating tableauserverclient worked for me.
Updating tableauserverclient worked for me.
May I know the version that fixed the issue?
I'm also facing the same issue. Was there any resolution for this?
This is a pretty old issue with a lot of different reports. If anyone is still having a specific problem with publishing, please open a new issue with the details.