2 Replies Latest reply on Oct 22, 2015 2:53 PM by Sten Lomme

    Cannot publish modified data sources with extracts using REST API

    Toni Juvani

      We are developing a SaaS application running on Tableau Server and HP Vertica database. In order to separate access for different tenants, we have set up multiple sites in Tableau and multiple schemas in Vertica. Development always happens in a site called “Master” and after a new feature is implemented, we replicate all contents (Tableau data sources and workbooks) from master site to different customer sites. The automated replication procedure currently goes as follows:

       

      1. Download datasources and workbooks using REST API

      2. Modify datasources and workbooks:

           a) Set Vertica connection credentials in the REST publish request

           b) Set Vertica schema names for relations in the datasources' XML

      3. Publish datasources and workbook XML using REST API

       

      This works ok for regular datasources. However, if the data source contains an extract (.tde file within the .tdsx) the publish fails with the following error:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <tsResponse xmlns="http://tableausoftware.com/api" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://tableausoftware.com/api http://tableausoftware.com/api/ts-api-2.0.xsd">

      <error code="400011">

      <summary>Bad Request</summary>

      <detail>There was a problem publishing the file '16343:A504AC72813D4D4AA76E972FF2474402-0:0'.</detail>

      </error>

      </tsResponse>

       

      When importing the same datasource file with Tableau desktop it is possible to choose an option for regenerating the datasource extract during the import. Does anyone know how can this could be done when publishing automatically with the REST API?

       

      I have observed the following:

       

      1. Download a datasource containing an extract from master site

      2. Publish the same datasource as is to master site

      => Success

       

      1. Download a datasource containing an extract from master site

      2. Publish the same datasource by modifying the database credentials to point to customer 1 schema

      => After publish we get an error saying that the user does not have permissions to the schema specified in the datasource (this is correct as we did not modify the relations within the datasource to point to the customer 1 schema)

       

      1. Download a datasource containing an extract from master site

      2. Publish the same datasource by modifying the database credentials and by modifying the relations in the datasource definition to point to customer 1 schema

      => Publish fails with the message above

       

      I am suspecting that the failure in publish might have to do with the .tde file contents and the inability to regenerate it during publish. We have also tried to read the downloaded .tde file using the Tableau data extract python API, but it is currently failing with the following error message: “TableauException (303): table name must be "Extract"”. Should it be possible to somehow modify the extract prior to publishing?


      Any ideas?


      Br,

      Toni