KNOWLEDGE BASE

Response "Failed with Error Code: 500" Publishing in Chunks with REST API


Published: 01 May 2017
Last Modified Date: 01 May 2017

Issue

When you use the REST API to publish a workbook or data source, a 500 error occurs during the append to file upload, publish datasource or public workbook call, and the publish process fails. 

Environment

  • Tableau Server 9.2 and newer versions 
  • REST API 

Resolution

Make sure that the payload for a Append to File UploadPublish Datasource, and Publish Workbook request is formatted correctly, as shown in the following example. (The boundary strings, name, and filename values will be different for each upload.) The request_payload part of the request payload has no content, just headers, and is formatted with two blank lines.

--6691a87289ac461bab2c945741f136e6
Content-Disposition: name="request_payload"
Content-Type: text/xml

--6691a87289ac461bab2c945741f136e6
Content-Disposition: name="tableau_workbook"; filename="usps-rates.twbx"
Content-Type: application/octet-stream

content here
--6691a87289ac461bab2c945741f136e6--

Cause

This issue can occur if the payload in the request does not conform to the RFC 1341 specification for multi-part payloads. A typical problem is that the first part of the multi-part request is blank except for header information. Per the specification, a blank section of the payload requires at least two blank lines. In the Append to File UploadPublish Datasource, and Publish Workbook requests, the blank section of the payload is the request_payload section.

Additional Information

The issue can occur even with workbooks or data sources that were published successfully using Tableau Server 9.0 or 9.1. For this particular error, earlier versions of the REST API accepted a payload that did not exactly conform to the RFC 1341 specification. When the same request is made to Tableau Server 9.2, the request now fails.
Did this article resolve the issue?