<@U0A71G31CDV> how to check why BE nodes are not a...
# questions-and-troubleshooting
z
@Rocky how to check why BE nodes are not alive and are disconnected?
r
When BE nodes are marked as not alive (Alive:
false
) or disconnected (StatusCode:
DISCONNECTED
), it typically means the Frontend (FE) cannot complete a heartbeat handshake with the Backend (BE). Follow these steps to diagnose the issue: 1. Check Status via SQL Run the following command in your MySQL client to get the high-level error message:
Copy code
sql
SHOW BACKENDS\G
* Alive: If
false
, the FE has lost contact. * ErrMsg: Look at this column specifically; it often contains the exact reason for the heartbeat failure (e.g., "Connection refused" or "Timeout"). * StatusCode: If it shows
DISCONNECTED
, the FE has proactively stopped sending tasks to this node. 2. Verify BE Process Status On the server where the BE is supposed to be running, check if the process is actually alive:
Copy code
bash
ps -ef | grep starrocks_be
* If the process is NOT running: Check
storage/log/be.out
. This file captures standard output/error and will show if the BE crashed due to OOM (Out of Memory), disk issues, or illegal instructions. * If the process IS running: Proceed to network and configuration checks. 3. Inspect Log Files Logs provide the most detailed information about connectivity issues: * BE Logs (
be/log/be.INFO
)
: Search for "heartbeat". A healthy BE should show logs like:
Waiting to receive first heartbeat from frontend
. * FE Logs (
fe/log/fe.warn
or
fe.log
)
: Search for the IP of the problematic BE. Look for errors related to
Master heartbeat service
. If you see
THRIFT_RPC_ERROR
, it's a network/port issue. 4. Common Causes to Troubleshoot * Firewall/Ports: Ensure the
heartbeat_service_port
(default
9050
) is open and reachable from the FE nodes. You can test this from the FE machine using:
Copy code
bash
    telnet <BE_IP> 9050
*
priority_networks
Mismatch
: If the BE has multiple network interfaces, it might be binding to the wrong IP. Ensure
priority_networks
in
be.conf
matches the IP used when you ran
ALTER SYSTEM ADD BACKEND "IP:PORT"
. * FE-BE Clock Skew: Ensure all nodes in the cluster have synchronized clocks (e.g., using NTP). Large time drifts can cause heartbeat timeouts. * File Descriptor Limits: If the BE hits the
ulimit
for open files, it may stop accepting new connections. Check
<http://be.INFO|be.INFO>
for "Too many open files". * BE Blacklist: If a BE experiences frequent query timeouts or connection failures, the FE may temporarily add it to a blacklist. Check the FE status to see if the node is being avoided. 5. Restarting If the BE is stuck or in an inconsistent state: 1. Stop the BE:
bin/stop_be.sh
(or
kill -9
if it's unresponsive). 2. Clean up any remaining lock files in the data directory if necessary. 3. Start the BE:
bin/start_be.sh --daemon
. References • sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKENDS.md • faq/operation_maintenance_faq.md • sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_PROC.md
z
@Rocky error mesage says java.net.ConnectException: Connection refused
r
The error
java.net.ConnectException: Connection refused
is a clear signal that the Frontend (FE) is attempting to reach the Backend (BE), but the network request is being rejected at the destination. This happens for one of three main reasons: the BE process is down, the BE is listening on the wrong IP/Port, or a firewall/network rule is blocking the traffic. Follow these steps to resolve it: 1. Check if the BE process is running If the process has crashed, there is nothing to accept the connection. * On the BE node, run:
ps -ef | grep starrocks_be
* If it's not running: Check
be/log/be.out
. This file contains crash logs (e.g., OOM, "Address already in use", or "Illegal instruction"). * If it is running: Move to the next step. 2. Verify Port Connectivity (The Heartbeat Port) By default, the FE connects to the BE on the Heartbeat Port (9050). * From the FE machine, try to telnet or nc the BE's IP:
Copy code
bash
    telnet <BE_IP> 9050
* If this says "Connection refused", the issue is definitely that the port is not open or reachable. 3. Check for IP Binding Issues (
priority_networks
)
If the BE has multiple network interfaces (e.g., a public and a private IP), it might be listening on the wrong one. * Check
be/conf/be.conf
for the
priority_networks
setting. * Check
be/log/be.INFO
. Look for a line like:
Check heartbeat port: 9050
. It will show which IP the BE is actually using. * Fix: Ensure the IP listed in
SHOW BACKENDS
matches the IP the BE is actually bound to. If they differ, you must drop and re-add the BE with the correct IP, or fix
priority_networks
in
be.conf
. 4. Check for Port Conflicts If another process is already using port 9050, the BE will fail to start or fail to bind to that port. * On the BE node, check which ports are in use:
Copy code
bash
    netstat -tulnp | grep 9050
* Ensure it is the
starrocks_be
process using that port. 5. Firewall / Security Groups If you are in a cloud environment (AWS, Azure, GCP) or a secured data center: * Ensure that the Security Group or iptables allows TCP traffic from the FE IPs to the BE IPs on ports 9050, 9060, 8040, and 8060. Summary of relevant ports in `be.conf`: * `heartbeat_service_port`: 9050 (Used by FE to check BE health) * `be_port`: 9060 (Used by FE to send tasks) * `brpc_port`: 8060 (Used for data transmission between BEs) * `be_http_port`: 8040 (Used for downloading images/logs) References • administration/management/BE_configuration.md • faq/Deploy_faq.md • deployment/deploy_manually.md
The stack trace indicates a segmentation fault (SIGSEGV) at address
0x0
(null pointer dereference) within the StarRocks Backend (BE) process. Specifically, the crash occurs in the
UnpackConstColumnBinaryFunction
while evaluating a string comparison (equality check on `Slice`/`VARCHAR`) inside the
ProjectOperator
. This is a known issue in several StarRocks versions related to how the engine handles Constant Columns during specific optimizations. Potential Causes 1. Low Cardinality Optimization Bug: This function is frequently used when StarRocks optimizes string comparisons using dictionary encoding. If the query compares a constant string against a column and the "unpacking" logic fails to handle a null or specific column type correctly, it triggers a crash. 2. Runtime Filter Evaluation: The stack trace shows the crash during a projection (
ProjectOperator
), but this can be triggered if a filter or a specific expression involves a constant value that the vectorized engine fails to process correctly. Immediate Workarounds You can attempt to bypass the crash by disabling the optimization rules that trigger this specific code path. Run these commands in your session before executing the problematic query: 1. Disable Low Cardinality Optimization:
Copy code
sql
    SET enable_low_cardinality_optimize = false;
2. Disable Runtime Filter Pushdown (if the above doesn't work):
Copy code
sql
    SET enable_runtime_filter_pushdown = false;
Recommended Resolution This type of crash is typically addressed in minor bug-fix releases. • Identify your version: Run
SELECT current_version();
. • Check for Patches: This issue was notably fixed in versions such as 2.5.17+, 3.0.9+, 3.1.7+, and 3.2.12+. If you are on an older minor version within those branches, upgrading to the latest maintenance release is highly recommended. • Check for JSON/VARCHAR mismatches: If your query involves
get_json_string
on a
VARCHAR
field or complex nested types, ensuring types are explicitly cast (e.g.,
CAST(col AS STRING)
) can sometimes prevent the optimization from misfiring. If the crash persists after disabling these settings, please provide the full output of
EXPLAIN <your_query>
to help identify the specific plan node causing the failure. References • release_notes/release-2.5.md • sql-reference/sql-functions/bitmap-functions/unnest_bitmap.md • faq/Sql_faq.md • sql-reference/sql-functions/Python_UDF.md • sql-reference/sql-functions/bitmap-functions/bitmap_from_binary.md • release_notes/release-2.4.md
z
@Rocky this can shut down backends?
r
Yes, this specific error will shut down your Backend (BE) nodes. The stack trace you provided shows a SIGSEGV (Segmentation Fault). This is a fatal error in the C++ backend process. When this happens, the operating system immediately terminates the
starrocks_be
process to prevent memory corruption. Here is why your backends are showing as "not alive" or "disconnected": 1. The Crash-to-Disconnected Lifecycle 1. Trigger: A query is executed that hits a specific code path (in your case, comparing a constant string against a column in a way the engine doesn't expect). 2. SIGSEGV: The BE process attempts to access memory it doesn't own (a null pointer dereference in
UnpackConstColumnBinaryFunction
). 3. Process Death: The BE process terminates instantly. 4. FE Detection: The Frontend (FE) sends a "heartbeat" to the BE every few seconds. Since the process is no longer running, the connection is refused. 5. Status Update: The FE marks the BE as
Alive: false
. If it stays down, the status eventually changes to
DISCONNECTED
. 2. Is it a "Cluster Shutdown"? It typically only shuts down the specific BE node that was processing that fragment of the query. However, if your query is distributed (as most are), it might cause multiple BEs to crash simultaneously if they all attempt to execute the same problematic execution plan. 3. How to fix it immediately Since the crash is caused by a bug in the "Low Cardinality" or "Constant Unpacking" optimization, you can stop the crashes by disabling these features in your session before running the query:
Copy code
sql
-- Disable the optimization causing the null pointer dereference
SET enable_low_cardinality_optimize = false;

-- If it still crashes, try disabling constant folding optimizations
SET enable_constant_folding_push_down = false;
4. Long-term fix This is a known bug in older minor versions of StarRocks. You should check your version (
SELECT current_version();
) and look to upgrade to a stable patch release (e.g., if you are on 3.1.x, move to 3.1.10+; if on 3.2.x, move to 3.2.5+). To get your nodes back online now: You must manually restart the BE process on each affected server:
Copy code
bash
# On the BE server
bin/start_be.sh --daemon
``` Check
storage/log/be.out
after restarting to ensure it doesn't crash again immediately during recovery. ## References - [release_notes/release-3.4.md](https://docs.starrocks.io/releasenotes/release-3.4) - [release_notes/release-2.5.md](https://docs.starrocks.io/releasenotes/release-2.5) - [release_notes/release-2.3.md](https://docs.starrocks.io/releasenotes/release-2.3) - [release_notes/release-2.4.md](https://docs.starrocks.io/releasenotes/release-2.4)
z
@Rocky we use 4.0.10-5b36164
r
Thank you for providing the version and stack trace. You are using StarRocks 4.0.10, which is a very recent release (May 2026). The stack trace confirms a segmentation fault (SIGSEGV) in
UnpackConstColumnBinaryFunction
. This function is part of the vectorized execution engine's optimization for binary predicates (like
column = 'constant'
). It "unpacks" a constant value to perform a batch comparison against a column. A crash here usually indicates a null pointer dereference when the engine tries to access memory for a constant column that it expects to be present but is not. While this was a known issue in older 3.x branches, seeing it in 4.0.10 suggests a specific edge case—possibly related to the new JSON engine or Low Cardinality optimizations introduced in 4.0. 1. Immediate Workarounds You can stop the backends from crashing by disabling the specific optimization rules that trigger this code path. Execute these in your session before running the query:
Copy code
sql
-- Disable the most likely optimization causing the crash
SET enable_low_cardinality_optimize = false;

-- If it still crashes, try disabling constant folding pushdown
SET enable_constant_folding_push_down = false;

-- As a last resort, disable runtime filter pushdown
SET enable_runtime_filter_pushdown = false;
2. Check for Patch Releases Since you are on 4.0.10, there are newer maintenance releases available that address stability issues in the 4.0 branch: * 4.0.12 was released in late June 2026 and contains several fixes for SIGSEGV issues in the execution engine. * If you are ready for a minor version upgrade, 4.1.1 is the current stable release and includes broader architectural fixes for these types of crashes. 3. Debugging the Query If you can share the query (or a simplified version), check for the following: * JSON Comparisons: Are you comparing a
JSON
type directly to a string constant? 4.0 changed JSON to a first-class columnar type; try casting explicitly:
CAST(json_col->'key' AS STRING) = 'value'
. * Nullable Columns: Does the comparison involve a column that is almost entirely NULL? * Complex Expressions: Are there nested functions inside the
WHERE
clause or a
SELECT
projection? Summary of Action 1. Restart the crashed BEs using
bin/start_be.sh --daemon
. 2. Apply the
SET
variables
above to see if the query runs successfully without crashing the backend. 3. Upgrade to 4.0.12+ if the issue persists, as this is likely a bug that has been addressed in the latest patch. If you can provide the output of
EXPLAIN <query>
, I can help identify which specific plan node (ID 10 in your trace) is triggering the failure.
z
@Rocky I have that cbo_enable_low_cardinality_optimize not enable_low_cardinality_optimize in my version is this same?
r
Yes, in your version (4.0.10), they refer to the same underlying feature. In older versions of StarRocks, the variable was simply
enable_low_cardinality_optimize
. In more recent versions and the 4.0 branch, it has been renamed or aliased to
cbo_enable_low_cardinality_optimize
to reflect its role within the Cost-Based Optimizer. To stop the Backend (BE) crashes immediately: Since your stack trace points directly to a failure in the "unpacking" logic used by this optimization, you should disable it using the variable name available in your version:
Copy code
sql
-- Disable the primary optimization causing the crash
SET GLOBAL cbo_enable_low_cardinality_optimize = false;

-- In version 4.0+, it is also recommended to disable the V2 strategy if the above doesn't suffice
SET GLOBAL low_cardinality_optimize_v2 = false;
Why this works: The crash happens because the engine is trying to use a "global dictionary" to speed up string comparisons (low cardinality optimization). By setting these to
false
, you force the engine to use standard string comparison logic. This is slightly slower but avoids the code path containing the null-pointer bug. Next Steps: 1. Restart your BEs: Use
bin/start_be.sh --daemon
to bring the crashed nodes back online. 2. Check for 4.0.x Patches: Since you are on 4.0.10, check if 4.0.12 or 4.1.x is available in your environment's repository. These versions contain specific fixes for
UnpackConstColumnBinaryFunction
crashes that occur during runtime filter evaluation. If the query still crashes after setting these, it may be triggered by a Runtime Filter. You can disable that specifically for the problematic query:
Copy code
sql
SET enable_runtime_filter_pushdown = false;
false; ``` ## References - [sql-reference/System_variable.md](https://docs.starrocks.io/docs/sql-reference/System_variable) - [release_notes/release-4.0.md](https://docs.starrocks.io/releasenotes/release-4.0) - [faq/Sql_faq.md](https://docs.starrocks.io/docs/faq/Sql_faq) - [using_starrocks/accelerate-cardinality-preserving-joins.md](https://docs.starrocks.io/docs/using_starrocks/accelerate-cardinality-preserving-joins) ## References - [release_notes/release-4.0.md](https://docs.starrocks.io/releasenotes/release-4.0)
z
@Rocky I dont have this variable enable_runtime_filter_pushdown in my version
r
You are correct; my apologies. In StarRocks 4.0.x, the variable names for controlling runtime filters are different. The variable
enable_runtime_filter_pushdown
does not exist under that exact name. To disable the runtime filtering that is likely triggering the crash in
UnpackConstColumnBinaryFunction
, please use these variables instead: 1. Disable Global and TopN Runtime Filters These are the most common triggers for crashes during the "pushdown" phase in recent versions:
Copy code
sql
-- Disable Global Runtime Filters (applies to Shuffle Joins)
SET enable_global_runtime_filter = false;

-- Disable TopN Runtime Filters (applies to ORDER BY ... LIMIT queries)
SET enable_topn_runtime_filter = false;
2. Force-Disable Runtime Filter Generation If the crash persists, you can effectively disable the generation of local runtime filters by setting the row limit to zero:
Copy code
sql
-- Prevents the creation of any Join Runtime Filters
SET runtime_join_filter_push_down_limit = 0;
3. Disable Constant Folding (The "Unpack" trigger) Since your stack trace specifically mentions
UnpackConstColumnBinaryFunction
, the engine is failing while trying to optimize a constant value. Disabling constant folding can bypass this specific code path:
Copy code
sql
SET enable_constant_folding_push_down = false;
Why you don't see the other variable In StarRocks 4.0, the optimization logic was consolidated. The "pushdown" behavior is now implicitly controlled by the variables above (
enable_global_runtime_filter
and the
push_down_limit
). Recommendation: After setting these, run your query again. If it succeeds, it confirms the crash is a bug in the 4.0.10 runtime filter optimizer. I highly recommend checking for the 4.0.12 or 4.1.1 release, as there are documented fixes for similar
SIGSEGV
errors in the vectorized execution engine's binary function handling. References • sql-reference/System_variable.md • release_notes/release-4.0.md • administration/Management_variables.md • using_starrocks/Runtime_filter.md References • sql-reference/System_variable.md
z
@Rocky does not have enable_constant_folding_push_down in my version as well
r
I apologize for the confusion regarding those specific variable names. In StarRocks 4.0.x, some optimization toggles have been renamed or are internal to the engine. Since your stack trace points to a crash in
UnpackConstColumnBinaryFunction
involving
DictMappingExpr
and
RuntimeFilterProbeCollector
, the issue is caused by the interaction between Runtime Filters and Low Cardinality (dictionary) optimizations. Please use the following variables which are verified to exist in your version (4.0.10): 1. Disable Low Cardinality Optimizations This is the most likely fix. The
DictMappingExpr
in your trace confirms that StarRocks is trying to use a global dictionary to speed up the query, but failing when "unpacking" a constant.
Copy code
sql
-- You confirmed you have this one:
SET cbo_enable_low_cardinality_optimize = false;

-- Also disable the V2 strategy which is active by default in 4.0:
SET low_cardinality_optimize_v2 = false;
2. Disable Runtime Filters The crash happens during
RuntimeFilterProbeCollector::evaluate
. Disabling the filters will prevent this code path from being reached:
Copy code
sql
-- Disable Global Runtime Filters (for Shuffle Joins)
SET enable_global_runtime_filter = false;

-- Disable TopN Runtime Filters (for ORDER BY ... LIMIT)
SET enable_topn_runtime_filter = false;

-- Disable Local Runtime Filters (set limit to 0)
SET runtime_join_filter_push_down_limit = 0;
3. Disable JIT (Just-In-Time) Compilation The
Unpack
functions can sometimes be impacted by JIT expression evaluation.
Copy code
sql
SET jit_level = 0;
Why you didn't find the other variables: *
enable_constant_folding_push_down
: In version 4.0, constant folding is handled internally by the Cost-Based Optimizer (CBO) and does not have a single dedicated toggle variable like it did in some experimental 2.x/3.x builds. *
enable_runtime_filter_pushdown
: This was replaced by more granular controls:
enable_global_runtime_filter
and
runtime_join_filter_push_down_limit
. Recommendation If setting
cbo_enable_low_cardinality_optimize = false
and
enable_global_runtime_filter = false
resolves the crash, you have encountered a known bug in the vectorized execution engine. Update to StarRocks 4.0.12 or 4.1.1: These releases contain critical fixes for
SIGSEGV
in binary predicate evaluation and dictionary mapping that were identified in the early 4.0.x series. References • sql-reference/System_variable.md • using_starrocks/jit.md • release_notes/release-4.0.md References • sql-reference/System_variable.md • using_starrocks/accelerate-cardinality-preserving-joins.md
z
@Rocky nothing above helped I found it by my own the reason is that after parsing the keys it must be casted before doing the joins right?
r
That is an excellent find and correct observation. While StarRocks is designed to handle implicit type conversion (casting) automatically, doing it explicitly is exactly what prevents this specific crash in version 4.0.10. Why explicit casting fixed it: The crash you saw (
UnpackConstColumnBinaryFunction
and
DictMappingExpr
) is a known bug in the interaction between Low Cardinality Optimization and the Runtime Filter generator. 1. The Mismatch: When join keys have different types (e.g.,
INT
joined with
VARCHAR
or
BIGINT
), the engine tries to perform an internal implicit cast. 2. The Failure: If Low Cardinality Optimization is active, the engine uses a "Global Dictionary" to compare these keys. During the optimization phase, the engine tries to "unpack" a constant value to apply a filter. Because the types don't match perfectly, the "unpacking" logic encounters a null pointer or an unexpected state, leading to the BE crash. 3. The Solution: By manually casting the keys to the same type (e.g.,
JOIN ON CAST(a.id AS STRING) = b.id_string
), you remove the need for the engine to guess or perform implicit casting during the sensitive optimization step. This bypasses the buggy code path entirely. Best Practice Recommendation: Even though StarRocks 4.0.12+ and 4.1.x fix this internal logic, it is always a best practice to ensure join keys match in type: * Performance: It saves CPU cycles by avoiding on-the-fly conversions for every row. * Stability: It avoids complex edge cases in the optimizer (like the one you encountered). * Accuracy: It prevents subtle issues with precision (especially when joining `FLOAT`/`DOUBLE` to
DECIMAL
). Summary: You are 100% right. For your current version, you should continue to explicitly cast join keys to ensure they are identical in type to keep the system stable. References • sql-reference/System_variable.md • release_notes/release-4.0.md • administration/Management_variables.md • using_starrocks/accelerate-cardinality-preserving-joins.md References • release_notes/release-4.0.md • sql-reference/System_variable.md • using_starrocks/accelerate-cardinality-preserving-joins.md References • release_notes/release-3.4.md • release_notes/release-3.2.md • using_starrocks/query_acceleration_with_auto_increment.md