<@U0A71G31CDV> what does error message: "Unfinishe...
# questions-and-troubleshooting
x
@Rocky what does error message: "Unfinished backends" for files mean
r
In StarRocks, "Unfinished backends" is not a standalone error message but a diagnostic field found in the
JobDetails
of a data load operation (such as Broker Load,
INSERT INTO ... SELECT FROM FILES()
, or Spark Load). What it means When you see this field in the output of a command like
SHOW LOAD
or as part of a failed
INSERT
statement's JSON result: * Definition: It lists the IDs of the Backend (BE) nodes that had not yet finished their assigned data processing tasks when the job stopped, failed, or was checked. * Context: Data loading in StarRocks is distributed across multiple BE nodes. Each node is responsible for a portion of the files or data. * If a job is FINISHED, this field is usually empty (
{}
). * If a job is CANCELLED or FAILED, this field helps you identify which specific BE nodes were still working or may have encountered an issue that caused the overall job to hang or fail. Where you typically see it You will encounter this label in the JSON blob under the
JobDetails
column when running:
Copy code
sql
SHOW LOAD WHERE LABEL = 'your_label';
Or in the summary result after running an
INSERT
job using the
FILES()
table function:
Copy code
json
{"Unfinished backends":{"10002":[]}, "ScannedRows":0, "TaskNumber":1, ...}
Why it might be appearing with an error If your load job failed and you are seeing specific BE IDs under "Unfinished backends," it usually indicates one of the following: 1. Node Failure/Network Issue: The BE node listed might have crashed, restarted, or lost connection to the Frontend (FE). 2. Timeout: The job reached its
timeout
limit before that specific BE could finish processing its allocated files. 3. Resource Exhaustion: The BE might have run out of memory or disk space, causing it to stop responding to the load coordinator. Recommended Actions If the load failed: * Check the
ErrorMsg
field:
The actual reason for the failure (e.g., "timeout," "too many filtered rows," or "RPC error") is usually located in the
ErrorMsg
column of the same
SHOW LOAD
output. * Check BE Health: Run
SHOW BACKENDS;
to see if the BE IDs listed in "Unfinished backends" are still
Alive
. * Inspect BE Logs: Look at the
<http://be.INFO|be.INFO>
or
be.WARNING
logs on the affected Backend nodes for more specific error details during the time of the load. Referencesadministration/management/monitoring/metrics.mdadministration/management/BE_configuration.mdfaq/Deploy_faq.mdsql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKENDS.mdfaq/Others.mdadministration/management/FE_configuration.md
x
@Rocky what causes: "type:LOAD_RUN_FAIL; msg:Unfinished string:"
r
The error message
type:LOAD_RUN_FAIL; msg:Unfinished string:
indicates that the StarRocks data parser encountered a string literal in your source data that started (usually with a quote) but did not end before the parser reached a line break or the end of the file/object. This is a data formatting error that occurs during the execution phase of a load job (Stream Load, Broker Load, or Routine Load). Common Causes 1. Malformed JSON Data If you are loading JSON, this error usually means a string value is missing its closing double quote (
"
). * Example of bad data:
{"name": "StarRocks}
(missing
"
after the name) * Fix: Validate your JSON source. Ensure all keys and string values are properly enclosed in double quotes. 2. CSV with Unclosed Enclosure Characters If you have specified an
enclose
character (like
"
or
'
) in your load properties, StarRocks expects any field starting with that character to end with it. * Example: You set
csv.enclose
to
"
, but a row contains:
"Value without closing quote,Next Column
. * Unescaped Quotes: If your data contains the enclosure character inside the string itself without being escaped, the parser will think the string ended early, and the subsequent data will cause a parsing failure. * Bad:
"This is a "quoted" word"
* Good (using escape):
"This is a \"quoted\" word"
(Ensure you set
csv.escape
in your load command). 3. Line Breaks inside Quoted Fields If your CSV data contains line breaks (newlines) within a quoted field, the parser might stop at the newline and report an "Unfinished string" if it doesn't support multi-line fields or if the
enclose
character isn't handled correctly. 4. File Encoding Issues In rare cases, if the file encoding is incorrect (e.g., mixed UTF-8 and another encoding), the parser might misread the bytes representing a closing quote, leading it to believe the string never finished. How to Troubleshoot 1. Check the Error URL: If you used Stream Load or Broker Load, the result usually includes an
ErrorLogUrls
. Open that link to see the specific row(s) that caused the failure. The "Unfinished string" message will often be followed by a snippet of the problematic line. 2. Validate Sample Data: Use a JSON validator or a CSV linter on a few rows of your source data. 3. Verify Load Parameters: * If using CSV: Check
column_separator
,
row_delimiter
,
enclose
, and
escape
. * If using JSON: Check
jsonpaths
and ensure the
format
is correctly set to
json
. Recommended Settings for CSV If you are using the
FILES()
table function or a load command for CSVs with quotes, ensure your parameters are explicit:
Copy code
sql
-- Example using FILES()
SELECT * FROM FILES(
    "path" = "s3://...",
    "format" = "csv",
    "csv.enclose" = '"',
    "csv.escape" = '\\'
);
Referencesfaq/loading/Loading_faq.mdloading/SparkLoad.mdfaq/loading/Routine_load_faq.mdfaq/loading/Broker_load_faq.mdsql-reference/sql-statements/loading_unloading/routine_load/SHOW_ROUTINE_LOAD.md