Slackbot
08/27/2026, 11:49 AMRocky
08/27/2026, 11:50 AMTAPE_ERROR: The JSON document has an improper structure indicates that StarRocks' JSON parser (simdjson) encountered a payload that is physically malformed (e.g., missing braces, trailing commas, or invalid characters). Since you are sinking from RisingWave, this typically happens when a batch of data or a specific complex field (like a STRUCT or ARRAY) is not being serialized into valid JSON.
To identify the exact data causing this, follow these steps:
1. Get the Error Log URL from StarRocks
StarRocks tracks load failures and often provides a URL containing the specific rows that failed.
1. Pick a query_id from your logs (e.g., fc49b0de-610e-9124-ac40-62ea1287f192).
2. Run the following query in StarRocks:
sql
SELECT * FROM information_schema.loads
WHERE query_id = 'fc49b0de-610e-9124-ac40-62ea1287f192' \G
3. Look for the ErrorLogUrls field. It will contain a link.
4. Open that link in your browser or use curl. It will show you the raw line that failed to parse and usually points out why (e.g., "invalid json").
2. Check the Backend (BE) Logs
The logs you shared show the Coordinator reporting the failure, but the actual parsing happens on the Backend.
1. Go to the BE node mentioned in the log (e.g., backend_id=10001).
2. Check <http://be.INFO|be.INFO> or be.WARNING. Search for the query_id.
3. The BE often logs a snippet of the problematic JSON payload or provides a local file path to the error log if the URL mentioned above isn't accessible.
3. Debug RisingWave Sink Mapping
If the error happens consistently, it is likely a data type mismatch or a serialization issue in the RisingWave sink:
* Struct/Array Columns: RisingWave maps STRUCT and ARRAY to StarRocks JSON columns. Check if any values in these columns contain special characters or are extremely large (the default limit is often 100MB for a single JSON body).
* Format Configuration: If RisingWave is sending a JSON array but the StarRocks sink is not configured to "strip" it, you might see "Failed to iterate document stream as object." Ensure the sink parameters match the expected format.
* Partial Updates: If you enabled starrocks.partial_update, ensure the StarRocks table is a Primary Key table and that the JSON structure matches the columns being updated.
4. Check for Hidden Characters or Encoding Issues
The "TAPE_ERROR" can also be triggered by:
* Non-UTF8 characters: If your data contains raw binary or incorrectly encoded strings, the parser will fail.
* Empty strings vs Nulls: Ensure that empty strings aren't being sent where a valid JSON object/array is expected.
Recommendation:
Start by querying information_schema.loads to get the ErrorLogUrls. This is the most direct way to see the "broken" JSON string that RisingWave sent. If that table doesn't show the load (sometimes transient Stream Loads don't persist there long), check the RisingWave logs for risingwave_connector errors, as it will often log the response body from StarRocks which contains the error details.
References
• faq/Dump_query.md
• loading/loading_introduction/troubleshooting_loading.md
• faq/Sql_faq.md