hc
02/20/2026, 3:15 PMERROR 5064 (42000): Failed to create repository: write exception: could not open file <s3a://bucket/_starrocks_repository/_repo_info>Rocky
02/20/2026, 3:16 PM_repo_info) to your bucket.
Since you've already verified networking and basic permissions, here are the most common reasons this specific error persists:
1. Missing Broker Name
In the CREATE REPOSITORY statement, you must specify the name of a registered broker. Even if you are using built-in S3 support for other features, the Backup/Restore process typically requires a Broker component.
* Check registered brokers: Run SHOW BROKER; to see your broker names.
* Correct Syntax:
sql
CREATE REPOSITORY my_s3_repo
WITH BROKER "your_broker_name" -- Make sure this matches SHOW BROKER
ON LOCATION "<s3a://bucket/_starrocks_repository/>"
PROPERTIES (
"aws.s3.access_key" = "your_ak",
"aws.s3.secret_key" = "your_sk",
"aws.s3.region" = "us-east-1"
);
2. Region Mismatch
The aws.s3.region property is mandatory and must exactly match the region where your bucket resides (e.g., us-west-2). A mismatch often results in a "could not open file" error because the S3A client attempts to connect to the wrong endpoint.
3. S3A Endpoint Configuration
If you are using a VPC Endpoint for S3 or an S3-compatible storage, you may need to explicitly provide the endpoint:
* Add "aws.s3.endpoint" = "<http://s3.us-east-1.amazonaws.com|s3.us-east-1.amazonaws.com>" to your PROPERTIES.
* Note: For AWS S3, do not include https:// in the endpoint string.
4. Permission Granularity
StarRocks needs to be able to create and delete files to manage the repository. Ensure your IAM policy includes these actions for the specific path:
* s3:PutObject
* s3:GetObject
* s3:ListBucket
* s3:DeleteObject
5. Using s3a:// vs s3://
You are already using s3a://, which is correct for AWS S3 and GCS repositories in StarRocks. If you happen to be using MinIO, try switching the prefix to s3:// as some versions handle it differently for MinIO.
Quick Tip: Check the Broker's log file (broker.log or apache_hdfs_broker.log) on your worker nodes. It often contains a much more descriptive Java stack trace (like a 403 Forbidden or 404 Not Found) that explains exactly why the file "could not be opened."
Let me know if you're able to see more details in the broker logs!
References
• sql-reference/sql-statements/backup_restore/CREATE_REPOSITORY.md
• administration/management/Backup_and_restore.md
• administration/management/BE_configuration.md
• faq/Deploy_faq.md
• administration/management/FE_configuration.md
• faq/Exporting_faq.mdhc
02/20/2026, 3:47 PMStatus: [COMMON_ERROR, msg: fail to open writer for <s3a://bucket/__starrocks_repository/snapshot/__meta.part>]Rocky
02/20/2026, 3:48 PMfail to open writer for <s3a://...> typically occurs when the StarRocks Broker (or the FE/BE if running Broker-less) cannot initialize the write stream to your S3 bucket. While you've checked permissions and connectivity, this error often stems from specific configuration nuances in the CREATE REPOSITORY statement or the underlying S3A protocol.
Here are the most common causes and troubleshooting steps:
1. Missing or Incorrect aws.s3.region
For AWS S3, specifying the region is often mandatory, even if your network is internal. If the region is missing or incorrect, the S3A client may fail to sign requests properly, resulting in a "fail to open writer" error.
Solution: Ensure your repository includes the aws.s3.region property:
sql
CREATE REPOSITORY `your_repo_name`
WITH BROKER
ON LOCATION "<s3a://bucket/path/>"
PROPERTIES(
"aws.s3.access_key" = "your_access_key",
"aws.s3.secret_key" = "your_secret_key",
"aws.s3.region" = "us-east-1" -- Ensure this matches your bucket's region
);
2. S3A Endpoint Configuration
If you are using a non-standard S3-compatible storage (like MinIO) or a VPC endpoint, you must provide the aws.s3.endpoint.
* For AWS S3: Generally, you don't need the endpoint if the region is correct, but for some private links, you might.
* For MinIO/Others: Use aws.s3.endpoint = http://<ip>:<port>.
3. Broker Service Logs
Since the error is prefixed with COMMON_ERROR, the high-level message is often generic. The actual underlying exception (e.g., 403 Forbidden, 400 Bad Request, or Clock Skew) is logged in the Broker's log files.
* Check apache_hdfs_broker.out or broker.log on the nodes where your Broker is running.
* Look for the specific timestamp of the failed BACKUP command to find the Java stack trace.
4. Property Naming Convention
Depending on your StarRocks version and whether you are using a Broker, the S3 properties might expect different prefixes. If aws.s3.access_key doesn't work, try the Hadoop-style fs.s3a prefix:
sql
PROPERTIES(
"fs.s3a.access.key" = "your_access_key",
"fs.s3a.secret.key" = "your_secret_key",
"fs.s3a.endpoint" = "<http://s3.us-east-1.amazonaws.com|s3.us-east-1.amazonaws.com>"
);
5. IAM Roles and Permissions
If you are using IAM Instance Profiles (instead of keys), ensure:
1. "aws.s3.use_instance_profile" = "true" is set in properties.
2. The IAM Role is attached to the Broker nodes (not just the FE/BE nodes).
3. The role has s3:PutObject, s3:GetObject, s3:ListBucket, and s3:DeleteObject permissions on the bucket and the specific path.
6. Protocol Prefix
StarRocks requires the s3a:// prefix for AWS S3 repositories. Ensure you are not using s3:// in the ON LOCATION clause, as the internal S3A client specifically looks for the s3a schema.
Quick Check:
Try to run a simple SHOW SNAPSHOT ON your_repo_name; or CREATE REPOSITORY with a new empty path to see if the initialization succeeds. If it fails immediately, it is almost always a credential/region/endpoint mismatch in the PROPERTIES block.
References
• faq/Exporting_faq.md
• loading/s3.md
• faq/operation_maintenance_faq.md
• faq/Deploy_faq.md
• administration/Meta_recovery.mdhc
02/20/2026, 5:11 PMRocky
02/20/2026, 5:12 PMfe.internal.log file in StarRocks is specifically designed to record internal FE operations that are separate from user-initiated queries.
If you are seeing many large fe.internal.log files, it is usually due to one of the following reasons:
1. High Frequency of Statistics Collection
The most common reason for a large fe.internal.log is the Statistics module (internal.statistic). StarRocks automatically collects statistics (like row counts and column distributions) to help the CBO (Cost-Based Optimizer) generate efficient query plans.
* If your cluster has a very large number of tables, partitions, or frequent data ingestion, the internal SQLs used to collect these statistics will generate a high volume of logs.
2. Internal Audit Logging
The internal.base module logs internal system-level SQL executions. If the system is performing many background tasks (such as metadata synchronization or routine maintenance), these logs can grow quickly.
3. Retention Settings
By default, StarRocks keeps a significant amount of these logs:
* internal_log_roll_num: Defaults to 90. This means StarRocks will keep up to 90 rolled-over log files.
* internal_log_delete_age: Defaults to 7 days. Logs older than this are deleted.
* sys_log_roll_interval / log_roll_size_mb: Logs typically roll daily or when they reach ~1GB.
──────────
How to Manage or Reduce the Size
You can adjust these settings in your fe.conf file (requires an FE restart):
1. Reduce the number of retained files:
Decrease internal_log_roll_num to a smaller value (e.g., 10 or 20) to save disk space.
properties
internal_log_roll_num = 10
2. Shorten the retention period:
Reduce internal_log_delete_age to delete logs sooner.
properties
internal_log_delete_age = 3d
3. Disable specific internal modules (Not recommended for troubleshooting):
If you find that the statistics logs are unnecessary for your current monitoring, you can modify internal_log_modules. The default is {"base", "statistic"}. Removing statistic would stop logging stats collection, but this makes it harder to debug optimizer issues.
properties
internal_log_modules = {"base"}
4. Enable Compression:
Ensure log compression is enabled to reduce the footprint of older logs on the disk.
properties
sys_log_enable_compress = true
Summary: Large fe.internal.log files are generally a sign of a very active cluster (lots of metadata or statistics updates). Adjusting the retention count (internal_log_roll_num) is the safest way to limit disk usage without losing recent diagnostic information.
References
• administration/management/logs.md
• administration/management/FE_configuration.mdhc
02/20/2026, 6:40 PMRocky
02/20/2026, 6:40 PMsql
SHOW BACKUP FROM <your_database_name>;
Pay close attention to these columns:
* Progress: Check if the percentage is increasing. If it's moving slowly, the backup is working but may be bottlenecked by data size or network.
* UnfinishedTasks: This lists the IDs of the sub-tasks that are still running.
* TaskErrMsg: If some sub-tasks have failed, the error message will appear here.
2. Identify the Problematic BE
If UnfinishedTasks shows specific IDs, StarRocks is waiting for those tasks to complete. You can identify which BEs are handling these tasks by looking at the FE logs (fe.log). Search for the JobId or the specific task IDs to find which BE IP is responsible for the upload.
3. Check BE and Broker Logs
Once you identify the BE node:
* BE Logs: Check <http://be.INFO|be.INFO> or be.WARN on that node. Search for "upload" or "snapshot" to see if there are timeout errors, permission denied errors, or connection resets.
* Broker Logs: If you are using a Broker to connect to HDFS or storage, check the Broker's logs. If the Broker is down or misconfigured, the upload will hang.
4. Common Causes
* Large Number of Tablets: If your table has many partitions or tablets, StarRocks creates a snapshot for each. Thousands of small files can significantly slow down the UPLOADING phase.
* Network Bandwidth: High network latency or restricted bandwidth between BEs and the storage repository.
* Storage Permissions/Quota: Ensure the credentials used in CREATE REPOSITORY still have write permissions and that the storage bucket hasn't hit its quota or rate limit.
* Disk Space on BE: BEs need enough local disk space to create the snapshot before uploading.
5. Performance Tuning
If backups are consistently slow in the UPLOADING phase, you can adjust the following parameters:
* upload_worker_count (BE configuration):
In be.conf, this defines the number of threads for upload tasks. The default is 0 (equivalent to the number of CPU cores). You can try increasing this to speed up parallel uploads.
* max_upload_task_per_be (FE configuration):
This is an FE dynamic parameter that limits how many upload tasks are assigned to a BE at once.
sql
ADMIN SET FRONTEND CONFIG ("max_upload_task_per_be" = "10"); -- Example
6. How to Cancel
If the job is truly stuck and you want to restart it, use:
sql
CANCEL BACKUP FROM <your_database_name>;
Rocky's Tip: Always check the connectivity from the BE nodes to your storage endpoint (e.g., using curl or ping) to rule out basic network blocks or firewall issues!
References
• administration/management/BE_configuration.md
• administration/management/FE_configuration.md
• sql-reference/sql-statements/backup_restore/BACKUP.md
• administration/management/monitoring/metrics.md
• sql-reference/sql-statements/backup_restore/SHOW_BACKUP.md
• administration/management/Backup_and_restore.md
• unloading/Export.mdhc
02/23/2026, 1:32 PMautomatic partition rpc end responseRocky
02/23/2026, 1:32 PMautomatic partition rpc end response, is not concerning by itself. It is an informational message related to StarRocks' Expression Partitioning (also known as Automatic Partitioning) feature.
What it means
When you use Expression Partitioning (e.g., PARTITION BY dt), StarRocks automatically creates new partitions as data is loaded. The process works like this:
1. BE Detection: During a data load (like Stream Load or Broker Load), the Back-End (BE) node detects a row with a partition value that doesn't exist yet.
2. RPC Request: The BE sends an RPC (Remote Procedure Call) to the Front-End (FE) to request the creation of that new partition.
3. Log Message: The log automatic partition rpc end response simply indicates that the FE has finished processing the request and the BE has received the response confirming the partition was handled (either created or already exists).
When to ignore it
* If your load jobs are completing successfully.
* If you are loading data for new time periods (e.g., a new day or hour) where partitions need to be created on the fly.
* If there are no accompanying ERROR or WARNING logs.
When to investigate
While the message itself is normal, you should look closer if:
* Load Latency: If you see thousands of these messages in a short burst and your load is slow, you might be creating too many partitions at once. You can check the FE parameter auto_partition_max_creation_number_per_load (default 4096).
* Accompanying Errors: If the log is followed by a "timeout" or "failed to create partition" error, it indicates the FE is struggling to keep up with metadata updates.
* Cardinality Issues: If you accidentally partitioned by a high-cardinality column (like a user_id or timestamp with seconds), this log will appear constantly as the system struggles to create an overwhelming number of partitions.
Summary: This is a routine trace of the automated partitioning handshake between the BE and FE. Unless your loads are failing, you can safely ignore it.
References
• administration/management/BE_configuration.mdhc
02/23/2026, 1:59 PMcancel LocalTabletsChannel reason: emptyRocky
02/23/2026, 1:59 PMcancel LocalTabletsChannel reason: empty in the StarRocks Backend (BE) logs is generally not a cause for concern.
It is an informational message related to the data loading process (such as Stream Load, Broker Load, or Routine Load). Here is a breakdown of what it means and why it appears:
1. What it means
A LocalTabletsChannel is an internal structure the BE uses to manage data being written to its local tablets during a load job. The message indicates that this specific channel was closed or cancelled because no data was ever received for the tablets it was supposed to handle.
2. Common Reasons
* Empty Source Data: The load job was initiated, but the source file or stream contained no rows.
* Data Distribution/Filtering: Even if the overall load job has data, StarRocks distributes data across different BEs based on your partitioning and bucketing. If a specific BE doesn't receive any rows that belong to its local tablets (due to the way data is hashed or filtered), it will eventually close its empty channel.
* Job Cancellation: If a load job is cancelled (either manually by a user or because of an error on another node), the FE will notify all BEs to cancel their respective channels. If a BE hadn't received data yet, it logs "reason: empty".
3. When should you care?
* If your load jobs are successful: You can safely ignore this log. It is simply the BE cleaning up resources for a task that had nothing to do.
* If your load jobs are failing:
* Check for a "Reason" in the SHOW LOAD output or the Stream Load response.
* If you see an error like all partitions have no load data, it confirms the source was empty or all rows were filtered out.
* If you want empty loads to be treated as successful instead of errors, you can check the FE configuration empty_load_as_error (which is true by default).
Summary: Unless you are seeing corresponding load failures or "all partitions have no load data" errors that you don't expect, this log is just a routine part of how StarRocks manages its internal loading channels.
References
• faq/loading/Loading_faq.md
• administration/management/BE_configuration.md
• administration/management/FE_configuration.mdhc
02/23/2026, 2:15 PMbvar is busy at sampling for 2 seconds!Rocky
02/23/2026, 2:15 PMbvar is busy at sampling for 2 seconds! is a warning from the bRPC library (used by StarRocks for internal communication) and typically indicates that the background thread responsible for collecting performance metrics (bvars) is experiencing delays.
Is it concerning?
In most cases, no, it is not a fatal error, and it does not affect data correctness. However, it is a "canary in the coal mine" for performance:
* System Pressure: It usually occurs when the Backend (BE) is under extreme CPU pressure or resource contention. If the CPU is pegged at 100%, the sampling thread may not get enough cycles to complete its work on time.
* Metric Overload: It can also happen if there are an unusually high number of active metrics or RPC connections being tracked simultaneously.
What should you check?
If you see this message frequently, you should investigate the health of that specific BE:
1. CPU Usage: Check if the BE node is hitting high CPU utilization. Frequent occurrences often correlate with CPU saturation.
2. Query Concurrency: Check if there are a massive number of concurrent queries or data loading tasks running.
3. RPC Latency: Use the following SQL to see if there is high latency in bRPC operations:
sql
SELECT * FROM information_schema.be_bvars WHERE NAME LIKE '%rpc_latency%';
4. Other Logs: Look for related messages like The server is overcrowded or brpc failed, which might confirm that the node is struggling to keep up with the load.
Summary
If this happens only occasionally during peak loads, you can generally ignore it. If it happens constantly and is accompanied by query slowdowns, it's a sign that you may need to scale your cluster, optimize your queries, or investigate potential resource bottlenecks (like I/O or memory pressure) that are indirectly slowing down the CPU threads.
References
• administration/management/monitoring/metrics.md
• faq/Sql_faq.md
• knowledge/usage/best-practice.md
• sql-reference/information_schema/be_bvars.md
• administration/management/FE_configuration.md
• faq/Deploy_faq.md
• administration/management/BE_configuration.mdhc
02/24/2026, 2:24 PM[ConnectProcessor.computeStatementDigest():308] Failed to compute statement digest
java.lang.NullPointerExceptionRocky
02/24/2026, 2:24 PM[ConnectProcessor.computeStatementDigest():308] Failed to compute statement digest java.lang.NullPointerException means that while the FE was trying to "normalize" a SQL statement to create this fingerprint, it encountered an unexpected NullPointerException (NPE) in the internal code.
Possible Causes
1. Complex or Edge-case SQL Syntax: A specific SQL query pattern (such as certain complex INSERT statements, specific WITH clauses, or unusual nested expressions) may be triggering a code path that isn't handled correctly by the digest generator.
2. Software Bug: Since this feature is relatively new (available from v3.3.6+), it is likely a bug in the specific version of StarRocks you are running.
Recommended Actions
1. Verify Impact: Usually, this error is non-fatal for the query execution itself. The query should still run, but the Digest field in your fe.audit.log will be empty or failed for that specific statement.
2. Workaround (Disable the Feature): If these errors are cluttering your logs and you do not rely on SQL Digests for auditing, you can disable the feature dynamically:
sql
ADMIN SET FRONTEND CONFIG ('enable_sql_digest' = 'false');
To make this permanent, add enable_sql_digest = false to your fe.conf and restart the FE.
3. Identify the Query: Check your fe.audit.log around the same timestamp as the error to identify the specific SQL statement being executed.
4. Upgrade: Check the release notes for later patch versions of your current major branch (e.g., latest 3.3.x or 3.5.x) to see if a fix for computeStatementDigest has been included.
If you can identify the specific SQL that causes this, it is highly recommended to report it as an issue to the StarRocks community.
References
• administration/sql_digest.md
• sql-reference/sql-functions/crytographic-functions/sha2.md
• sql-reference/sql-functions/crytographic-functions/sm3.md
• sql-reference/sql-functions/crytographic-functions/md5sum_numeric.md
• sql-reference/sql-functions/crytographic-functions/md5.md
• sql-reference/sql-functions/crytographic-functions/md5sum.md
• sql-reference/sql-functions/string-functions/crc32.md
• sql-reference/sql-functions/scalar-functions/hll_empty.mdhc
02/24/2026, 2:28 PM2026-02-24 14:22:31.596Z WARN (thrift-server-pool-63|387) [LeaderImpl.finishTask():237] cannot find task. type: PUBLISH_VERSION, backendId: 12345, signature: 5343206
2026-02-24 14:22:37.830Z WARN (ReportHandler|62) [ReportHandler.deleteFromMeta():1175] report Version from be: 12345 is outdated, report version in request: 17704118734039, latest report version: 17704118734045, ignore tablet: 12327658Rocky
02/24/2026, 2:28 PMcannot find task. type: PUBLISH_VERSION
text
2026-02-24 14:22:31.596Z WARN (thrift-server-pool-63|387) [LeaderImpl.finishTask():237] cannot find task. type: PUBLISH_VERSION, backendId: 12345, signature: 5343206
* What it means: When a transaction is committed, the FE sends a PUBLISH_VERSION task to the BEs to make the data visible. This warning indicates that a BE (ID 12345) has responded that it finished the task, but the FE no longer has a record of this specific task (identified by the signature).
* Why it happens: This usually occurs due to a timeout. If the BE takes longer than the expected threshold to finish the publish task, the FE might have already removed the task from its internal "pending" list or marked the transaction as failed/timed out. When the BE finally finishes and sends the acknowledgment, the FE simply reports that it can't find the original task entry.
* Action: If this happens occasionally, it is usually harmless. However, if you see it frequently alongside slow loading or "publish version timeout" errors, you may need to check the BE disk I/O or increase the publish_version_timeout_second configuration in the FE.
2. report Version from be is outdated
text
2026-02-24 14:22:37.830Z WARN (ReportHandler|62) [ReportHandler.deleteFromMeta():1175] report Version from be: 12345 is outdated, report version in request: 17704118734039, latest report version: 17704118734045, ignore tablet: 12327658
* What it means: BE nodes periodically send "reports" to the FE containing their current status (e.g., tablet information, disk usage). Each report has an incremental version number. This log means the FE received a report from BE 12345 that has a lower version number (...4039) than a report it has already processed (...4045).
* Why it happens: This is typically caused by network jitter or latency. An older report packet was delayed in the network and arrived at the FE after a newer report packet had already been received and processed.
* Action: The FE correctly ignores the stale report to prevent overwriting its metadata with outdated information. This is a self-healing mechanism and is generally safe to ignore unless you are seeing persistent network instability between your FE and BE nodes.
In summary, both of these logs are warnings about asynchronous events arriving out of their expected window and do not necessarily indicate a critical failure in the cluster.
References
• administration/management/BE_configuration.md
• deployment/upgrade.md
• deployment/downgrade.mdhc
02/24/2026, 2:38 PM2026-02-24 13:30:45.952Z ERROR (JournalWriter|123) [JournalWriter.abortJournalTask():196] failed to commit journal after retried 3 times!Rocky
02/24/2026, 2:38 PMfailed to commit journal after retried 3 times! is a critical error from the StarRocks Frontend (FE). It indicates that the Leader FE failed to write its metadata changes (edit logs) to the backend storage (typically BDBJE) even after multiple retry attempts.
What it means
In StarRocks, the Leader FE is responsible for all metadata modifications (e.g., creating tables, starting load jobs, schema changes). These changes are written to a "journal." If the Leader cannot commit these changes to the journal, it cannot guarantee metadata consistency or persistence. Consequently, the FE will usually stop providing services or exit to prevent further issues.
Common Causes
1. Disk Issues (Most Common):
* Disk Full: The disk partition where meta_dir (specified in fe.conf) is located has run out of space.
* Slow I/O: The disk is experiencing extreme latency or is stuck, preventing the BDBJE transaction from committing within a reasonable time.
* Permission Issues: The FE process no longer has write permissions to the metadata directory.
2. Quorum/Network Loss:
* In a High Availability (HA) setup with multiple FEs, the Leader must synchronize the journal to a majority (quorum) of Follower nodes. If the Leader loses connection to the Followers or the Followers are down, the Leader cannot "commit" the journal.
3. BDBJE Internal Failure:
* The underlying Berkeley DB (BDBJE) environment may have encountered a fatal error (e.g., EnvironmentFailureException). Check the fe.log or bdb/je.info.0 file for earlier exceptions.
* Clock Skew: If the system clocks between FE nodes are out of sync by more than 5 seconds, the BDBJE replication group may fail to function.
4. Heavy Metadata Pressure:
* A massive burst of metadata operations (e.g., thousands of simultaneous partition creations or frequent small load jobs) can sometimes overwhelm the journal writing thread.
Troubleshooting Steps
1. Check Disk Space: Run df -h on the Leader FE node to ensure the meta_dir disk is not at 100% capacity.
2. Inspect Full Logs: Search the fe.log specifically for keywords like Exception, EnvironmentFailureException, or ReplicaWriteException occurring just before the "failed to commit" message.
3. Check FE Status: Run SHOW FRONTENDS; (if the cluster is still somewhat responsive) or check the process status of all FE nodes to see if Followers are healthy.
4. Verify Clock Sync: Ensure NTP or Chrony is running and that all FE nodes have synchronized system times.
5. Check for Hardware/OS Errors: Look at dmesg or system logs for disk I/O errors.
Note: If the FE has exited due to this error, simply restarting the Leader FE often resolves transient issues (like a brief network glitch), but if the root cause is a full disk or corrupted BDBJE environment, it will fail again shortly after.
References
• administration/management/FE_configuration.mdhc
02/24/2026, 2:50 PMERROR (thrift-server-pool-3578|5621) [SRTThreadPoolServer$WorkerProcess.run():319] Thrift Error occurred during processing of message.Rocky
02/24/2026, 2:50 PMERROR (...) [SRTThreadPoolServer$WorkerProcess.run():319] Thrift Error occurred during processing of message typically indicates a low-level communication failure between the FE (Front End) and another component, such as a BE (Back End), another FE, or a client application.
SRTThreadPoolServer is StarRocks' internal implementation of a Thrift server pool. When this error occurs, it means a worker thread encountered an exception while trying to read, process, or write a Thrift message over the network.
Common Causes
1. Network Connection Reset/Closed:
* The most frequent cause is that the client (the node on the other end) closed the connection prematurely while the FE was still processing the request or trying to send a response.
* This can happen due to network instability or a process on the other end crashing.
2. Timeouts:
* If the processing takes longer than the configured Thrift timeout, the connection might be dropped.
* Check the FE configuration: thrift_client_timeout_ms (default is usually 5000ms).
3. Message Size Limits:
* If the request or response payload is exceptionally large, it might exceed the internal buffer limits of the Thrift server.
* Check the FE configuration: thrift_rpc_max_body_size.
4. Resource Exhaustion:
* If the FE is under heavy load and the number of concurrent Thrift requests exceeds thrift_server_max_worker_threads, new requests might be queued or rejected, leading to connection issues that manifest as Thrift errors.
Troubleshooting Steps
* Check BE Logs: Look at the <http://be.INFO|be.INFO> or be.WARNING logs around the same timestamp to see if there are corresponding "RPC failed" or "Connection refused" errors.
* Check Network Latency: Ensure there is stable connectivity between your FE and BE nodes.
* Review FE Load: Check if the FE JVM is experiencing long GC pauses (check fe.gc.log), which can cause Thrift heartbeats or processing to time out.
* Validate Configurations:
* Verify if thrift_server_max_worker_threads (default 4096) is sufficient for your concurrency.
* If you are dealing with very large metadata or complex queries, you might need to increase timeout settings.
If this error happens only occasionally, it is often a transient network glitch or a client disconnecting. However, if it is frequent, it usually points to a more persistent network or resource bottleneck.
References
• faq/Deploy_faq.md
• administration/Meta_recovery.md
• developers/code-style-guides/thrift-guides.md
• knowledge/usage/best-practice.md
• administration/management/FE_configuration.md
• administration/management/monitoring/metrics.mdhc
02/24/2026, 7:19 PMW20260224 16:39:00.867549 126470952314432 engine_clone_task.cpp:180] Fail to load snapshot:Rpc error: Couldn't open transport for 100.100.100.100:9060 (socket(): Too many open files)Rocky
02/24/2026, 7:19 PMsocket(): Too many open files indicates that the StarRocks Backend (BE) process has reached the operating system's limit for the maximum number of open file descriptors (FDs).
What happened?
In StarRocks, the BE process needs to open many file descriptors for:
1. Data files: Each tablet and its underlying segments are stored as files.
2. Network sockets: Communication between BEs (like the RPC call in your error) and communication between FE and BE require sockets.
The specific error occurred during an engine_clone_task. This task is responsible for cloning or migrating tablet replicas between BE nodes (e.g., during rebalancing or when a node is added/recovered). Because cloning involves transferring data, it opens multiple files and network connections simultaneously, which likely pushed the FD count over the system's configured limit.
Recommended Fix
You need to increase the ulimit for file descriptors on all BE nodes. StarRocks recommends setting the limit to 655350.
1. Temporary Fix (for the current session)
You can increase the limit for the current shell session (though you'll need to restart the BE process from this shell):
bash
ulimit -n 655350
2. Permanent Fix (Recommended)
Modify the system configuration to ensure the limit persists after a reboot. Edit /etc/security/limits.conf and add the following lines:
text
* soft nofile 655350
* hard nofile 655350
* soft nproc 65535
* hard nproc 65535
If you are using systemd to manage the StarRocks service, you may also need to add the limit to the service file (e.g., /etc/systemd/system/starrocks-be.service):
ini
[Service]
LimitNOFILE=655350
Then run systemctl daemon-reload and restart the BE.
How to Verify
1. Check OS limit: Run ulimit -n.
2. Check the running BE process limit:
Find the PID of your BE and check its specific limits:
bash
cat /proc/$(pgrep starrocks_be)/limits | grep "Max open files"
If the limit is already high (e.g., 655,350) and you still see this error, it might indicate an FD leak or an extremely high number of tablets/segments on a single BE, but in 99% of cases, it is simply an insufficiently configured ulimit.
References
• deployment/environment_configurations.md
• administration/management/BE_configuration.md
• knowledge/trouble_shooting/fe_memory_problems.md
• faq/fe_mem_faq.md
• administration/Meta_recovery.md
• administration/management/logs.mdhc
02/25/2026, 1:37 AMRocky
02/25/2026, 1:37 AMtransfer FE type from LEADER to UNKNOWN. exit in fe.log. This happens because the JVM "Stop-the-World" pause during Full GC makes the Leader lose its heartbeat with other nodes.
* Action: Check your GC logs (fe.gc.log). If pauses exceed several seconds, increase the FE heap size (-Xmx) in fe.conf.
2. Intensive Metadata Operations
Metadata management is CPU-intensive. Specific tasks can spike CPU:
* Image Checkpointing: Before StarRocks v3.4, the Leader FE performed image serialization locally. This consumes significant CPU and memory.
* Tablet Reports: BE nodes periodically report the status of all tablets to the FE Leader. In large clusters (millions of tablets), this single-threaded processing can overwhelm the FE.
* Metadata Replay: If there is a massive burst of "edit logs" (e.g., thousands of ALTER TABLE or partition creations), Followers may spike in CPU as they struggle to replay these logs to stay in sync.
3. Query Planning & High Concurrency
The FE is responsible for parsing, analyzing, and optimizing SQL.
* High Concurrency: A sudden surge in client connections can exhaust the FE thread pool and CPU.
* Complex SQL: Queries with thousands of IN clauses or hundreds of joins require significant CPU during the planning phase.
* Audit Logs: Writing extremely high volumes of audit logs to a slow disk can cause backpressure, leading to thread blocking and high CPU.
4. BDBJE Latch Timeouts (Disk I/O)
StarRocks uses BDBJE for metadata replication.
* Cause: If the metadata disk (specified by meta_dir) is slow or has high I/O wait, BDBJE can experience "Latch timeouts" (LogbufferPool_FullLatch).
* Result: This can cause the FE process to become unresponsive and eventually crash. Ensure your FE metadata is stored on high-performance SSDs.
5. JVM/Environment Issues
* OOM Killer: If the FE process exceeds the physical RAM available on the machine (Heap + Off-heap memory), the Linux kernel may kill the process. Check dmesg or /var/log/messages for "Out of memory: Kill process".
* MALLOC_ARENA_MAX: In some environments, the default glibc memory allocation can lead to virtual memory bloat. Setting export MALLOC_ARENA_MAX=1 in fe.conf is a common fix.
Troubleshooting Steps:
1. Check FE Logs: Look for Full GC, warn or error messages in fe.log and fe.warn.log.
2. Analyze GC Logs: Use tools like gceasy.io to analyze fe.gc.log.0.current.
3. Capture Jstack: If the FE is still running but CPU is high, run jstack <pid> > jstack.out to see which threads are busy.
4. Review Metadata Stats: Check the number of tablets and partitions. If you have millions of tablets, consider increasing the FE heap or merging small partitions.
5. Audit Log Check: Check the fe/log/fe.audit.log to see if there was a spike in slow or complex queries just before the crash.
References
• knowledge/trouble_shooting/fe_memory_problems.md
• faq/fe_mem_faq.mdhc
03/01/2026, 1:22 PMRocky
03/01/2026, 1:22 PMInvalid: __info_xxx.part in the output of SHOW SNAPSHOT typically indicates that StarRocks found a metadata file in your backup repository that is incomplete or corrupted.
What the error means:
When you perform a BACKUP, StarRocks creates metadata files in the repository (such as S3, HDFS, or Azure Blob Storage) to describe the snapshot. These files are often named __info_<snapshot_name>.
The .part suffix is a temporary extension used during the upload process. Once the file is successfully and completely written to the storage, StarRocks renames it to the final version (removing the .part).
If SHOW SNAPSHOT displays Invalid: __info_xxx.part, it means the system detected a partial metadata file that was never finalized.
Potential Causes:
1. Interrupted Backup Job: The most common cause is that a BACKUP task was interrupted before it could finish. This could be due to:
• An FE (Frontend) restart or crash during the backup process.
• Network instability between StarRocks and the storage repository.
• The backup job being manually cancelled while it was in the "finalizing" stage.
2. Storage Write Failures: If the underlying storage (e.g., S3) experienced a timeout or a write error at the very end of the backup process, the temporary .part file might remain in the bucket without being renamed.
3. Manual File Manipulation: If files in the repository were manually moved, deleted, or modified, it could leave the repository in an inconsistent state.
How to resolve it:
• Check Job Status: Run SHOW BACKUP to see if there are any failed or cancelled jobs that correspond to that snapshot name.
• Clean up: If the snapshot is indeed invalid and you don't need it, you can manually delete the .part file from your storage repository (e.g., using aws s3 rm or hdfs dfs -rm).
• Retry Backup: If the snapshot is required, you will need to run the BACKUP command again to create a complete and valid snapshot.
If you continue to see this error despite successful backup jobs, ensure that your FE has stable network connectivity and the necessary permissions to perform RENAME or MOVE operations on the storage service.hc
03/04/2026, 5:37 PMRocky
03/04/2026, 5:37 PMBACKUP operation stays in the PENDING state, it usually means the job has been submitted to the Front End (FE) but hasn't successfully transitioned into the active snapshotting phase.
Here are the most common reasons this might happen:
1. Repository Connectivity/Configuration:
The FE might be having trouble communicating with your backup repository (e.g., S3, HDFS, or MinIO). If the repository is unreachable or the credentials/permissions are incorrect, the job may hang in PENDING while it retries.
* Action: Double-check your CREATE REPOSITORY statement and ensure the FE and all BEs have network access to the storage destination.
2. Snapshot Preparation:
In the PENDING stage, the FE sends snapshot requests to the relevant Back Ends (BEs). If the BEs are under heavy load or if there is a high frequency of data ingestion, it might take longer to initialize the consistent snapshots.
3. Concurrent Jobs:
StarRocks typically allows only one backup or restore job per database at a time. If there is another job running or if a previous job didn't clean up properly, the new job will wait.
* Action: Run SHOW BACKUP; to see if there are other tasks and check their status.
4. FE Task Scheduling:
Sometimes internal FE threads responsible for scheduling these tasks are busy or hitting a limit.
Troubleshooting Steps:
* Check Detailed Status: Run the following command to see if there's an error message hidden in the job details:
sql
SHOW BACKUP FROM your_database_name;
* Inspect FE Logs: Look into the fe.log and fe.warn.log on your leader FE. Search for keywords like "BackupJob" or the specific ID of your backup job. This is usually the quickest way to find the root cause (e.g., "Access Denied" or "Timeout").
* Check Repository: Test if you can manually access the storage from the StarRocks nodes using a CLI tool (like aws s3 ls or hadoop fs -ls).
If the job stays stuck for a very long time without any log activity, you can try to cancel it and restart:
sql
CANCEL BACKUP FROM your_database_name;
Let me know if you see any specific errors in the logs!hc
03/13/2026, 11:39 AMRocky
03/13/2026, 11:39 AMErrorURL)
If a Stream Load job completes with a Fail status or has NumberFilteredRows > 0, the JSON response will include an ErrorURL.
* How to view: Copy the ErrorURL from the response and use curl or a browser to view it.
* What it shows: Specific rows that were filtered out and the reason (e.g., "column count mismatch" or "invalid data format").
2. Information Schema (System Tables)
Starting from StarRocks v3.0, you can query metadata and logs directly via SQL:
* information_schema.stream_loads: Provides the status, error messages, and tracking URLs for recent Stream Load jobs.
sql
SELECT * FROM information_schema.stream_loads WHERE LABEL = 'your_label';
* information_schema.load_tracking_logs: Provides more detailed error tracking for specific jobs.
sql
SELECT * FROM information_schema.load_tracking_logs WHERE LABEL = 'your_label';
3. Detailed HTTP Verbose Logs
If you need to see the exact HTTP requests and responses for debugging (e.g., headers, body info), you can enable verbose logging on the Backend (BE).
* BE Configuration: enable_stream_load_verbose_log (Default: false).
* How to enable:
sql
ADMIN SET FRONTEND CONFIG ("enable_stream_load_verbose_log" = "true"); -- For FE
-- Or for BE via curl:
curl -X POST http://<be_ip>:<be_http_port>/api/update_config?enable_stream_load_verbose_log=true
* Where to find them: These logs will appear in the <http://be.INFO|be.INFO> log file on the specific BE node that handled the request.
4. System Log Files
If a load fails due to a system crash or unexpected error (not a data quality issue), check the standard log files:
* FE Logs (fe.log / fe.warn): Shows the initial coordination and transaction beginning/committing. Search for your Label or TxnId.
* BE Logs (<http://be.INFO|be.INFO> / be.WARNING): Shows the actual data processing and writing to tablets. Search for the TxnId returned in the Stream Load response.
5. Summary Tips
* Identify the Label: Always use a unique Label for your Stream Load jobs; it makes searching through logs and system tables much easier.
* Search by TxnID: The TxnId is the most reliable way to trace a specific load across FE and BE logs.
References
• administration/management/monitoring/metrics.md
• loading/StreamLoad.md
• administration/management/BE_configuration.md
• sql-reference/sql-statements/loading_unloading/STREAM_LOAD.md
• sql-reference/information_schema/load_tracking_logs.md
• sql-reference/information_schema/stream_loads.mdhc
03/13/2026, 11:40 AMRocky
03/13/2026, 11:41 AM${STARROCKS_HOME}/log/ directory of the BE node that handled the request.
* <http://be.INFO|be.INFO>: This is the primary runtime log. You can search for your Stream Load Label or TxnId here to see the execution details.
* be.WARNING: If the load timed out or failed due to a network/IO issue, it will likely be recorded here.
* FE Logs: Look in ${STARROCKS_HOME}/log/ on the FE node.
* fe.log: Useful for seeing the initial request, redirection, and whether the FE marked the transaction as "Aborted" due to timeout.
* Error Log URL: If the load finished but failed with errors (e.g., data quality), check the ErrorURL provided in the JSON response of the Stream Load. You can also find these in ${STARROCKS_HOME}/storage/error_log/ on the BE.
2. How to Search the Logs
When searching, use the Label you assigned to the load or the TxnId (Transaction ID) returned in the response.
Example command on BE:
bash
grep "your_load_label" <http://be.INFO|be.INFO>
# or search for timeout specifically
grep -i "timeout" <http://be.INFO|be.INFO> | grep "StreamLoad"
3. Common Log Patterns for Read Timeout
If you encounter a "read timeout," look for these keywords:
* `timeout`: General timeout occurred.
* `deadline exceeded`: The internal RPC or execution deadline was reached.
* Broken pipe or `Connection reset`: Often indicates the client closed the connection before the BE finished reading the data.
* `stream_load_default_timeout_second`: Indicates the job hit the default system timeout.
4. Useful Configurations for Debugging
If the logs are not detailed enough, you can enable verbose logging for Stream Load on the BEs:
* Enable Verbose HTTP Logs:
sql
-- Run this on the BE or via SQL (if supported by your version)
-- to log HTTP requests and responses for Stream Load.
ADMIN SET FRONTEND CONFIG ("enable_stream_load_verbose_log" = "true"); -- (Actually a BE config, set via BE HTTP API or be.conf)
Note: In newer versions, you can set this dynamically on BE via the HTTP API: curl -X POST <http://be_ip:be_http_port/api/update_config?enable_stream_load_verbose_log=true>
5. Parameters to Consider
If you find that your loads are timing out frequently, you might need to adjust:
* stream_load_default_timeout_second (FE): Default is 600s. Increase this if your data is large.
* streaming_load_rpc_max_alive_time_sec (BE): The RPC timeout for Stream Load processes.
* Client-side timeout: Ensure the tool you are using (e.g., curl --connect-timeout or an SDK) has a longer timeout than the StarRocks server-side timeout.
References
• administration/management/FE_configuration.md
• administration/management/BE_configuration.md
• faq/loading/Broker_load_faq.md
• faq/loading/Loading_faq.mdhc
03/13/2026, 11:49 AMwaiting secondary replicas too long, load_id: , txn_id: , timeout: 7181485 ms, elapsed time: 30001 ms, primary replica host: , num finished tablets: 0, num unfinished tablets: 2342, last unfinished tablet: [tablet_id: , state 1]Rocky
03/13/2026, 11:49 AMwaiting secondary replicas too long, typically occurs when loading data into a Primary Key table in StarRocks.
What it means
In StarRocks Primary Key tables, the loading process uses a "Primary-Secondary" replication model. The Primary Replica (a specific BE) receives the data, processes it, and then sends the data segments to the Secondary Replicas (other BEs).
The Primary Replica then waits for the Secondary Replicas to acknowledge that they have successfully received and written the data. If the Secondary Replicas do not respond within an internal timeout window—which is 30 seconds (as seen in your elapsed time: 30001 ms)—the load job fails with this error.
Even if your total load timeout (timeout: 7181485 ms) is very high, this internal synchronization check has a much shorter limit to prevent the system from hanging.
Possible Causes
1. Overloaded BEs: The most common cause is that one or more Backend (BE) nodes are under heavy pressure (CPU, I/O, or memory). The secondary replicas are too busy to process the replication request and acknowledge it within 30 seconds.
2. Too many tablets in one transaction: Your error shows num unfinished tablets: 2342. This is a very high number of tablets to process in a single synchronization step. If a load job touches too many buckets or partitions at once, it can overwhelm the replication process.
3. Primary Key Index Overhead: For Primary Key tables, every write requires a primary key index lookup and update. If the index is large or the BEs are struggling with memory, this process slows down, causing the replication acknowledgment to time out.
4. Network Congestion: Slow or unstable network connectivity between BE nodes can delay the transmission of segments or the acknowledgment signals.
5. Disk I/O Bottleneck: If the disks on the secondary BEs are experiencing high latency (e.g., due to heavy compaction or other I/O intensive tasks), they cannot write the data segments quickly enough.
Recommended Actions
* Reduce Load Concurrency/Batch Size: If you are using Routine Load or Stream Load, try reducing the batch size or the frequency of the loads. This reduces the number of tablets the system has to synchronize at once.
* Check BE Resource Usage: Monitor your BE nodes' CPU and Disk I/O. Use top or StarRocks' Grafana dashboards to see if any nodes are hitting 100% utilization.
* Optimize Tablet Count: If your table has too many buckets (BUCKETS in the DISTRIBUTED BY clause) or too many partitions, consider reducing them to decrease the "width" of the load.
* Adjust BE Configurations:
* transaction_apply_worker_count: Increase this in be.conf (default is usually the number of CPU cores) to allow more threads to handle Primary Key update applications.
* tablet_max_versions: Check if your tables have a high compaction score. If compaction is lagging, metadata operations become slower.
* Check Persistent Index: Ensure that enable_persistent_index is set to true for your Primary Key table to reduce memory pressure on the BEs.
References
• administration/management/BE_configuration.mdhc
03/13/2026, 12:05 PMasync_delta_writer.cpp:187] Fail to execution_queue_execute: 22Rocky
03/13/2026, 12:05 PMasync_delta_writer.cpp:187] Fail to execution_queue_execute: 22 indicates that a StarRocks Backend (BE) process failed to submit a data writing task to the internal asynchronous execution queue.
What the error means
* async_delta_writer: This is a component in the BE responsible for handling data writes (memtable flushes) asynchronously during data loading (e.g., Stream Load, Broker Load, or Routine Load).
* execution_queue_execute: This is the function call that attempts to place a write task into a thread pool queue for execution.
* 22: This is the error code. In Linux/POSIX systems, 22 stands for EINVAL (Invalid Argument). In the context of StarRocks task queues, this specifically means the queue is no longer accepting tasks, usually because it has been closed or is shutting down.
Common Causes
1. BE Shutdown or Restart: This is the most frequent cause. If the BE process is in the middle of a restart or shutdown, it closes its execution queues. Any pending or new write tasks will fail with error 22.
2. Load Job Cancellation or Timeout: If a load job (like a Stream Load) is cancelled by the user or times out on the Frontend (FE), the FE tells the BE to stop. The BE then closes the writers for that job. If a write thread tries to submit one last task to a closing writer, you will see this error.
3. Tablet Migration or Deletion: If the tablet being written to is currently being migrated to another BE or has been dropped (e.g., the table or partition was deleted), the local writer is closed, leading to this failure.
4. High Resource Pressure: In rare cases, extreme memory or CPU pressure can cause the BE to abort certain tasks or close writers to prevent a crash, though this is usually accompanied by OOM (Out of Memory) logs.
Troubleshooting Steps
* Check BE Uptime: Run ps -ef | grep starrocks_be or check the BE's be.out log to see if the process recently restarted.
* Check Load Job Status: If you are using Stream Load or Routine Load, check if the job state is CANCELLED or if it failed with a TIMEOUT.
sql
SHOW LOAD; -- For Stream/Broker Load
SHOW ROUTINE LOAD; -- For Routine Load
* Monitor BE Logs: Look at the <http://be.INFO|be.INFO> logs around the same timestamp for messages like stopping, shutting down, or tablet is being dropped.
* Adjust Concurrency (if happening frequently under load): If this happens during high-concurrency loads without restarts, consider checking the BE configuration number_tablet_writer_threads. The default is half of the CPU cores. If the system is overloaded, you may need to reduce the loading frequency or scale the cluster.
In most cases, if this happens only once or twice during a service maintenance window, it can be safely ignored as it's a symptom of a clean shutdown or a timed-out job.
References
• sql-reference/Error_code.md
• developers/code-style-guides/restful-api-standard.mdhc
03/13/2026, 12:12 PMRocky
03/13/2026, 12:12 PMtxn_id (Transaction ID) in StarRocks, you can use the following methods depending on the type of operation (e.g., INSERT or STREAM LOAD).
1. Use SHOW TRANSACTION
The most direct way to get details for a specific transaction is the SHOW TRANSACTION command. This will return the Label associated with the transaction.
sql
SHOW TRANSACTION WHERE ID = <txn_id>;
* For INSERT statements: The Label is typically formatted as insert_<query_id>. You can extract the query_id from this string.
* For Stream Loads: The Label is the one provided by the user during the load request.
2. Query information_schema Views (v3.1+)
If you are on StarRocks v3.1 or later, you can use the information_schema.loads view. This view contains a RUNTIME_DETAILS column which includes the txn_id.
sql
-- Find the label and type for a specific transaction ID
SELECT LABEL, TYPE, STATE
FROM information_schema.loads
WHERE RUNTIME_DETAILS LIKE '%"txn_id": <txn_id>%';
For Stream Loads specifically, there is a dedicated view with a direct TXN_ID column:
sql
SELECT LABEL, DB_NAME, TABLE_NAME, STATE
FROM information_schema.stream_loads
WHERE TXN_ID = <txn_id>;
3. Find the SQL via Query ID
Once you have retrieved the query_id (usually from the insert_<query_id> label), you can find the actual SQL text using one of these methods:
* Audit Log: Search for the query_id in the fe.audit.log file on your FE node.
* Audit Table: If you have the AuditLoader plugin installed, query your audit table:
sql
SELECT stmt FROM starrocks_audit_db*.starrocks_audit_tbl*
WHERE queryId = '<query_id>';
* Query Profile: If the query is still in the profile cache, you can view its details:
sql
get_query_profile('<query_id>');
Summary of Workflow
1. Run SHOW TRANSACTION WHERE ID = <txn_id>;.
2. Note the Label. If it looks like insert_01234567-89ab-cdef..., then 01234567-89ab-cdef... is your Query ID.
3. Search for that Query ID in your Audit Logs to find the original SQL statement.
References
• sql-reference/information_schema/be_txns.md
• sql-reference/information_schema/loads.md
• sql-reference/information_schema/stream_loads.mdhc
03/13/2026, 12:27 PMRocky
03/13/2026, 12:27 PMsql
SHOW PROC '/compactions';
Look at the CompactionScore. If it is consistently high (e.g., > 100), compaction is falling behind, which is likely causing the I/O spikes.
2. Analyze Load Profiles
Enable the load profile for your table to see where the time is being spent:
sql
ALTER TABLE your_table SET ('enable_load_profile' = 'true');
After a load, use SHOW PROFILELIST and ANALYZE PROFILE to check metrics like WaitFlushTime. A high WaitFlushTime confirms that the system is waiting on the disk to finish writing.
3. Optimization Recommendations
* Increase Batch Size: Instead of many small loads, aggregate data on the client side and send larger batches (e.g., 100MB to 1GB per load) every 10–60 seconds.
* Use SSDs: It is highly recommended to use NVMe or SATA SSDs for BE storage in production.
* Tune Flush Threads: If you have high-performance disks but still see I/O wait, you can increase the number of flush threads in `be.conf`:
conf
flush_thread_num_per_store = 4 # Default is often 2
* Tune Compaction: Reduce the number of segments merged at once to smooth out I/O spikes:
conf
max_cumulative_compaction_num_singleton_deltas = 100 # Default is 500
References
• loading/loading_introduction/troubleshooting_loading.mdhc
03/16/2026, 11:51 AMFailed to sync segment SyncChannnel [host: , port: , load_id: a72ydhftser, tablet_id: 11111, txn_id: 22222] err Internal error: PTabletWriterAddSegmentRequest tablet_id 11111 not existsRocky
03/16/2026, 11:51 AMPTabletWriterAddSegmentRequest tablet_id 11111 not exists means that a BE node received an internal request to add a data segment to tablet 11111, but that BE does not have an active "Tablet Writer" for that specific tablet under the given load_id and txn_id.
In StarRocks, when data is loaded, it is often shuffled between BEs so that the BE holding the tablet replica can write the data. If the receiving BE hasn't initialized a writer for that tablet or has already closed it, this error is thrown.
Common Causes
1. Concurrent Load Failure: If another part of the same load job failed on a different tablet or BE, the entire transaction might have been aborted. The BE then cleans up its writers. If a "late" segment arrives from another node for that same transaction, the BE reports it "not exists."
2. Load Timeout: The load job may have exceeded its timeout (e.g., streaming_load_rpc_max_alive_time_sec or the session variable query_timeout). Once the timeout is reached, the BE closes the writers to free up resources.
3. Tablet Migration or Rebalancing: If a tablet was moved to a different BE (due to decommissioning a node or cluster balancing) while the load was in progress, the original BE will no longer recognize the tablet as its own.
4. BE Restart: If the destination BE restarted during the load, it would lose the in-memory state of the active load transaction.
5. Schema Change: Running a SCHEMA CHANGE or ROLLUP on the same table during a load can sometimes lead to tablet version mismatches or writer closures.
How to Troubleshoot
* Check BE Logs: Look at the <http://be.INFO|be.INFO> or be.WARNING logs on the BE that reported the error. Search for the load_id (a72ydhftser in your case) to see if there was an earlier error that caused the writers to close (e.g., "memory limit exceeded," "disk full," or "RPC timeout").
* Verify Tablet Location: Run the following SQL to see which BEs currently hold the replicas for that tablet:
sql
SHOW TABLET 11111;
Compare the BackendId from the output with the host that threw the error.
* Check Load Status: If this was a Broker Load or Routine Load, check the job status:
sql
SHOW LOAD WHERE LABEL = 'your_label';
-- or for Routine Load
SHOW ROUTINE LOAD FOR your_table;
* Increase Timeouts: If the error is frequent during large loads, try increasing the timeout settings:
* In FE (session variable): SET query_timeout = 3600;
* In `be.conf`: streaming_load_rpc_max_alive_time_sec (default is usually 600s).
If the error only happens once, it is likely a transient network or timing issue. If it persists, it usually points to a resource bottleneck (memory/disk) or a version mismatch.
References
• faq/loading/Loading_faq.md
• sql-reference/sql-statements/table_bucket_part_index/SHOW_TABLET.md
• faq/operation_maintenance_faq.md
• sql-reference/information_schema/be_tablets.md
• table_design/table_types/primary_key_table.mdhc
03/16/2026, 12:00 PMW20260315 05:10:45.727612 12337242 segment_replicate_executor.cpp:189] Failed to send rpc to SyncChannnel [host: , port: , load_id: 529d17c, tablet_id: 11111, txn_id: 22222] err=Internal error: PTabletWriterAddSegmentRequest tablet_id 11111 not existsRocky
03/16/2026, 12:00 PMPTabletWriterAddSegmentRequest.
What the error means
The error Internal error: PTabletWriterAddSegmentRequest tablet_id 11111 not exists means that the Primary BE tried to send a data segment to a Follower BE, but the Follower BE reported that it does not have tablet 11111 in its local metadata.
Potential Causes
1. Tablet Migration or Balancing:
StarRocks might have moved the tablet replica from that specific BE to another BE while the load job was still running. The load process is still trying to send data to the "old" location based on the replica map it received at the start of the transaction.
2. Table/Partition Drop or Truncate:
If a user dropped or truncated the table/partition while the data was being loaded, the BE would have deleted the local tablet metadata, leading to this "not exists" error when the load tries to finish writing.
3. Stale Metadata on the Coordinator/Primary BE:
The BE acting as the coordinator or the primary for the load might have an outdated view of where the replicas are located. This can happen if there was a recent cluster change (e.g., adding/removing nodes) and the FE hasn't propagated the new replica locations to all BEs yet.
4. BE Restart or Storage Issues:
If the target BE recently restarted, it might still be loading its metadata into memory. Alternatively, if there was a disk error that caused the tablet to be marked as "bad" or removed, the RPC would fail.
5. Schema Change:
An ongoing schema change might have triggered a tablet conversion or migration, causing the original tablet ID to become invalid or be replaced.
How to Troubleshoot
* Check Tablet Status:
Run the following command to see where the replicas for that tablet are currently located:
sql
SHOW TABLET 11111;
Compare the BackendId in the output with the Backend that reported the error. If the Backend is no longer listed as a host for that tablet, it confirms a migration or deletion occurred.
* Check Cluster Balance Tasks:
See if there are any active tablet migrations that might be causing replicas to move:
sql
SHOW PROC '/cluster_balance/running_tablets';
* Verify if Single Replica Load is enabled:
This error is specific to this feature. You can check your global or session settings:
sql
SHOW VARIABLES LIKE '%enable_single_replica_load%';
* Identify the Table:
If you don't know which table is affected, you can find it using the tablet_id from the error:
sql
SELECT * FROM information_schema.be_tablets WHERE tablet_id = 11111;
Summary:
This is usually a transient error caused by the cluster dynamically moving data (balancing) while a load is in progress. If the load job fails, StarRocks will typically retry it automatically. If it happens frequently, you may need to look into why your tablets are migrating so often or check for disk health issues on the BEs.
References
• administration/management/resource_management/Replica.mdhc
03/16/2026, 12:44 PMRocky
03/16/2026, 12:44 PMstorage_root_path in be.conf) to parallelize I/O across volumes.
* Mount Options: Ensure you use noatime in your mount settings to reduce unnecessary write operations.
Summary Table for gp3
Workload Level | IOPS | Throughput
Development/Testing | 3,000 (Baseline) | 125 MB/s (Baseline)
Standard Production | 5,000 - 8,000 | 250 MB/s
High Performance | 10,000 - 16,000 | 500 MB/s - 1,000 MB/s
Rocky's Tip: Always monitor the be_bytes_read_per_second and be_bytes_written_per_second metrics to see if your workload is hitting the EBS limits. If you see high "Disk Utility" or "I/O Wait" in your monitoring, consider scaling up the gp3 throughput first, as it is often more cost-effective than adding more IOPS.
References
• faq/operation_maintenance_faq.md
• knowledge/usage/load/shared_data_batch_ingestion.md
• faq/Others.md
• knowledge/usage/best-practice.md
• quick_start/routine-load.md
• deployment/deployment_prerequisites.mdhc
03/16/2026, 12:52 PMbe_bytes_read_per_second?Rocky
03/16/2026, 12:52 PMbe_bytes_written_per_second and be_bytes_read_per_second metrics in StarRocks, you can use the following methods:
1. Directly from the BE Metrics Endpoint
Each Backend (BE) node exposes a metrics endpoint in Prometheus format. You can access it via a web browser or `curl`:
bash
curl http://<BE_IP>:<BE_HTTP_PORT>/metrics | grep be_bytes_
* Default BE HTTP Port: 8040
* Metrics:
* `starrocks_be_be_bytes_read_per_second`: The current read speed of the BE (Bytes/s).
* `starrocks_be_be_bytes_written_per_second`: The current write speed of the BE (Bytes/s).
2. Using Prometheus/Grafana
If you have monitoring set up (highly recommended for production), these metrics are typically collected by Prometheus.
* Prometheus Query: Simply search for starrocks_be_be_bytes_read_per_second or starrocks_be_be_bytes_written_per_second in the Prometheus UI.
* Grafana: These metrics are usually included in the standard StarRocks BE dashboard under the I/O or Throughput sections.
3. Configuration Requirement
For these specific "per second" metrics to be calculated and reported accurately, ensure the following BE configuration is enabled (it is true by default):
* enable_metric_calculator: When set to true, the BE launches a background thread to compute derived metrics like bytes/sec every 15 seconds.
Summary of the Metrics:
Metric Name | Unit | Description
be_bytes_read_per_second | Bytes/s | Average read speed of the BE node.
be_bytes_written_per_second | Bytes/s | Average write speed of the BE node.
References
• administration/management/monitoring/metrics.md
• administration/management/BE_configuration.mdhc
03/16/2026, 1:55 PMRocky
03/16/2026, 1:55 PMcd <be_dir>/bin && ./stop_be.sh
* FE: cd <fe_dir>/bin && ./stop_fe.sh
──────────
2. Rolling Upgrade Sequence
If you are turning off nodes one by one to upgrade them (Rolling Upgrade), the sequence is specific to ensure cluster availability:
1. Stop and Upgrade BE/CN nodes first: Upgrade these one by one. StarRocks is designed so that newer BEs/CNs are backward compatible with older FEs.
2. Stop and Upgrade FE nodes last:
* Upgrade Follower FE nodes one by one.
* Upgrade the Leader FE node last (stopping the Leader will trigger a new leader election among the already upgraded followers).
──────────
3. Graceful Exit (Recommended for v3.3+)
Starting from v3.3, StarRocks supports a Graceful Exit mechanism which minimizes impact on running queries. Use the -g flag to initiate this:
* FE Graceful Exit:
bash
./stop_fe.sh -g --timeout 60
This allows the FE to finish existing sessions and tells Load Balancers to stop routing traffic to it.
* BE/CN Graceful Exit:
bash
./stop_be.sh -g --timeout 600
The BE will mark itself as "exiting," reject new query fragments, and wait for in-flight tasks to complete before shutting down.
Summary of Order
* Shutdown: BEs $\rightarrow$ FEs.
* Startup: FEs $\rightarrow$ BEs.
* Upgrade: BEs $\rightarrow$ FEs (Followers first, then Leader).
References
• deployment/upgrade.md
• deployment/downgrade.mdhc
03/16/2026, 1:58 PMRocky
03/16/2026, 1:59 PMbash
# On each FE node
cd fe/bin/
./start_fe.sh --daemon
* Verification: Log in to the leader FE (via a MySQL client) and check the FE status.
sql
SHOW PROC '/frontends'\G
Ensure that one FE has the Role of LEADER and that the Alive status is true for the others.
2. Start BE/CN Nodes
Once the FE leader is elected and the metadata is ready, you can start the data nodes.
* Action: Run the start script on all BE/CN nodes.
bash
# On each BE node
cd be/bin/
./start_be.sh --daemon
# On each CN node (if applicable)
cd cn/bin/
./start_cn.sh --daemon
* Verification: From your MySQL client, verify that the nodes are connected and active.
sql
SHOW PROC '/backends'\G
-- Or for CN nodes:
SHOW PROC '/compute_nodes'\G
Confirm that the Alive column shows true for all nodes.
Important Notes:
* Metadata Consistency: You do not need to use the --helper flag when restarting an existing cluster. That flag is only used when adding a new node to the cluster for the first time.
* BDBJE Election: In a multi-FE high-availability (HA) setup, FE nodes use BDBJE to elect a leader. If you start the FE nodes one by one, the cluster will not be "Ready" until a quorum (the majority) of FOLLOWER nodes are up and a LEADER is elected.
* BE Heartbeats: If you start BE nodes before the FEs are ready, the BEs will simply log heartbeat failures and continue to retry until the FEs become available.
References
• administration/stargo.md
• administration/management/graceful_exit.md
• deployment/deploy_manually.mdhc
03/17/2026, 12:07 PMRocky
03/17/2026, 12:07 PM-Xmx parameter in fe/conf/fe.conf.
* For machines with < 32GB RAM: Set -Xmx to ~70% of total RAM.
* For machines with > 32GB RAM: Set -Xmx to ~80% of total RAM.
* Restart FE: A restart provides temporary relief by clearing the heap, but the usage may climb back up if the root cause isn't addressed.
2. Diagnostic Tools & Monitoring
To understand what is occupying the heap, use the following tools:
A. Memory Profiles (v3.3.6 and later)
StarRocks automatically generates memory allocation profiles.
* Location: Check fe/log/proc_profile/.
* Analysis: Look for .tgz files containing HTML flame graphs. These graphs show which functions or modules are allocating the most memory. A wide bar indicates a high allocation hotspot.
B. Memory Usage Tracker (v3.3.7 and later)
StarRocks tracks memory per module and logs it periodically.
* Usage: Search for "Memory Usage Tracker" in fe.log. Compare historical logs to see if a specific module's memory usage is continuously growing, which indicates a memory leak.
C. JVM Statistics
Use standard JDK tools to check real-time heap usage:
bash
# Check GC statistics (O column represents Old Gen percentage)
jstat -gcutil <fe_pid> 1000 1000
# Identify top objects in the heap (lightweight)
jmap -histo <fe_pid> | head -n 20
3. Common Causes & Solutions
Identify the pattern of memory growth to apply the correct fix:
Scenario A: Memory usage grows during Metadata Checkpoints
Checkpointing can consume significant memory as FE loads and saves images.
* Optimization: In v3.4.0+, enable checkpoint offloading to Follower nodes to reduce the Leader FE's memory load.
* Optimization: In v3.3.3+, StarRocks uses "Image streaming read" to reduce the peak memory required when reading metadata images.
Scenario B: High tablet count or frequent reporting
If your cluster has a very large number of tablets, the tablet report queue can grow.
* Fix: Upgrade to v3.5.0+, where the FE Leader actively pulls reports from BEs based on its processing capacity, preventing memory bloat in the report queue.
Scenario C: Heavy Metadata or Query Planning
* Query Planning: Very complex SQL queries or large IN clauses can spike FE memory. In recent versions, check the QueryFEAllocatedMemory metric to identify memory-heavy queries.
* Catalog Metadata: If you have many external catalogs (e.g., Hive, Iceberg), metadata caching might consume heap. Check configuration related to metadata cache expiration.
4. Configuration Tuning
Ensure these settings are optimized in `fe.conf`:
* MALLOC_ARENA_MAX=1: Add this to your environment variables or fe.conf to prevent excessive virtual memory fragmentation (this helps with off-heap memory but is a standard best practice for FE).
* proc_profile_mem_enable: Ensure this is true (default in v3.2.12+) to capture the diagnostic profiles mentioned above.
If the heap usage remains high after these checks, it is recommended to collect a heap dump for deep analysis using jmap -dump:live,format=b,file=fe_heap.hprof <pid>. Note: Taking a heap dump will pause the FE process; do this during a maintenance window or on a non-leader node.
References
• faq/fe_mem_faq.md
• knowledge/trouble_shooting/fe_memory_problems.md
• administration/Meta_recovery.md
• administration/management/monitoring/alert.mdRocky
03/17/2026, 12:07 PMhc
03/18/2026, 12:35 PMRocky
03/18/2026, 12:35 PMquery_mem_limit to set the maximum memory a single query can use on each BE node.
sql
SET query_mem_limit = 8589934592; -- 8GB
* Resource Group Limit: Define a percentage of total memory for a group of queries using the mem_limit property in a Resource Group.
sql
CREATE RESOURCE GROUP big_queries
WITH ("mem_limit" = "0.5"); -- Limits this group to 50% of BE memory
CPU Limits
* CPU Cores: In a Resource Group, you can limit the number of CPU cores available.
sql
CREATE RESOURCE GROUP analytical_rg
WITH ("max_cpu_cores" = "10");
* CPU Usage Threshold: Use query_queue_cpu_used_permille_limit to queue queries if the BE's total CPU usage exceeds a certain permille (e.g., 800 for 80%).
Query Timeout
* Limit the maximum execution time of a query to prevent long-running processes from hanging.
sql
SET query_timeout = 60; -- 60 seconds
──────────
2. Limit by How Many Times a Query Runs (Concurrency)
StarRocks manages "how many times a query runs" primarily through concurrency control rather than a fixed daily "quota" count.
Concurrency Limit (Resource Groups)
You can restrict how many queries in a specific group can run at the same time. If the limit is exceeded, new queries will either fail or enter a queue.
sql
ALTER RESOURCE GROUP dev_group
WITH ("concurrency_limit" = 10); -- Only 10 queries from this group can run simultaneously
Global Query Queuing
You can set a global threshold for concurrent queries across the entire cluster. When the limit is reached, StarRocks places new queries in a queue instead of failing them.
sql
SET GLOBAL query_queue_concurrency_limit = 100;
User Connection Limits
To limit the number of simultaneous connections a specific user can have:
sql
ALTER USER 'jack' SET PROPERTIES ("max_user_connections" = "50");
──────────
3. Automatic "Spill to Disk" (Handling Resource Overload)
If you want to prevent queries from failing when they hit memory limits, you can enable Spill to Disk. This allows memory-intensive operators (Sort, Aggregate, Join) to use disk space when memory is scarce.
sql
SET enable_spill = true;
SET spill_mode = "auto";
Summary Table
Goal | Parameter / Feature | Level
Memory Limit | query_mem_limit / mem_limit | Session / Resource Group
CPU Limit | max_cpu_cores | Resource Group
Concurrency | concurrency_limit | Resource Group / Query Queue
Time Limit | query_timeout | Session / Global
Connections | max_user_connections | User Property
Note: For the most robust control, it is recommended to use Resource Groups to classify queries (e.g., by user or database) and apply these limits collectively.
References
• administration/management/resource_management/spill_to_disk.md
• administration/management/BE_configuration.md
• sql-reference/System_variable.md
• administration/management/resource_management/resource_group.md
• knowledge/usage/best-practice.mdhc
03/18/2026, 1:26 PMquery_queue_concurrency_limit
query_queue_mem_used_pct_limit
query_queue_cpu_used_permille_limitRocky
03/18/2026, 1:26 PMquery_queue_concurrency_limit
Recommended Value: 16 to 32
* Logic: This variable limits the number of concurrent queries running on a single BE. For a 16 vCPU machine, setting this to 16 (1 query per vCPU) is conservative and ensures high predictability. If your queries are very short or have low complexity, you can increase this to 32.
* Setting: SET GLOBAL query_queue_concurrency_limit = 16;
2. query_queue_mem_used_pct_limit
Recommended Value: 0.8 (80%)
* Logic: This is the threshold for memory usage percentage on the BE. Since your BE has 64GB of RAM, StarRocks' default mem_limit is usually 90% (~57GB). By setting the queue limit to 0.8 (80%), you ensure that once the BE reaches ~51GB of memory usage, new queries will wait in the queue rather than pushing the process toward a crash or triggering the expensive Linux OOM killer.
* Setting: SET GLOBAL query_queue_mem_used_pct_limit = 0.8;
3. query_queue_cpu_used_permille_limit
Recommended Value: 800 (80%)
* Logic: This is measured in "permille" (parts per thousand). A value of 800 means 80% CPU utilization. Capping query initiation at 80% CPU ensures there is always 20% headroom (roughly 3-4 vCPUs in your case) for background system tasks like Compaction, Tablet Reports, and Metadata management, which are critical for cluster stability.
* Setting: SET GLOBAL query_queue_cpu_used_permille_limit = 800;
──────────
How to apply these:
You can set these globally using the following SQL command:
sql
-- Apply to the whole cluster
SET GLOBAL query_queue_concurrency_limit = 16;
SET GLOBAL query_queue_mem_used_pct_limit = 0.8;
SET GLOBAL query_queue_cpu_used_permille_limit = 800;
Additional Tips for Limited Resources:
* Check Queue Size: By default, the maximum number of queries that can wait in the queue is 1024 (query_queue_max_queued_queries). For a small 16 vCPU node, you might want to lower this to 100 so that users get an immediate "Too many queries" error rather than waiting indefinitely.
* Timeout: Use query_queue_pending_timeout_second (default 300s) to control how long a query stays in the queue before failing. On small systems, 30s to 60s is often more user-friendly.
References
• administration/management/resource_management/query_queues.md
• faq/resource_isolation_faq.md
• sql-reference/System_variable.md
• administration/management/FE_configuration.mdhc
03/18/2026, 1:39 PMmem_limit = 90%
query_mem_limit = 8589934592 #8GB
query_timeout = 60Rocky
03/18/2026, 1:39 PMmem_limit = 90% (BE Configuration)
* Location: This belongs in your be.conf file.
* Analysis: For a 64GB machine, this sets the BE process limit to approximately 57.6GB. This is the standard default and is appropriate for a dedicated BE node.
* Caution: If you are running other memory-intensive processes (like an FE or a database) on the same machine, you should lower this to 60% or 70% to avoid OS-level OOM (Out of Memory) kills.
2. query_mem_limit = 8589934592 (8GB)
* Location: This is a Session Variable, not a be.conf setting. You set it via SQL: SET GLOBAL query_mem_limit = 8589934592;.
* Analysis: This limits a single query to 8GB of RAM per BE node.
* Pros: It protects your cluster from a single "runaway" query consuming all 57.6GB of available BE memory.
* Cons: If you have complex queries (large joins or aggregations), 8GB might be too restrictive, causing queries to fail with "Memory limit exceeded."
* Concurrency: With 57.6GB total and an 8GB limit, you could theoretically run about 7 such memory-heavy queries simultaneously.
3. query_timeout = 60 (60 Seconds)
* Location: This is also a Session Variable: SET GLOBAL query_timeout = 60;.
* Analysis: The default is 300 seconds (5 minutes).
* Pros: Useful for ensuring no single query hangs the system for too long.
* Cons: 60 seconds is quite short for complex analytical workloads. On a 16 vCPU machine, if you are processing large datasets, some valid queries might naturally take longer than a minute. You may find yourself frequently hitting this timeout.
──────────
Recommended Adjustments for your Resources:
To optimize your 16 vCPU / 64GB RAM environment, I recommend also checking these settings:
1. Parallelism: Since you have 16 vCPUs, set the parallelism to utilize them effectively.
sql
-- Set to half or equal to the number of vCPUs
SET GLOBAL parallel_fragment_exec_instance_num = 8;
2. Pipeline Engine: Ensure the pipeline engine is enabled (it is by default in recent versions) to better manage the 16 cores.
sql
SET GLOBAL enable_pipeline_engine = true;
3. Memory Management: If you find 8GB is too small for your queries, you can increase it dynamically for a specific session:
sql
SET query_mem_limit = 16106127360; -- Increase to 15GB for current session
Summary: Your proposed settings will work and will make the system very "safe" from heavy queries, but you might need to relax the query_timeout to 300 and potentially increase query_mem_limit if your queries start failing due to memory constraints.
References
• administration/management/resource_management/Memory_management.md
• sql-reference/System_variable.md
• administration/management/resource_management/Query_management.mdhc
03/18/2026, 1:49 PMenable_spill = true
spill_mode = auto
mem_limit = 90%
report_resource_usage_interval_ms = 500
enable_query_queue_select = true
enable_query_queue_statistic = true
query_queue_concurrency_limit = 16
query_queue_mem_used_pct_limit = 0.8
query_queue_cpu_used_permille_limit = 800 #80%
query_queue_max_queued_queries = 100
query_queue_pending_timeout_second = 30
parallel_fragment_exec_instance_num = 8
enable_pipeline_engine = trueRocky
03/18/2026, 1:50 PMbe.conf). Putting System Variables in be.conf will have no effect.
1. Classification of Variables
Variable | Where to set it | Validity/Notes
mem_limit | be.conf | Valid. Default is 90%.
report_resource_usage_interval_ms | be.conf | Valid. Default is 1000ms.
enable_spill | SQL SET GLOBAL | System Variable.
spill_mode | SQL SET GLOBAL | System Variable.
enable_query_queue_select | SQL SET GLOBAL | System Variable.
enable_query_queue_statistic | SQL SET GLOBAL | System Variable.
query_queue_concurrency_limit | SQL SET GLOBAL | System Variable.
query_queue_mem_used_pct_limit | SQL SET GLOBAL | System Variable.
query_queue_cpu_used_permille_limit | SQL SET GLOBAL | System Variable.
query_queue_max_queued_queries | SQL SET GLOBAL | System Variable.
query_queue_pending_timeout_second | SQL SET GLOBAL | System Variable.
parallel_fragment_exec_instance_num | SQL SET GLOBAL | System Variable.
enable_pipeline_engine | SQL SET GLOBAL | System Variable. (True by default in v3.0+)
──────────
2. Is this configuration fit for your environment?
Yes, this is a very sensible and protective configuration for a 16 vCPU / 64GB RAM environment. Here’s why:
* Memory Safety (enable_spill = true): With only 64GB of RAM, large aggregations or joins could easily trigger Out Of Memory (OOM) errors. Enabling spilling to disk is highly recommended for stability in resource-constrained environments.
* Query Queuing: Your queuing thresholds (concurrency_limit = 16, mem_used_pct_limit = 0.8, cpu_used_permille_limit = 800) are well-tuned.
* Limiting concurrency to the number of vCPUs (16) prevents excessive context switching.
* The 80% RAM/CPU triggers provide a safety buffer before the BE becomes unresponsive.
* Reporting Frequency (report_resource_usage_interval_ms = 500): Reducing this from 1000ms to 500ms makes the query queue more "real-time," allowing the FE to react faster to resource spikes on the BE.
* Parallelism (parallel_fragment_exec_instance_num = 8): Setting this to half your CPU cores is a standard conservative practice that balances performance and resource consumption.
──────────
3. Recommended Actions
To apply these correctly, follow these two steps:
Step A: Update be.conf
Only keep these in your be.conf and restart the BE:
properties
mem_limit = 90%
report_resource_usage_interval_ms = 500
_Note: If your FE is running on the same machine as the BE, I recommend lowering mem_limit to 80% to leave room for the FE process._
Step B: Execute SQL Commands
Run these via your MySQL client to set the global variables:
sql
SET GLOBAL enable_spill = true;
SET GLOBAL spill_mode = 'auto';
SET GLOBAL enable_query_queue_select = true;
SET GLOBAL enable_query_queue_statistic = true;
SET GLOBAL query_queue_concurrency_limit = 16;
SET GLOBAL query_queue_mem_used_pct_limit = 0.8;
SET GLOBAL query_queue_cpu_used_permille_limit = 800;
SET GLOBAL query_queue_max_queued_queries = 100;
SET GLOBAL query_queue_pending_timeout_second = 30;
SET GLOBAL parallel_fragment_exec_instance_num = 8;
-- enable_pipeline_engine is likely already true, but you can set it:
SET GLOBAL enable_pipeline_engine = true;
Let me know if you need help tuning any other parameters!
References
• administration/management/resource_management/query_queues.md
• sql-reference/System_variable.mdRocky
03/18/2026, 1:50 PMhc
03/18/2026, 6:14 PMmem_limit = 90%
report_resource_usage_interval_ms = 500
SET GLOBAL enable_spill = true;
SET GLOBAL spill_mode = 'auto';
SET GLOBAL enable_query_queue_select = true;
SET GLOBAL enable_query_queue_statistic = true;
SET GLOBAL query_queue_concurrency_limit = 8;
SET GLOBAL query_queue_mem_used_pct_limit = 0.8;
SET GLOBAL query_queue_cpu_used_permille_limit = 800;
SET GLOBAL query_queue_max_queued_queries = 100;
SET GLOBAL query_queue_pending_timeout_second = 30;
SET GLOBAL parallel_fragment_exec_instance_num = 4;
SET GLOBAL enable_pipeline_engine = true;Rocky
03/18/2026, 6:14 PMmem_limit = 90%)
* Assessment: On a 32GB node, 90% leaves approximately 3.2GB for the OS and other processes.
* Recommendation: If these nodes are strictly dedicated to StarRocks BEs, 90% is fine. However, if you see the OS OOM-killing the BE process, drop this to 80% to provide a larger safety buffer for the operating system and page cache.
2. Query Queuing Settings
Your queuing settings are proactive, which is excellent for a node with limited RAM.
* query_queue_concurrency_limit = 8: This matches your vCPU count. This is a "safe" conservative limit. StarRocks can often handle 1.5x to 2x the core count in concurrency, but starting at 8 is wise for 32GB RAM to prevent context switching and memory contention.
* query_queue_mem_used_pct_limit = 0.8: This triggers queuing when query memory hits ~23GB ($32GB \times 0.9 \times 0.8$). This is a solid threshold.
* report_resource_usage_interval_ms = 500: This makes the queue more responsive to rapid changes in load. It is a good choice for small clusters.
3. Parallelism and Pipeline Engine
* parallel_fragment_exec_instance_num = 4:
* Recommendation: Since you have enable_pipeline_engine = true, you should prefer using pipeline_dop instead.
* In modern StarRocks versions (3.x+), pipeline_dop defaults to 0, which means StarRocks will automatically set it (usually to half the CPU cores).
* For your 8 vCPU node, a pipeline_dop of 4 or 8 is appropriate. I recommend removing parallel_fragment_exec_instance_num and letting the system auto-calculate or setting SET GLOBAL pipeline_dop = 4;.
* enable_pipeline_engine = true: This is the correct choice and is actually the default in recent versions.
4. Spilling (enable_spill = true)
* Assessment: Highly recommended for 32GB nodes.
* Requirement: Ensure your BEs have a designated spill directory with enough disk space (configured via spill_local_storage_path in be.conf). Without enough disk space, spilling will fail and the query will still OOM.
Suggested Refined Configuration
I recommend replacing the parallelism variable and adding a per-query memory limit to prevent a single large query from hogging the entire 23GB before the queue kicks in:
sql
-- BE Config (be.conf)
mem_limit = 90%
report_resource_usage_interval_ms = 500
-- Global Variables
SET GLOBAL enable_spill = true;
SET GLOBAL spill_mode = 'auto';
SET GLOBAL enable_query_queue_select = true;
SET GLOBAL enable_query_queue_statistic = true;
SET GLOBAL query_queue_concurrency_limit = 8;
SET GLOBAL query_queue_mem_used_pct_limit = 0.8;
SET GLOBAL query_queue_cpu_used_permille_limit = 800;
SET GLOBAL query_queue_max_queued_queries = 100;
SET GLOBAL query_queue_pending_timeout_second = 30;
-- Use pipeline_dop instead for the pipeline engine
SET GLOBAL pipeline_dop = 4;
-- Optional: Prevent a single query from taking more than 16GB
SET GLOBAL query_mem_limit = 17179869184;
Summary for your 8vCPU/32GB environment:
* Pros: Very stable; prevents OOMs through spilling and queuing.
* Cons: Low concurrency limit (8) might result in queries queuing during peak hours. If you find the CPU is underutilized, you can gradually increase query_queue_concurrency_limit to 12 or 16.
References
• administration/management/resource_management/Memory_management.md
• administration/management/resource_management/query_queues.mdRocky
03/18/2026, 6:14 PMhc
03/18/2026, 6:22 PM# Prod
mem_limit = 90%
report_resource_usage_interval_ms = 500
SET GLOBAL enable_spill = true;
SET GLOBAL spill_mode = 'auto';
SET GLOBAL enable_query_queue_select = true;
SET GLOBAL enable_query_queue_statistic = true;
SET GLOBAL query_queue_concurrency_limit = 16;
SET GLOBAL query_queue_mem_used_pct_limit = 0.8;
SET GLOBAL query_queue_cpu_used_permille_limit = 800;
SET GLOBAL query_queue_max_queued_queries = 100;
SET GLOBAL query_queue_pending_timeout_second = 30;
SET GLOBAL parallel_fragment_exec_instance_num = 8;
SET GLOBAL enable_pipeline_engine = true;Rocky
03/18/2026, 6:22 PMmem_limit = 90%: Perfect for dedicated BE nodes. It allows StarRocks to utilize most of the RAM while leaving a small buffer for the OS.
* report_resource_usage_interval_ms = 500: This is a good move. Reducing this from the default (1000ms) to 500ms makes the FE aware of resource changes faster, which makes your Query Queue much more responsive and accurate.
2. Spilling (Global Variables)
* enable_spill = true and spill_mode = 'auto': Highly recommended for production. This prevents large, memory-intensive queries (like massive joins or aggregations) from failing with OOM by offloading intermediate data to disk when memory is tight.
3. Query Queue (Global Variables)
These settings create a "safety net" to prevent the cluster from being overwhelmed:
* query_queue_concurrency_limit = 16: On a 16 vCPU machine, this allows 1 query per vCPU core. This is a conservative and safe starting point. If your queries are very short/small, you could eventually increase this to 32 or more, but 16 is great for stability.
* query_queue_mem_used_pct_limit = 0.8: This triggers the queue when BE memory hits 80%. Since your mem_limit is 90%, this gives you a 10% safety buffer before the BE starts killing queries.
* query_queue_cpu_used_permille_limit = 800: Triggers the queue when CPU hits 80%. This ensures the system remains responsive for management tasks.
4. Parallelism (Global Variables)
* parallel_fragment_exec_instance_num = 8: This is the traditional setting (half of vCPUs).
* Important Note: Since you have enable_pipeline_engine = true, StarRocks (v2.3+) primarily uses pipeline_dop to control parallelism.
* By default, pipeline_dop is 0, which means StarRocks automatically sets it to half of your CPU cores (which would be 8 in your case).
* If you are on a recent version (v3.x+), you don't strictly need to set parallel_fragment_exec_instance_num or pipeline_dop manually unless you want to override the "half-CPU" default.
Rocky's Recommendations:
1. Storage for Spilling: Ensure your BEs have sufficient and fast disk space (preferably SSD/NVMe) in the storage_root_path to handle the data when enable_spill kicks in.
2. Version Check: If you are on StarRocks v3.1.4 or higher, the query queue is managed more efficiently by the Leader FE. Your settings are perfectly compatible with this.
3. Monitor Pending Queries: Keep an eye on query_queue_pending_timeout_second = 30. If users complain about "Query waiting timeout", it means your concurrency limit (16) might be too tight for your workload, or queries are taking too long to finish.
Overall, this is a very safe and well-thought-out configuration for a 16-core production environment!
References
• sql-reference/System_variable.md
• knowledge/usage/best-practice.md
• faq/resource_isolation_faq.md
• best_practices/query_tuning/query_profile_operator_metrics.md
• administration/management/FE_configuration.md
• faq/Sql_faq.mdhc
03/20/2026, 4:25 PMRocky
03/20/2026, 4:26 PMState=EOF entries in your fe.audit.log is generally normal behavior and not an indication of an error. Here is a breakdown of what this state means and why you might see many of them:
1. What "State=EOF" Means
In the audit log, the state field indicates the final status of a query or connection:
* EOF: This stands for "End of File." In the MySQL protocol (which StarRocks uses for client connections), an EOF packet is sent to signal the successful completion of a command that returns a result set (such as SELECT, SHOW, or DESC).
* OK: This indicates the successful completion of a command that does not return a result set (such as INSERT, UPDATE, SET, or USE).
* ERR: This indicates that the query failed with an error.
Therefore, State=EOF simply means that a query was executed successfully and returned data to the client.
2. Common Causes for "Many" EOF Entries
If you notice an unusually high volume of EOF entries, it is typically caused by one of the following:
* Health Checks and Monitoring:
Load balancers (like F5, HAProxy, or Nginx) and monitoring tools (like Prometheus, Zabbix, or Grafana) often connect to StarRocks and run frequent "heartbeat" queries (e.g., SELECT 1) to verify the frontend (FE) is alive. Each of these successful checks will generate an EOF entry.
* High Frequency Queries:
Applications or scripts that frequently run short-lived queries (e.g., SHOW PROCESSLIST, SELECT 1) will populate the audit log with many EOF states.
* Connection Module Logging:
If you have enabled the connection module in your FE configuration (audit_log_modules), StarRocks logs every login and logout. In some versions or configurations, connection termination might be logged with an EOF state if the connection was closed gracefully.
3. How to Investigate
To understand where these entries are coming from, check the other fields in the audit log:
* stmt: Look at the SQL statement being executed. If it is SELECT 1 or a SHOW command, it is likely a health check or background monitoring.
* clientIp: Identify the IP address. If it belongs to a load balancer or a monitoring server, you have found the source.
* user: Check if a specific service account is running these queries.
Summary
State=EOF is a success indicator for queries that return rows. Unless you are seeing a performance impact or these entries are cluttering your logs excessively, they can be ignored as part of normal system operation. If you wish to reduce log volume, you can adjust the audit_log_modules or qe_slow_log_ms settings in your FE configuration.
References
• administration/management/logs.md
• administration/management/audit_loader.md
• administration/management/FE_configuration.md
• knowledge/usage/best-practice.mdhc
03/20/2026, 4:34 PMRocky
03/20/2026, 4:35 PMimage_checkpoint_offload_to_follower), which balances memory consumption across the cluster.
2. Tablet Report Processing
All Backend (BE) nodes periodically report the status of their tablets to the Leader FE only.
* Impact: The Leader maintains a queue to process these reports and performs a "diff" between the reported state and the metadata state. If you have a large number of tablets, this queue and the processing logic can consume several GBs of heap memory.
* Optimization: In v3.5.0, StarRocks improved this by having the Leader "pull" reports from BEs based on its own processing capacity rather than receiving them all at once, significantly reducing memory overhead.
3. Transaction and Load Management
The Leader FE coordinates all transactions and data loading (Stream Load, Broker Load, etc.). It maintains the state of active transactions and coordinating metadata, which Followers do not need to hold in the same detail.
4. Metadata Catalog Caching
The Leader FE is the "source of truth" and often maintains more aggressive caching for catalog metadata (especially when using External Catalogs like Hive or Iceberg) to speed up query planning.
──────────
How to Troubleshoot and Mitigate
If the high memory usage is causing instability (e.g., Full GC or crashes), follow these steps:
1. Check JVM Configuration:
Ensure your fe.conf has a proper heap size (-Xmx). For machines with >32GB RAM, set -Xmx to roughly 80% of total memory. Also, add this environment variable to fe.conf to prevent glibc memory fragmentation:
bash
MALLOC_ARENA_MAX=1
2. Identify the Memory Consumer:
Use the built-in memory tracker to see which module is using the most space. Run this in your MySQL client:
sql
ADMIN SHOW FRONTEND MEMORY; -- Available in newer versions
Or check the fe/log/fe.audit.log and fe/log/fe.log for memory-related warnings.
3. Analyze Memory Profiles:
From v3.3.6 onwards, StarRocks automatically generates memory profiles in fe/log/proc_profile. You can find .tgz files there containing flame graphs that show exactly which Java objects are occupying the heap.
4. Force a GC (Diagnostic only):
If you want to see if the memory is "real" usage or just garbage waiting to be collected, you can manually trigger a GC:
bash
jcmd <fe_pid> GC.run
Recommendation: If you are on an older version (e.g., 2.x or early 3.x), upgrading to v3.3.3+ or v3.4.0 is highly recommended as it contains numerous fixes for FE metadata memory management and the "Image streaming read" optimization.
References
• knowledge/trouble_shooting/fe_memory_problems.md
• faq/Deploy_faq.md
• faq/fe_mem_faq.md
• faq/operation_maintenance_faq.md
• deployment/deploy_manually.md
• administration/Meta_recovery.mdhc
03/20/2026, 4:53 PMfe/log/proc_profileRocky
03/20/2026, 4:54 PMhtml.tar.gz files located in fe/log/proc_profile, you have two main options: using the StarRocks Web UI (recommended) or manual extraction.
Method 1: StarRocks Web UI (Recommended)
StarRocks provides a built-in way to visualize these profiles as interactive Flame Graphs without manual extraction.
1. Open your browser and go to the StarRocks FE Web UI (default URL: http://<FE_IP>:8030).
2. Log in (default user is root with no password, unless configured otherwise).
3. Click on the proc profiles tab in the top navigation bar.
4. Select the FE tab.
5. You will see a list of collected profiles (CPU or Memory). Click the View link next to the desired entry.
* The system will automatically extract the .tar.gz file and render the Flame Graph directly in your browser.
Method 2: Manual Extraction
If you want to view the file offline or on another machine, you can extract it manually:
1. Locate the file in the terminal:
bash
cd /path/to/starrocks/fe/log/proc_profile
2. Extract the archive:
bash
tar -zxvf cpu-profile-20231027-100000.html.tar.gz
(Note: Replace the filename with your actual filename.)
3. Open the HTML file:
The extraction will produce an .html file. You can open this file in any modern web browser (Chrome, Firefox, etc.) to view the interactive Flame Graph.
Context
* What are these files? These are process-level profiles generated by AsyncProfiler (for FE). They capture Java stack traces to help diagnose CPU hotspots or memory allocation issues.
* Configuration: This feature is controlled by FE parameters like proc_profile_cpu_enable and proc_profile_mem_enable (available since v3.2.12).
* Retention: By default, these files are kept for 1 day or until the directory reaches 2GB, as controlled by proc_profile_file_retained_days and proc_profile_file_retained_size_bytes.
References
• administration/management/FE_configuration.md
• administration/management/proc_profile.md
• administration/management/logs.mdhc
03/20/2026, 4:56 PMRocky
03/20/2026, 4:57 PMfe.conf. By default, these are true, but you should verify them:
* `proc_profile_cpu_enable`: Enables automatic CPU profiling for FE.
* `proc_profile_mem_enable`: Enables automatic memory allocation profiling for FE.
If these are set to false, the collection won't happen, though the tab should generally still be visible in supported versions.
3. Difference between "proc profiles" and "queries"
Please ensure you are looking for the correct tool:
* queries tab: Used for Query Profiles (analyzing specific SQL execution performance).
* proc profiles tab: Used for Process Profiles (system-level diagnosis like CPU/Memory flame graphs for the FE/BE processes themselves).
How to use it (if on a supported version):
1. Access the Web UI at http://<fe_ip>:<fe_http_port> (default port is 8030).
2. Click the proc profiles tab in the top navigation bar.
3. You can then switch between the FE tab and various BE node tabs to view collected flame graphs.
Note for BE Profiles:
While FE profiles are collected automatically by an internal daemon, BE profiles often require running the collect_be_profile.sh script (found in the bin/ directory) to trigger or schedule the collection of data before they appear in the Web UI.
References
• administration/management/proc_profile.md
• administration/management/FE_configuration.md
• best_practices/query_tuning/query_profile_text_based_analysis.mdhc
03/20/2026, 5:02 PMfe/log/proc_profileRocky
03/20/2026, 5:02 PMhtml.tar.gz files in your fe/log/proc_profile directory, the background collection is working correctly.
If you cannot see the proc profiles tab in the FE Web UI, it is likely due to one of the following reasons:
1. You are not accessing the Leader FE
Many management and diagnostic tabs in the StarRocks Web UI are only visible or fully functional when accessing the Leader FE.
* Action: Check which FE is the leader using SHOW FRONTENDS; in your SQL client.
* Action: Ensure you are browsing the Web UI of that specific Leader FE (usually at http://<leader_fe_ip>:8030).
2. Permissions/Login Status
The proc profiles tab provides sensitive system-level information and is typically restricted to users with administrative privileges.
* Action: Ensure you are logged into the Web UI as the root or admin user.
3. Check for the Tab Location
In recent versions, the Web UI layout may have changed.
* Look for a top-level tab labeled proc profiles.
* If you don't see it, check if it's nested under a System or Nodes menu.
* Direct URL: You can attempt to access the page directly by appending /proc_profile to your FE Web UI URL, for example: http://<fe_ip>:8030/proc_profile.
4. Browser Cache or UI Version
Sometimes the browser may cache an older version of the Web UI.
* Action: Try a hard refresh (Ctrl + F5 or Cmd + Shift + R) or open the Web UI in an Incognito/Private window.
Why the files exist but the tab might be missing
The html.tar.gz files are generated by a background daemon (ProcProfileCollector). The configuration parameters proc_profile_cpu_enable and proc_profile_mem_enable control this collection and are true by default. The existence of these files proves the "backend" of this feature is active; the "frontend" (the Web UI tab) simply needs to be accessed via the correct node and user.
Summary of FE configuration related to this (in fe.conf):
* `proc_profile_cpu_enable`: Defaults to true.
* `proc_profile_mem_enable`: Defaults to true.
* `proc_profile_collect_time_s`: Duration of sampling (default 120s).
If you are on the Leader FE and logged in as admin but still cannot see the tab, verify if there are any errors in the fe.log related to the ProcProfileCollector.
References
• administration/management/proc_profile.md
• administration/management/FE_configuration.mdhc
03/20/2026, 5:09 PMfe/log/proc_profile It is the leader FE Web UI that is being accessed, using the admin userRocky
03/20/2026, 5:09 PMhtml.tar.gz files in fe/log/proc_profile, it confirms that the background collection is working correctly.
If the tab is missing from the Web UI while you are accessing the Leader FE as an admin user, please check the following:
1. Verify Leader Status
Even if you are accessing a specific IP, ensure it is the current leader. Only the Leader FE provides the full management interface for profiles.
* Run SHOW FRONTENDS; in your SQL client.
* Check the IsMaster column to confirm the IP you are accessing is indeed the Leader.
2. UI Navigation
In version 3.5.x, the Web UI has been updated. The "proc profiles" tab is typically located at the top-level navigation bar. If you don't see it:
* Try accessing the path directly: http://<FE_IP>:<FE_HTTP_PORT>/#/proc_profile
* Ensure you are using the "New UI" (StarRocks 3.0+ defaults to a modern dashboard). If you are using an older bookmark or a specific path that leads to the "Old UI" (e.g., /home), the tab may not be present.
3. Check FE Configuration
While the collection parameters (proc_profile_cpu_enable, proc_profile_mem_enable) are true by default and clearly working (since files exist), verify if there are any restrictions.
* Ensure that no proxy or firewall is stripping out specific UI components or blocking the port (default 8030).
* Check if the admin user has the necessary permissions. Although admin should have everything, ensure you haven't restricted the NODE_PRIV or SYSTEM_PRIV.
4. Browser Cache
Since you recently upgraded or are using a newer version, the browser might be caching older Frontend assets.
* Try to Hard Refresh (Ctrl + F5 or Cmd + Shift + R) or open the Web UI in an Incognito/Private window to ensure the latest UI components are loaded.
5. Backend (BE) Profiles
Note that the "proc profiles" tab also allows viewing BE profiles. However, BE profiles are not collected automatically like FE profiles.
* To see BE entries in that tab, you must run the collection script on the BE nodes:
bash
# Example: Collect a 30-second CPU profile for a BE
./bin/collect_be_profile.sh --profiling-type cpu --duration 30
* Once collected, the BE profiles will appear in the same proc profiles tab under the BE sub-tab.
If the tab is still missing after a hard refresh on the confirmed Leader FE, check the FE log (fe.log) for any errors related to ProcProfileCollector or HttpServer that might indicate the UI component failed to initialize.
References
• administration/management/FE_configuration.md
• administration/management/proc_profile.mdhc
03/20/2026, 5:15 PMfe/log/proc_profile It is the leader FE Web UI that is being accessed, using the admin user. When trying to access the path http://<FE_IP>:<FE_HTTP_PORT>/proc_profile , this message showed
this is 404 page.Rocky
03/20/2026, 5:16 PMhc
03/23/2026, 12:22 PM2026-03-23 11:26:28.785Z ERROR (stats-cache-refresher-3|149) [ColumnBasicStatsCacheLoader.lambda$asyncLoadAll$1():123] com.starrocks.sql.analyzer.SemanticException: Getting analyzing error. Detail message: Statistics query fail | Error Message [INTERNAL_ERROR]Rocky
03/23/2026, 12:22 PMColumnBasicStatsCacheLoader) attempts to fetch this data from the internal _statistics_ database and the query fails, it throws a SemanticException.
The INTERNAL_ERROR suggests that the internal query executed by the FE encountered a failure at the execution level.
Common Reasons for this Error
1. Unhealthy _statistics_ Database:
StarRocks stores statistics in internal tables within the _statistics_ database. If the tablets for these tables (specifically column_statistics) are unhealthy or have insufficient replicas, the internal fetch query will fail.
* Check health: Run SHOW TABLET FROM _statistics_.column_statistics; or ADMIN SHOW REPLICA STATUS FROM _statistics_.column_statistics; to see if any tablets are offline.
2. Internal Query Timeout:
If your cluster has a massive number of columns and the column_statistics table has grown very large, the internal query used to refresh the cache might time out.
3. Backend (BE) Issues:
Since it is an INTERNAL_ERROR, the failure often happens on the BE side during query execution.
* Check the <http://be.INFO|be.INFO> or be.WARNING logs on your backends around the same timestamp (2026-03-23 11:26:28) for errors like process query failed or memory-related issues.
4. Metadata Inconsistency:
In rare cases, especially after upgrades or improper manual deletions in the _statistics_ database, the metadata in the stats tables might become inconsistent with the current cluster state.
5. Concurrent Analyze Jobs:
Heavy concurrent ANALYZE tasks or massive data loading can sometimes cause contention or resource exhaustion that impacts the stability of internal statistics queries.
Recommended Troubleshooting Steps
1. Check fe.internal.log:
StarRocks maintains a specific log for internal operations. Check fe.internal.log for the specific internal SQL statement that failed and the detailed stack trace. This will often show the exact SQL being run (e.g., SELECT ... FROM _statistics_.column_statistics).
2. Verify Statistics Table Health:
Run the following to ensure the statistics database is functional:
sql
-- Check if the table is accessible
SELECT count(*) FROM _statistics_.column_statistics;
-- Check replica status
ADMIN SHOW REPLICA STATUS FROM _statistics_.column_statistics WHERE State != 'OK';
3. Manual Statistics Refresh:
If the error is isolated to a specific table, try manually re-collecting statistics to fix potential data corruption in the cache:
sql
ANALYZE TABLE <your_db>.<your_table>;
4. Cleanup Old Statistics:
If the _statistics_ tables have grown excessively large, you can try to truncate or delete old entries, although it is usually safer to let the system manage them or use DROP STATS.
5. Increase FE Memory:
If the fe.log shows OutOfMemoryError or GC issues, the statistics cache might be too large for the current FE JVM heap size. You may need to increase -Xmx in fe.conf.
References
• loading/loading_introduction/troubleshooting_loading.md
• using_starrocks/caching/block_cache.md
• data_source/data_cache_observe.md
• administration/management/monitoring/metrics.md
• faq/operation_maintenance_faq.md
• faq/loading/Loading_faq.mdhc
03/23/2026, 4:42 PMRocky
03/23/2026, 4:43 PMSHOW VARIABLES), using the SET GLOBAL command will automatically persist them after a restart.
* Persistence Mechanism: StarRocks stores global system variables in the Frontend (FE) metadata (using BDBJE/Edit Logs). When an FE restarts, it reloads these variables from its persistent metadata store.
* Command:
sql
SET GLOBAL variable_name = value;
* Note: SET GLOBAL only affects new sessions. To apply the change to existing long-lived connections without restarting them, you can use the REFRESH CONNECTIONS command (available in newer versions):
sql
REFRESH CONNECTIONS;
2. FE/BE Configuration Items (ADMIN SET CONFIG)
If you are using the ADMIN SET FRONTEND CONFIG or ADMIN SET BACKEND CONFIG commands to change cluster configurations (the ones you see in ADMIN SHOW FRONTEND CONFIG or SHOW BACKEND CONFIG), these do NOT persist across restarts by default.
* Behavior: These commands are used for dynamic configuration changes at runtime. However, when the service restarts, it will read the values from the fe.conf or be.conf files.
* How to Persist: Even if you feel they "cannot" be set in configuration files, the standard way to persist these is to add the corresponding key-value pair directly into the fe.conf or be.conf file on each node.
* Example for fe.conf:
properties
# Add this line to fe.conf to make it permanent
disable_balance = true
Summary Table
Type | Set Command | Persistent After Restart?
System Variables | SET GLOBAL ... | Yes (Stored in FE Metadata)
FE Config | ADMIN SET FRONTEND CONFIG ... | No (Must be added to fe.conf)
BE Config | ADMIN SET BACKEND CONFIG ... | No (Must be added to be.conf)
Rocky's Tip: If you're unsure which one you're dealing with, check SHOW VARIABLES. If your variable is listed there, simply running SET GLOBAL <var> = <val>; is enough to keep it through a restart!
References
• sql-reference/System_variable.md
• sql-reference/sql-statements/cluster-management/config_vars/SET.md
• faq/operation_maintenance_faq.md
• sql-reference/sql-statements/cluster-management/config_vars/ADMIN_SET_CONFIG.md
• deployment/post_deployment_setup.mdhc
03/23/2026, 4:49 PMRocky
03/23/2026, 4:50 PMquery_timeout, exec_mem_limit, or parallel_fragment_exec_instance_num) directly in the fe.conf or be.conf files.
Why?
1. Persistence: System variables set with SET GLOBAL are automatically persistent. They are stored in the Frontends' metadata (BDBJE), meaning they survive cluster restarts. Because they are already permanent once set globally, there is no need to define them in a configuration file.
2. Scope:
* Configuration Parameters (`fe.conf`/`be.conf`): These control the process-level behavior (e.g., port numbers, log paths, JVM heap size).
* System Variables (SET): These control the SQL execution engine's behavior and can be tuned at the Global, Session, or even Query level (via SET_VAR hints).
How to set "Defaults" permanently
If your goal is to ensure a specific variable is always set for all users without running SET GLOBAL every time the cluster is created, here are your options:
1. Run SET GLOBAL once:
sql
SET GLOBAL query_timeout = 300;
This change is recorded in the FE metadata and will remain in effect even after you restart the entire cluster.
2. Set Properties for Specific Users:
Starting from v3.3.3, you can set default session variables for specific users using `ALTER USER`:
sql
ALTER USER 'username' SET PROPERTIES ('session.query_timeout' = '600');
3. Exception (FE Configuration):
There are a few rare cases where an FE configuration parameter in fe.conf might influence a system variable (for example, mysql_server_version in fe.conf sets the value of the global version variable), but these are specific exceptions and not a general rule for all variables.
If you have a specific variable in mind that you're trying to configure, let me know and I can double-check if there's a specialized config for it!
References
• sql-reference/System_variable.md
• administration/management/FE_configuration.md
• sql-reference/sql-statements/cluster-management/config_vars/SET.md
• administration/management/BE_configuration.mdhc
03/24/2026, 4:57 PMcumulative_compaction_num_threads_per_disk = 4
base_compaction_num_threads_per_disk = 2
cumulative_compaction_check_interval_seconds = 2
update_compaction_num_threads_per_disk = 4
update_compaction_per_tablet_min_interval_seconds = 30Rocky
03/24/2026, 4:57 PMtablet_max_versions: Increase this from the default 1000 to 2000 or even 5000.
properties
# be.conf
tablet_max_versions = 2000
Note: Higher values may slightly increase query latency for some tables, but it prevents the "too many versions" write failure.
2. Refine Compaction Threads for 16 vCPU
Your current settings use _per_disk suffixes. If your BE has multiple disks (e.g., 4 disks), a setting of 4 threads per disk would result in 16 threads for cumulative compaction alone, which might saturate your 16 vCPUs and cause resource contention.
For a 16 vCPU environment, a better rule of thumb is to keep total compaction threads around 25%–50% of total CPU cores.
• If you have many disks, reduce the per-disk count:
properties
cumulative_compaction_num_threads_per_disk = 2
base_compaction_num_threads_per_disk = 1
• If you are on StarRocks 3.1+, it is recommended to use the Event-based Compaction Framework (enabled by default) and tune the global concurrency:
properties
# Total threads for all compaction types
compact_threads = 4
# Maximum concurrency
max_compaction_concurrency = 8
3. Primary Key Table Optimizations
Since you mentioned update_compaction_num_threads_per_disk, it implies you are using Primary Key tables. These tables use a different compaction mechanism.
• update_compaction_num_threads_per_disk: 4 is generally fine, but ensure the total doesn't exceed vCPU count.
• update_compaction_per_tablet_min_interval_seconds: You have it at 30. If you have a very high frequency of small updates to the same tablets, you can try decreasing this to 10 or 20 to trigger compaction more often, but monitor CPU usage.
4. Adjust Compaction Strategy
• cumulative_compaction_check_interval_seconds = 2: This is already very low (aggressive).
• max_cumulative_compaction_num_singleton_deltas: The default is 1000. You can try reducing this (e.g., to 100 or 200) to force the system to merge smaller batches of versions more frequently, which helps reduce the version count faster.
5. Best Practice: Batch Your Loads
The "too many versions" error is often a symptom of "small file syndrome."
• Increase Batch Size: Instead of many small loads every second, try to batch data so that you load every 5–10 seconds or wait until you have a larger MB/row count.
• Stream Load: If using Stream Load, ensure you aren't sending thousands of tiny requests per minute.
Summary of Recommended be.conf for your Specs:
properties
# Increase threshold to prevent immediate failure
tablet_max_versions = 2000
# For 16 vCPU, avoid over-saturating CPU if multiple disks exist
cumulative_compaction_num_threads_per_disk = 2
base_compaction_num_threads_per_disk = 1
update_compaction_num_threads_per_disk = 2
# For Primary Key tables: trigger more frequent merges if needed
update_compaction_per_tablet_min_interval_seconds = 20
# Memory safety for 64GB RAM
compaction_max_memory_limit_percent = 30
Monitoring Tip: Use SHOW PROC '/compactions'; to check the compaction score. If the MaxScore is consistently high, it means compaction is still lagging behind your ingestion rate.
References
• administration/management/BE_configuration.mdRocky
03/24/2026, 4:57 PMhc
03/24/2026, 5:03 PMcumulative_compaction_num_threads_per_disk = 4
base_compaction_num_threads_per_disk = 2
cumulative_compaction_check_interval_seconds = 2
update_compaction_num_threads_per_disk = 4
update_compaction_per_tablet_min_interval_seconds = 30Rocky
03/24/2026, 5:04 PMtablet_max_versions (Default: 1000)
* Action: Increase to 2000 or 3000.
* Where: be.conf (requires restart) or via ADMIN SET CONFIG.
2. Improve Compaction Efficiency (Reduce CPU Overhead)
Your current update_compaction_per_tablet_min_interval_seconds = 30 is very aggressive. This forces StarRocks to compact a tablet every 30 seconds if new data arrives. This creates many small compaction tasks, which have high CPU overhead relative to the amount of data merged.
* Action: Increase update_compaction_per_tablet_min_interval_seconds to 60 or 120.
* Effect: This allows more rowsets to accumulate before a compaction triggers. Merging 50 rowsets in one task is significantly more CPU-efficient than running 5 tasks to merge 10 rowsets each.
3. Rebalance Resource Allocation
On a 16-vCPU machine with 96% load, your current configuration allocates 10 threads (4 update + 4 cumulative + 2 base) to compaction. This is quite high for a 16-core system under heavy ETL.
Since you are using Primary Key tables, they primarily use the update_compaction threads. The cumulative and base threads are largely used for other table models (Duplicate/Unique/Aggregate).
* Action:
* Keep update_compaction_num_threads_per_disk = 4 (this is the 25% recommendation for your 16 cores).
* Reduce cumulative_compaction_num_threads_per_disk to 1 or 2.
* Reduce base_compaction_num_threads_per_disk to 1.
* Increase cumulative_compaction_check_interval_seconds to 5 or 10 (2 seconds is very frequent and adds unnecessary polling overhead).
4. Enable Size-Tiered Compaction
Ensure that the size-tiered strategy is enabled, as it is much more efficient for PK tables in high-write scenarios.
* Parameter: enable_pk_size_tiered_compaction_strategy = true (Default in newer versions, check your version).
5. Upstream Batching (The Root Cause)
The "too many versions" error is almost always caused by frequent, small writes. If you are using Stream Load or Routine Load:
* Routine Load: Increase max_routine_load_batch_size (e.g., to 512MB or 1GB) and routine_load_task_consume_second (e.g., to 15-30s).
* Stream Load: Ensure your client is batching data so that you aren't sending a commit every few seconds. Aim for commits every 10–30 seconds if possible.
Recommended be.conf Summary:
properties
# Increase threshold to prevent ingestion failure
tablet_max_versions = 2000
# Efficiency: Allow more data to accumulate to make each CPU cycle more productive
update_compaction_per_tablet_min_interval_seconds = 120
# Resource Rebalancing: Focus threads on PK compaction, reduce others to save CPU
update_compaction_num_threads_per_disk = 4
cumulative_compaction_num_threads_per_disk = 1
base_compaction_num_threads_per_disk = 1
# Reduce polling frequency
cumulative_compaction_check_interval_seconds = 5
Note: If CPU remains at 96% after these changes, you may need to scale horizontally (add more BE nodes) or vertically, as the current workload is at the physical limit of 16 vCPUs.
References
• best_practices/primarykey_table.md
• table_design/table_types/primary_key_table.mdhc
03/24/2026, 9:17 PMERROR 1064 (HY000): Backend node not found. Check if any backend node is down.backend: [10.10.10.10 alive: true inBlacklist: trueRocky
03/24/2026, 9:18 PM10.10.10.10 is technically alive (the heartbeat from the Frontend is successful), it has been placed on the Backend Blacklist.
Because the node is blacklisted, the Frontend (FE) excludes it from query execution to avoid potential failures, which leads to the "Backend node not found" error when the FE tries to schedule the query.
Why is the node blacklisted?
There are two ways a node ends up in the blacklist:
1. Automatic Blacklisting (AUTO): StarRocks automatically blacklists a BE if the FE detects frequent connection failures or query timeouts to that specific node. This is a self-healing mechanism to prevent a "gray failure" (a node that is up but not performing correctly) from impacting the whole cluster.
2. Manual Blacklisting (MANUAL): An administrator manually added the node to the blacklist using the ADD BACKEND BLACKLIST command.
How to troubleshoot and fix
1. Check the Blacklist Status
Run the following command to see why the node was blacklisted and whether it was an automatic or manual action:
sql
SHOW BACKEND BLACKLIST;
* AddBlackListType: AUTO means StarRocks detected issues; MANUAL means it was added by a user.
* LostConnectionNumberInPeriod: Shows how many connection failures were detected.
2. If the type is MANUAL
You must manually remove it from the blacklist to allow it to process queries again:
sql
-- Get the BackendId from 'SHOW BACKENDS'
DELETE BACKEND BLACKLIST <backend_id>;
3. If the type is AUTO
StarRocks will automatically remove the node from the blacklist once the connection becomes stable (it checks connectivity periodically). If it stays in the blacklist:
* Check Network: Ensure there are no firewall rules or intermittent network issues between the FE and BE.
* Check BE Health: Look at the BE's <http://be.INFO|be.INFO> logs for crashes, OOM (Out of Memory) issues, or long GC pauses.
* FE Configurations: The behavior is controlled by these FE parameters:
* `black_host_connect_failures_within_time`: Max allowed failures before blacklisting (default is 5).
* `black_host_history_sec`: How long to track failures (default is 3600s).
Summary
The FE is "protecting" your cluster by not sending work to a node it perceives as unreliable. Verify the network stability between your FE and the BE at 10.10.10.10.
References
• administration/management/BE_blacklist.md
• sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKEND_BLACKLIST.md
• sql-reference/sql-statements/cluster-management/nodes_processes/ADD_BACKEND_BLACKLIST.md
• sql-reference/sql-statements/cluster-management/nodes_processes/DELETE_BACKEND_BLACKLIST.md
• administration/management/FE_configuration.mdhc
03/26/2026, 10:33 PMFailed to compute statement digestRocky
03/26/2026, 10:33 PMFailed to compute statement digest is related to the SQL Digest feature introduced in StarRocks v3.3.6.
What it means
A SQL Digest is a fingerprint (hash) generated for SQL statements after removing specific parameters (like constants, IN list values, or LIMIT counts). This allows StarRocks to group similar queries together in the audit logs (fe.audit.log) for performance analysis.
When you see this error, it means the Front-End (FE) failed to normalize the current SQL statement into its "parameterless" form to generate that hash.
Potential Causes
1. Unsupported SQL Syntax: The normalization engine might encounter a complex or non-standard SQL construct that it doesn't yet know how to strip of parameters.
2. Configuration: This feature is controlled by the FE configuration enable_sql_digest. If it is set to true (it is often disabled by default or requires manual enablement in some versions), the FE will attempt to compute this for every query.
3. Large/Deeply Nested Queries: Very large or deeply nested queries might occasionally cause issues during the normalization phase.
Impact
In most cases, this error does not stop the query from executing. It typically results in:
* An error message logged in fe.log or fe.audit.log.
* The Digest field in your audit logs being empty or marked as failed for that specific query.
How to Resolve or Troubleshoot
* Check FE Logs: Look at fe.log for a stack trace following this error message. It will often reveal the specific SQL part that caused the failure.
* Verify Version: Ensure you are on v3.3.6 or later if you intend to use this feature.
* Disable the Feature: If the error is frequent and you do not need SQL Digesting for your audit analysis, you can disable it dynamically:
sql
ADMIN SET FRONTEND CONFIG ('enable_sql_digest' = 'false');
* Check for Fixes: If you are using a very early 3.3.x version, consider upgrading to the latest patch release (e.g., 3.3.8+), as improvements to the SQL normalizer are frequently added.
If you can provide the specific SQL query that triggered this, I can help identify if it's a known unsupported pattern!
References
• release_notes/release-2.3.md
• release_notes/release-2.2.md
• release_notes/release-3.1.md
• release_notes/release-2.0.md
• release_notes/release-2.1.md
• release_notes/release-2.5.mdhc
03/31/2026, 12:33 PMclose channel failed. channel_name=NodeChannel[10000], load_info=load_id=eea3628c-2cdf-11f1-bcf4-111111111111, txn_id: 11111111, parallel=1, compress_type=2, error_msg=10.10.10.10: PTabletWriterAddSegmentRequest tablet_id 1111111 not existsRocky
03/31/2026, 12:33 PMPTabletWriterAddSegmentRequest tablet_id 1111111 not exists typically occurs during a data loading process (such as Stream Load, Broker Load, or Routine Load). It indicates that the Backend (BE) node receiving the data segment was asked to write to a tablet ID that it does not currently have in its local metadata or memory.
Common Causes
1. Tablet Migration or Rebalancing:
While the load job was running, the Frontend (FE) may have decided to move the tablet from one BE to another (e.g., due to disk balance or node decommissioning). The load task, still using the old location info, fails when it tries to send data to the original BE.
2. Schema Change or Truncation:
If you performed an ALTER TABLE (like adding columns) or a TRUNCATE TABLE command while a load was in progress, the old tablets might have been deleted or replaced by new ones.
3. Replica Failure:
If the FE marked a replica on that specific BE as "bad" or "stale" (due to a previous disk error or version lag), it might have been scheduled for deletion or ignored, leading to this error if a load task still tried to reach it.
4. BE Restart or Metadata Inconsistency:
If a BE was recently restarted, there might be a brief window where the tablet metadata is being re-synced from the FE, or in rare cases, a discrepancy between the FE's view of tablet locations and the actual BE state.
How to Troubleshoot
1. Check Tablet Status:
Run the following SQL to see where the tablet is currently located and its status:
sql
SHOW TABLET 1111111;
* Check the BackendId and State columns.
* Verify if the IsSync column is true.
2. Check for Concurrent Operations:
Check if any ALTER TABLE, DROP, or TRUNCATE operations were performed on that table at the time of the error.
3. Check FE/BE Logs:
* FE logs (fe.log): Look for messages related to "tablet balancer," "migrate," or "clone" for that tablet ID.
* BE logs (<http://be.INFO|be.INFO>): Look for why the tablet was removed or if there were any disk/IO errors.
4. Retry the Load:
Usually, this is a transient issue. If the load failed because of a migration, retrying the load will allow the FE to provide the updated, correct tablet locations to the load process.
5. Verify Replica Integrity:
If the error persists, you can check if the table has enough healthy replicas:
sql
ADMIN SHOW REPLICA STATUS FROM <table_name>;
If this happens frequently during high-load periods, it might suggest that your cluster is frequently rebalancing data, which can be tuned by adjusting parameters like tablet_sched_concurrency in the FE configuration.
References
• faq/loading/Loading_faq.md
• sql-reference/sql-statements/table_bucket_part_index/SHOW_TABLET.md
• administration/management/BE_configuration.md
• faq/Sql_faq.md
• faq/operation_maintenance_faq.md
• table_design/table_types/primary_key_table.md
• administration/management/monitoring/metrics.md
• faq/loading/Broker_load_faq.mdhc
03/31/2026, 12:46 PMPTabletWriterAddSegmentRequest tablet_id 1111111 not existsRocky
03/31/2026, 12:46 PMPTabletWriterAddSegmentRequest tablet_id 1111111 not exists during a Stream Load typically indicates that while the tablet itself exists in the cluster (as you've verified with SHOW TABLET), the in-memory TabletWriter object on the Backend (BE) has been destroyed or was never successfully initialized for this specific load transaction.
In StarRocks, when a load starts, the BE creates a TabletWriter to manage the data being written for a specific tablet. If this writer is missing when the BE tries to add a segment, it throws this error.
Common Causes and Solutions
1. Load Timeout (Most Likely)
If the Stream Load takes longer than the configured timeout, the FE or BE may abort the transaction and clean up the writers.
* BE Side: The parameter streaming_load_rpc_max_alive_time_sec (default 1200s) in be.conf controls how long a writer can stay alive. If your load is very large, it might exceed this.
* FE Side: The default timeout for a Stream Load job is 600 seconds. You can increase this by passing a timeout header in your Stream Load request:
bash
curl --location-trusted -u user:passwd \
-H "timeout:3600" \
-T data.csv <http://fe_host:http_port/api/db/table/_stream_load>
2. BE Node Restart or Crash
If the BE node where tablet 1111111 resides restarted during the load, all active TabletWriter objects in memory are lost.
* Check: Check the BE uptime or the <http://be.INFO|be.INFO> logs for any crash signals or "Starting StarRocks BE" messages around the time of the error.
3. High Memory Pressure
If the BE is under extreme memory pressure, it might fail to allocate resources or, in some cases, the process might be struggling to keep up with RPC requests, leading to internal timeouts that trigger writer cleanup.
* Check: Look for "Memory limit exceeded" or "OOM" messages in the <http://be.INFO|be.INFO> logs.
4. Concurrent Schema Change
If a schema change (like adding a column or changing a distribution) was performed on the table while the load was active, the tablet version might have changed, causing the current load's writer to become invalid.
Recommended Troubleshooting Steps
1. Check Stream Load Response: Look at the JSON response of your failed Stream Load. It often contains a more descriptive Message field.
2. Inspect BE Logs: Search the <http://be.INFO|be.INFO> logs on the BE node for the specific tablet ID 1111111. Look for entries related to TabletWriterMgr or cancel to see why the writer was removed.
3. Adjust Timeouts: If you are loading a large amount of data (several GBs), ensure you increase the timeout:
* In the curl command, add -H "timeout:3600".
* If necessary, increase streaming_load_rpc_max_alive_time_sec in be.conf and restart the BE.
4. Verify Tablet Distribution: Run SHOW TABLET 1111111 and check which BEs host the replicas. If only one BE is reporting the error, focus on the logs of that specific BE.
Summary: The error doesn't mean the tablet is gone from the system; it means the "writing session" for that tablet on the BE was closed prematurely. Usually, increasing the load timeout resolves this.
References
• administration/management/BE_configuration.md
• faq/loading/Loading_faq.md
• loading/StreamLoad.md
• administration/management/FE_configuration.mdhc
03/31/2026, 1:30 PMLoadJobSourceType: INSERT_STREAMINGRocky
03/31/2026, 1:30 PMLoadJobSourceType: INSERT_STREAMING refers to a SQL Insert operation in StarRocks.
While the name contains "streaming," it is the internal designation for INSERT INTO statements (such as INSERT INTO ... VALUES or INSERT INTO ... SELECT). It is called "streaming" because StarRocks executes these SQL commands using its internal streaming execution framework to pipe data from the source (or values list) directly to the destination tablets.
Here is the distinction:
* INSERT_STREAMING: Corresponds to SQL Insert statements. In the information_schema.loads table or SHOW LOAD output, this typically appears under the Type as INSERT.
* STREAM_LOAD (or STREAM): Corresponds to the Stream Load method, which is the HTTP-based interface (typically used with curl or StarRocks connectors).
In short, if you see INSERT_STREAMING in your logs or job metadata, the load was triggered via a SQL INSERT command.
References
• loading/Stream_Load_transaction_interface.md
• loading/StreamLoad.md
• sql-reference/sql-statements/loading_unloading/STREAM_LOAD.md
• loading/Loading_intro.md
• loading/loading_introduction/loading_concepts.mdhc
03/31/2026, 1:34 PMTransactionStatus: ABORTED
LoadJobSourceType: INSERT_STREAMING
Reason: 10.10.10.10: PTabletWriterAddSegmentRequest tablet_id 1111111 not existsRocky
03/31/2026, 1:35 PMPTabletWriterAddSegmentRequest tablet_id [ID] not exists indicates that a Backend (BE) received a request to write data (a segment) for a specific tablet, but it could not find an active "Writer" context for that tablet.
In StarRocks, when a load job (like a Stream Load, Routine Load, or INSERT) starts, it first "opens" writers on the target BEs. If the BE later receives data for a tablet but the writer is gone, this error is triggered and the transaction is aborted.
Common Causes
1. Load Timeout:
* The most common reason is that the load job timed out. If the FE or the BE determines the job has exceeded its allocated time, it will cancel the transaction and clean up the writers. Any subsequent data packets sent by the coordinator or other nodes for that job will result in this error.
* Solution: Increase the query_timeout (for INSERT) or streaming_load_rpc_max_alive_time_sec (for Stream Load) in the BE configuration. If using Routine Load, check routine_load_task_timeout_second.
2. BE Restart or Crash:
* If the BE at the IP address mentioned (10.10.10.10) restarted during the load, all in-memory writer contexts are lost. When the loading process attempts to send the next segment to that BE, it will report that the tablet writer "not exists."
* Solution: Check the BE's be.out or <http://be.INFO|be.INFO> logs for restart events or crashes (OOM, etc.) around the time of the error.
3. Premature Writer Closure (Resource Issues):
* If the BE encounters a critical error (e.g., Disk Full, too many tablet versions, or I/O errors) while processing an earlier part of the load, it may close the writer and return an error. If the loading coordinator doesn't stop immediately and tries to send more data, you might see this "not exists" message as a secondary error.
* Solution: Search the BE logs (<http://be.INFO|be.INFO>) for the specific tablet_id mentioned in the error to see if a more descriptive error occurred just before the abort.
4. Partition/Table Changes:
* If a partition was dropped, truncated, or its distribution was changed (e.g., via dynamic partitioning) while the load was in progress, the tablet associated with that writer may have been invalidated or removed.
5. Network or RPC Issues:
* High network latency or packet loss can cause the open request to be delayed or fail, but if the sender proceeds to send segments anyway, the BE will reject them because the writer was never successfully initialized.
Recommended Troubleshooting Steps
1. Check BE Logs: Go to the BE node 10.10.10.10 and check storage/logs/be.INFO. Search for the tablet_id 1111111 to find the root cause of why the writer was closed or failed to open.
2. Monitor BE Status: Run SHOW BACKENDS; to ensure all BEs are Alive and the LastStartTime hasn't changed recently (indicating a restart).
3. Check Disk Space: Ensure the data disks on 10.10.10.10 are not at 100% capacity.
4. Check Version Count: If you have very frequent small loads, you might hit the tablet_max_versions limit (default 1000), which can cause writers to fail. Use SHOW TABLET 1111111; to check the version count.
References
• faq/loading/Loading_faq.md
• sql-reference/sql-statements/table_bucket_part_index/SHOW_TABLET.md
• administration/management/BE_configuration.md
• faq/Sql_faq.md
• faq/operation_maintenance_faq.md
• table_design/table_types/primary_key_table.mdRocky
03/31/2026, 1:35 PMhc
03/31/2026, 1:45 PMTransactionStatus: ABORTED
LoadJobSourceType: INSERT_STREAMING
Reason: 10.10.10.10: PTabletWriterAddSegmentRequest tablet_id 1111111 not existsRocky
03/31/2026, 1:46 PMPTabletWriterAddSegmentRequest tablet_id 1111111 not exists typically indicates that the Backend (BE) receiving the data does not have an active "writer" context for that specific tablet and transaction.
While table locking is usually not the direct cause of this specific "not exists" error, it can be an indirect factor. Here are the most likely causes:
1. Load Timeout (Most Common)
If the data loading process takes too long, the BE may clean up the tablet writer to release resources. If the coordinator (FE or another BE) then tries to send more data (a "segment"), the target BE no longer recognizes the request.
* Indirect Locking Link: If there is heavy lock contention (e.g., many concurrent loads or heavy compaction), the load may progress so slowly that it exceeds the timeout.
* Solution: Increase the query_timeout session variable for your load or adjust the BE configuration streaming_load_rpc_max_alive_time_sec (default is 600 seconds).
2. BE Process Restart
If the BE hosting that tablet replica crashed or was restarted during the load, all in-memory tablet writers are lost. When the load tries to resume or send more data to that BE, it will return "not exists."
* Check: Check the BE be.out or <http://be.INFO|be.INFO> logs for any restart events around the time of the error.
3. Schema Change or Partition Operations
If someone performed an ALTER TABLE (schema change), TRUNCATE, or DROP PARTITION on the target table while the load was running, the tablets might have been replaced or deleted.
* Solution: Ensure no DDL operations are running concurrently with large data loads.
4. Tablet Migration or Repair
If the FE detects a disk failure or a BE becomes unresponsive, it may trigger a tablet clone or migration. If a tablet is moved while a load is trying to write to its old location, this error can occur.
──────────
Is it caused by Table Locking?
* Directly? No. If a table is locked (e.g., by a metadata lock in FE), you would usually see an error like get lock timeout or the load would simply hang in a PENDING state.
* Indirectly? Yes. High lock contention can slow down the write process significantly. If the write becomes slow enough to trigger the streaming_load_rpc_max_alive_time_sec timeout, the BE will close the writer, leading to the "not exists" error.
Recommended Troubleshooting Steps:
1. Check BE Logs: Search the <http://be.INFO|be.INFO> log on the node 10.10.10.10 for the tablet_id 1111111 to see if there was a timeout or a memory/disk error.
2. Increase Timeouts: If your load is large, try:
sql
SET query_timeout = 3600; -- Set to 1 hour
3. Check Table Health: Run SHOW TABLET 1111111; to see the current status and location of the tablet.
4. Reduce Concurrency: If you suspect lock contention, try reducing the number of concurrent load jobs or increasing tablet_map_shard_size in be.conf to reduce lock granularity.
References
• faq/loading/Loading_faq.md
• faq/loading/Broker_load_faq.md
• administration/management/BE_configuration.md
• faq/loading/Routine_load_faq.mdhc
03/31/2026, 2:34 PMRocky
03/31/2026, 2:35 PMquery_timeout parameter in StarRocks is managed as a system variable, not through the fe.conf or be.conf configuration files.
Here is the breakdown of how it can be set:
1. Can it be set as a global variable?
Yes. You can set query_timeout globally so that it applies to all future sessions and connections.
sql
SET GLOBAL query_timeout = 300; -- Set global timeout to 300 seconds
Note: When set globally, the change only applies to new sessions. Existing sessions will continue to use their original timeout value.
2. Can it be set in FE or BE configuration files?
No. query_timeout is not a parameter in fe.conf or be.conf.
While some internal task-related timeouts (like task_runs_timeout_second) exist in fe.conf, the standard timeout for user-initiated queries is handled exclusively via system variables.
3. Other ways to set query_timeout
* Session Level: To change it only for your current connection:
sql
SET query_timeout = 600;
* Query Hint: To change it for a single specific query:
sql
SELECT /_+ SET_VAR(query_timeout = 60) _/ * FROM my_table;
* User Property (v3.3.3+): You can bind a specific timeout to a user:
sql
ALTER USER 'jack' SET PROPERTIES ('session.query_timeout' = '600');
Key Considerations:
* Default Value: The default is 300 seconds (5 minutes).
* Unit: The value is always in seconds.
* Insert Operations: Starting from v3.4.0, query_timeout no longer applies to INSERT, UPDATE, or DELETE operations. Instead, you should use the insert_timeout variable for those tasks.
References
• administration/management/FE_configuration.md
• administration/management/BE_configuration.mdhc
03/31/2026, 2:42 PMRocky
03/31/2026, 2:43 PMUPDATE_STREAMING is not explicitly documented as a standard or public-facing value for LoadJobSourceType in the user-level documentation (such as SHOW LOAD or information_schema.loads).
Based on the documentation and system behavior for version 3.1 and later:
1. Publicly Documented Load Types:
When querying load job information (e.g., via the information_schema.loads view or SHOW LOAD), the common values for the TYPE or source type field are:
* BROKER: For Broker Load jobs.
* INSERT: For INSERT INTO jobs.
* STREAM: For Stream Load jobs (visible in information_schema.stream_loads).
* ROUTINE: For Routine Load jobs.
* SPARK: For Spark Load jobs.
2. UPDATE Statement Implementation:
Starting from v3.1, StarRocks supports Partial Updates on Primary Key tables using the UPDATE statement. These operations can be executed in two modes:
* Row mode: Suitable for small batches of real-time updates.
* Column mode: Suitable for updating a small number of columns across a large number of rows.
Internally, these UPDATE statements are often handled by the query engine and may trigger an internal ingestion-based process, but they are typically identified as UPDATE or INSERT in audit logs and system views rather than UPDATE_STREAMING.
3. Internal Enum:
In the StarRocks source code (FE), the internal LoadJobSourceType enumeration includes values like INSERT_JOB and UPDATE_JOB. While some internal developer-facing or debug logs might refer to streaming update mechanisms (especially for Primary Key tables), UPDATE_STREAMING is not a standard configuration or status value you would use in SQL commands.
Summary
There is no publicly documented UPDATE_STREAMING value for LoadJobSourceType. If you are looking to perform streaming-like updates, you should use:
* Stream Load with partial_update: true.
* Flink/Kafka Connectors with sink.properties.partial_update set to true.
* The UPDATE statement (which StarRocks v3.1+ optimizes for Primary Key tables).
If you are seeing this term in an error message or a specific internal table, it likely refers to the internal execution mode of a Partial Update being processed as a stream of data changes for a Primary Key table.
References
• sql-reference/sql-statements/loading_unloading/BROKER_LOAD.md
• loading/Flink-connector-starrocks.md
• sql-reference/sql-statements/table_bucket_part_index/UPDATE.md
• administration/management/FE_configuration.md
• administration/management/BE_configuration.mdhc
03/31/2026, 2:58 PMbe/src/storage/segment_replicate_executor.cpp:131 _wait_response(replicate_tablet_infos, failed_tablet_infos) by [ReplicateToken tablet_id: 1111111, txn_id: 11111111] fail_num 2 max_fail_num 1
W20260331 11:53:33.010759 129390532884032 async_delta_writer.cpp:67] Fail to write or commit. txn_id: 11111111 tablet_id: 1111111: Internal error: PTabletWriterAddSegmentRequest tablet_id 1111111 not existsRocky
03/31/2026, 2:58 PMPTabletWriterAddSegmentRequest. However, the target BE responded that tablet_id 1111111 does not exist in its local memory/storage.
3. Failure Threshold: fail_num 2 max_fail_num 1 means the replication failed on 2 replicas. Since this exceeded the allowed failure threshold (likely based on your replication factor and write quorum), the entire transaction/load task failed.
Potential Causes:
* Tablet Migration: The FE might believe the tablet is on a specific BE, but that BE has recently migrated the tablet elsewhere or deleted it (e.g., due to cluster balancing or the replica being marked as "bad").
* Metadata Inconsistency: There is a temporary out-of-sync state between the FE's catalog and the BE's actual local tablets.
* Concurrent Schema Change/Drop: If the table or partition was being dropped, truncated, or altered (schema change) at the exact moment the load was attempting to replicate segments.
* Recent BE Restart: If the target BE was recently restarted, it might still be in the process of loading tablet metadata into memory.
Recommended Troubleshooting Steps:
1. Check Tablet Locations:
Run the following command to see where the FE thinks the tablet should be:
sql
SHOW TABLET 1111111;
Compare the BackendId in the output with the BEs that reported the "not exists" error in your logs.
2. Verify Tablet Health:
Check if the tablet is in a healthy state:
sql
ADMIN SHOW REPLICA STATUS FROM table_name WHERE TabletId = 1111111;
If replicas are missing or in an error state, you may need to trigger a repair:
sql
ADMIN REPAIR TABLE table_name;
3. Identify Inconsistency:
Check the be_tablets table in information_schema to see if the BE actually reports having that tablet:
sql
SELECT * FROM information_schema.be_tablets WHERE TABLET_ID = 1111111;
4. Workaround (If persistent):
If this issue happens frequently due to a known environment instability, you can temporarily disable Single Replica Load to fall back to the standard loading process (where every BE indexes data independently):
sql
SET GLOBAL enable_single_replica_load = false;
(Note: This might increase CPU/IO usage on BEs during loading).
If the problem persists after a few minutes (giving FE/BE time to sync), it suggests a metadata stale issue that might require a restart of the FE leader or the specific BE.
References
• faq/loading/Loading_faq.md
• sql-reference/sql-statements/table_bucket_part_index/SHOW_TABLET.md
• faq/Sql_faq.md
• faq/operation_maintenance_faq.md
• sql-reference/information_schema/be_tablets.md
• faq/loading/Broker_load_faq.md
• knowledge/trouble_shooting/fe_deadlock_problems.mdhc
03/31/2026, 3:05 PMbe/src/storage/segment_replicate_executor.cpp:131 _wait_response(replicate_tablet_infos, failed_tablet_infos) by [ReplicateToken tablet_id: 1111111, txn_id: 11111111] fail_num 2 max_fail_num 1
W20260331 11:53:33.010759 129390532884032 async_delta_writer.cpp:67] Fail to write or commit. txn_id: 11111111 tablet_id: 1111111: Internal error: PTabletWriterAddSegmentRequest tablet_id 1111111 not existsRocky
03/31/2026, 3:05 PMPTabletWriterAddSegmentRequest tablet_id 1111111 not exists occurring within segment_replicate_executor.cpp suggests that while the loading process is trying to replicate data segments from one Backend (BE) to others, the target BE reports that it doesn't recognize the tablet ID for that specific transaction.
Here is a breakdown of what is likely happening and how to troubleshoot:
1. Understanding the Error
When enable_single_replica_load is enabled, StarRocks writes data to one replica and then the BE handles replicating those segments to the other replicas.
* fail_num 2 max_fail_num 1: This means the replication failed on 2 replicas, exceeding the allowed failure threshold (1), causing the entire load job to fail.
* tablet_id 1111111 not exists: The target BE received a request to add a segment to this tablet, but it couldn't find an active DeltaWriter or the tablet itself in its local metadata for this load transaction.
2. Why show tablet says it exists but the load fails
Even if the tablet exists globally, the load might fail if:
* Metadata Inconsistency: The FE thinks the tablet replica is on BE-A, but BE-A doesn't actually have it (or it's in a DELETED state but not yet cleaned up).
* Replica Migration: If a tablet migration or balance task occurred exactly when the load started, the "location" of the tablet might have changed, but the load task was still trying to talk to the old BE.
* Transaction Timeout: If the DeltaWriter on the target BE was closed due to a timeout or an earlier internal error, subsequent segment replication requests will fail with "not exists".
3. Troubleshooting Steps
Step A: Verify Replica Health on all BEs
Don't just check if the tablet exists; check if all replicas are healthy and in sync.
sql
-- Replace 1111111 with your actual tablet_id
SHOW TABLET 1111111;
-- Take the 'DetailCmd' from the result and run it, for example:
SHOW PROC '/dbs/12345/67890/partitions/11111/111111/1111111';
In the SHOW PROC output, check:
* Are there replicas on BEs that were not mentioned in your error logs?
* Is any replica's State not NORMAL or IsBad true?
* Are the Version numbers consistent across all replicas?
Step B: Check BE Logs of the Target Nodes
Search the logs of the BE nodes that reported the error (not just the coordinator BE) around 11:53:33. Look for:
* tablet_id: 1111111
* Any messages about tablet dropped, clear transaction, or timeout.
* Any RPC errors or "failed to open DeltaWriter".
Step C: Check for Concurrent Schema Changes or Migrations
Run these commands to see if any background tasks interfered:
sql
SHOW ALTER TABLE COLUMN; -- Check for ongoing schema changes
SHOW BACKUP; -- Check if a backup/restore is locking the tablet
Step D: Workaround
If this is a persistent issue and you need the load to succeed immediately, you can temporarily disable Single Replica Load to use the standard load process (where the coordinator writes to all replicas directly):
sql
SET GLOBAL enable_single_replica_load = false;
If the SHOW PROC command reveals that one replica is consistently lagging or in a weird state, you can manually mark it as bad to force StarRocks to repair it:
sql
ADMIN SET REPLICA STATUS PROPERTIES("tablet_id" = "1111111", "backend_id" = "FAILED_BE_ID", "status" = "bad");
Does this happen for all tables or just this specific one? Knowing if it's a one-time event or a recurring issue would help narrow it down!
References
• faq/loading/Loading_faq.md
• faq/loading/Routine_load_faq.mdRocky
03/31/2026, 3:05 PMhc
03/31/2026, 3:31 PMFailed to send rpc to SyncChannnel
err=Internal error: PTabletWriterAddSegmentRequest tablet_id 1111111 not exists
Failed to sync segment SyncChannnel
err Internal error: PTabletWriterAddSegmentRequest tablet_id 1111111 not exists
be/src/storage/segment_replicate_executor.cpp:131 _wait_response(replicate_tablet_infos, failed_tablet_infos) by [ReplicateToken tablet_id: 1111111, txn_id: 11111111] fail_num 2 max_fail_num 1
W20260331 11:53:33.010759 129390532884032 async_delta_writer.cpp:67] Fail to write or commit. txn_id: 11111111 tablet_id: 1111111: Internal error: PTabletWriterAddSegmentRequest tablet_id 1111111 not exists
get clear transaction task task, signature:256011111, txn_id: 11111111, partition id size: 0
Clearing transaction task txn_id: 11111111
Cleared transaction task txn_id: 11111111
finish to clear transaction task. signature:256011111, txn_id: 11111111Rocky
03/31/2026, 3:31 PMPTabletWriterAddSegmentRequest tablet_id 1111111 not exists means that while the Primary replica of the tablet successfully wrote a data segment and tried to replicate it to the Secondary replicas, the target Backend (BE) reported that it does not have that tablet ID in its memory or disk.
Why this happens
When Segment Replication is enabled (default for Primary Key tables or when replicated_storage is set to true), only one replica (the primary) processes the data and then sends the finished segment files to others via the SyncChannel. If a secondary BE receives this RPC but cannot find the tablet, the request fails. This usually happens due to:
1. Metadata Inconsistency: The FE thinks a BE should have a replica of tablet 1111111, but that BE has either dropped it, failed to create it, or it was recently migrated/moved.
2. Stale Tablet Info: A tablet migration or balancing task might have recently moved the tablet, and the Coordinator BE is still trying to send data to the old location.
3. Failed Tablet Initialization: The tablet might have failed to initialize on that specific BE during a schema change or partition creation.
Troubleshooting Steps
1. Check all replicas of the tablet
While SHOW TABLET 1111111 shows a general "NORMAL" state, you need to look at the status of every individual replica across all BEs.
1. Run SHOW TABLET 1111111;.
2. Copy the command in the DetailCmd column (it looks like SHOW PROC '/dbs/1001/tablets/1111111';).
3. Execute that command.
4. Check the State, IsBad, and Version for every BackendId listed. Look for any BE where the tablet might be missing or in an ERROR state.
2. Identify the "Missing" BE
Check your BE logs for the IP/ID of the node that returned the not exists error. Cross-reference this with the list from Step 1. If a BE is listed in the FE metadata but doesn't actually host the tablet, that is the source of the inconsistency.
3. Force a Repair
If you find a replica that is lagging or inconsistent on a specific BE, you can force StarRocks to recreate it:
sql
-- Replace with your actual tablet_id and the backend_id that is failing
ADMIN SET REPLICA STATUS PROPERTIES("tablet_id" = "1111111", "backend_id" = "10002", "status" = "bad");
After marking it as bad, the FE will automatically schedule a clone task to restore a healthy replica from the remaining good ones.
4. Temporary Workaround (If persistent)
If this is a recurring issue on a specific table and impacting production, you can disable Segment Replication for that table to revert to the traditional "replicate-to-all" loading mode:
sql
ALTER TABLE <table_name> SET ("replicated_storage" = "false");
Note: This might increase CPU usage during loads as every replica will now process the data independently.
Recommendation: If the DetailCmd shows all replicas are NORMAL and versions match, but the error persists, it is likely a transient race condition during a tablet migration. Restarting the BE that reports the "not exists" error can often clear the internal metadata cache.
References
• faq/loading/Loading_faq.md
• administration/management/resource_management/Replica.md
• faq/operation_maintenance_faq.md
• sql-reference/sql-statements/table_bucket_part_index/SHOW_TABLET.mdhc
03/31/2026, 4:32 PMFailed to send rpc to SyncChannnel
err=Internal error: PTabletWriterAddSegmentRequest tablet_id 1111111 not exists
Failed to sync segment SyncChannnel
err Internal error: PTabletWriterAddSegmentRequest tablet_id 1111111 not exists
be/src/storage/segment_replicate_executor.cpp:131 _wait_response(replicate_tablet_infos, failed_tablet_infos) by [ReplicateToken tablet_id: 1111111, txn_id: 11111111] fail_num 2 max_fail_num 1
W20260331 11:53:33.010759 129390532884032 async_delta_writer.cpp:67] Fail to write or commit. txn_id: 11111111 tablet_id: 1111111: Internal error: PTabletWriterAddSegmentRequest tablet_id 1111111 not exists
get clear transaction task task, signature:256011111, txn_id: 11111111, partition id size: 0
Clearing transaction task txn_id: 11111111
Cleared transaction task txn_id: 11111111
finish to clear transaction task. signature:256011111, txn_id: 11111111Rocky
03/31/2026, 4:32 PMreplicated_storage) feature in StarRocks.
When replicated_storage is set to true (which is the default in v3.0+), data is sent to a primary replica BE, which then replicates the data segments to other BEs (secondary replicas) via a component called SyncChannel.
The error PTabletWriterAddSegmentRequest tablet_id 1111111 not exists indicates that the primary BE tried to send a data segment to a secondary BE, but the secondary BE's "Tablet Writer" for that specific tablet was either never successfully opened or was closed/cleaned up (often due to a timeout or failure during the initialization phase).
Under high CPU and Memory usage with many parallel operations, the internal RPCs used to coordinate these writers are delayed or time out, leading to this inconsistency.
Recommended Solutions
1. Increase RPC Timeouts
The most direct way to mitigate this under high load is to give the BEs more time to initialize tablet writers.
* Parameter: tablet_writer_open_rpc_timeout_sec
* Location: be.conf
* Action: Increase the value (e.g., from the default 60 or 300 to 600).
* Restart: Required for each BE.
2. Reduce Lock Contention
If you have many tablets and high concurrency, lock contention on the tablet map can cause delays.
* Parameter: tablet_map_shard_size
* Location: be.conf
* Action: Increase this value to 512 (default is usually 4 or 8). This helps parallelize access to tablet metadata.
* Restart: Required for each BE.
3. Optimize Loading Strategy
Many small, parallel INSERT or UPDATE operations consume significant CPU and create many small versions, leading to heavy metadata pressure and compaction overhead.
* Batching: Combine small load jobs into larger batches to reduce the frequency of transactions.
* Concurrency: Limit the number of parallel load/update tasks to keep CPU and Memory usage within a stable range (e.g., below 80%).
4. Fallback: Disable Single Leader Replication
If the resource pressure cannot be reduced and the errors persist, you can revert specific tables to the older replication method (Leaderless Replication), where the loading client writes to all replicas simultaneously. This removes the "SyncChannel" bottleneck but may increase the CPU cost of the load itself.
* Command:
sql
ALTER TABLE <table_name> SET ("replicated_storage" = "false");
5. Check for Tablet Health
Sometimes this error occurs if replicas are already in an inconsistent state. Check the health of the tablets mentioned in the logs:
sql
ADMIN SHOW REPLICA STATUS FROM <table_name> WHERE TabletId = 1111111;
If any replicas are marked as IsBad = true, they may need to be repaired or dropped for StarRocks to clone fresh copies.
References
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• knowledge/usage/best-practice.md
• administration/management/resource_management/Replica.md
• administration/management/FE_configuration.md
• faq/operation_maintenance_faq.mdhc
03/31/2026, 4:53 PMtablet_writer_open_rpc_timeout_sec = 600
tablet_map_shard_size = 512Rocky
03/31/2026, 5:06 PMtablet_writer_open_rpc_timeout_sec = 600
* What it does: This sets the timeout for the RPC that opens a tablet writer on a BE node during a load process.
* Is it okay? Yes, it is safe to increase this value to 600 seconds (10 minutes) for heavy workloads.
* Context: The default value is typically 300 seconds (since v3.2.0). Under heavy CPU and memory pressure, BE nodes may respond more slowly to writer-open requests because they are busy flushing data or managing locks. Increasing this to 600s acts as a "buffer" to prevent load jobs from failing prematurely due to transient pressure.
* Note: If your load jobs frequently hit this 10-minute timeout, it usually indicates a deeper bottleneck in I/O or CPU, and increasing the timeout further is just a "band-aid."
2. tablet_map_shard_size = 512
* What it does: This partitions the internal "tablet map" lock into shards to reduce lock contention when many threads are trying to access or update tablet metadata simultaneously.
* Is it okay? Yes, but it depends on your StarRocks version.
* In older versions: The default was often very low (sometimes 1 or 4). In those cases, setting it to 512 is a significant improvement for concurrency.
* In newer versions (v3.2.0+): The default has been increased to 1024. If you are on a recent version, setting it to 512 would actually be a reduction in sharding.
* Recommendation: For your workload, ensure this value is a power of two. If you are on v3.2 or later, I recommend leaving it at the default 1024 or even increasing it to 2048 if you have tens of thousands of tablets per BE.
Additional Recommendations for Your Hardware
Your 64GB BE nodes are relatively light for "heavy workloads" involving updates and deletes (which are resource-intensive in StarRocks). You should also consider these adjustments:
1. Memory Management: With 64GB RAM, ensure you monitor the BE memory usage. If you see "Memory Limit Exceeded" errors, you may need to tune mem_limit (default is 90%) or increase the hardware.
2. Concurrency: Since you have parallel Insert/Update/Delete operations, keep an eye on Compaction. Heavy writes trigger heavy compaction. Check compaction_max_running_iteration and max_compaction_threads in BE config to ensure compaction doesn't starve your query resources.
3. Transaction Management: Since you have high concurrency, you might also want to check txn_map_shard_size (default 128) and txn_shard_size (default 1024) to ensure transaction locks aren't becoming a bottleneck.
Summary: Your proposed changes are safe and generally helpful for high-pressure environments, but check your StarRocks version to ensure tablet_map_shard_size is an increase rather than a decrease from the default.
References
• administration/management/BE_configuration.md
• faq/Sql_faq.md
• administration/management/FE_configuration.mdhc
04/08/2026, 6:12 PM/opt/starrocks/fe/temp_dir/backupRocky
04/08/2026, 6:12 PM/opt/starrocks/fe/temp_dir/backup is used as a temporary staging area by the Frontend (FE) during BACKUP and RESTORE operations.
What is this folder for?
When you run a backup or restore task, StarRocks FE often needs to store intermediate metadata or temporary files locally before moving them to the remote repository (like S3, HDFS, or MinIO) or after downloading them from one.
* The parent directory is controlled by the FE configuration parameter tmp_dir (which defaults to FE_HOME/temp_dir).
* The backup subfolder specifically holds files related to these snapshot/recovery procedures.
Is there a process to clean up the files in it?
1. Automatic Cleanup: Under normal circumstances, StarRocks is designed to delete these temporary files automatically once the backup or restore procedure finishes (whether it succeeds or fails).
2. Manual Cleanup: If you see files lingering in this folder, it usually means a backup/restore process was interrupted, crashed, or encountered an error that prevented the cleanup hook from running.
How to safely clean it up:
* Step 1: Check for active tasks. Before deleting anything, ensure there are no backup or restore jobs currently running. Run these commands in your MySQL client:
sql
SHOW BACKUP;
SHOW RESTORE;
Look at the State column. If any task is PENDING, SNAPSHOTING, or UPLOADING, do not delete the files.
* Step 2: Manual deletion. If there are no active tasks and the files are old, you can safely remove them manually using the standard Linux command:
bash
rm -rf /opt/starrocks/fe/temp_dir/backup/*
Note: Do not delete the backup folder itself, just the contents inside it.
Summary of FE Configuration
If you want to move this temporary directory to a disk with more space (to avoid "disk full" issues during large backups), you can modify your `fe.conf`:
properties
# Example: changing the temp directory path
tmp_dir = /path/to/larger/disk/temp_dir
A restart of the FE is required for this change to take effect.
References
• administration/management/FE_configuration.md
• faq/operation_maintenance_faq.md
• faq/Others.md
• knowledge/admin_and_operation/shared_data_garbage_cleanup.md
• administration/Meta_recovery.md
• administration/management/BE_configuration.mdhc
04/10/2026, 2:19 PMError while loading data: HTTPConnectionPool(host='10.0.10.10', port=8040): Max retries exceeded with url: /api/db/table/_stream_load (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7c14cbc11111>, 'Connection to 10.10.10.10 timed out. (connect timeout=60)'))Rocky
04/10/2026, 2:19 PM10.0.10.10 on port 8040.
Why this happens
Stream Load in StarRocks follows a two-step redirection process:
1. Request to FE: Your client sends the initial request to the Frontend (FE) (typically port 8030).
2. Redirection to BE: The FE selects an available BE node and sends an HTTP 307 redirect back to your client.
3. Connection to BE: Your client automatically tries to connect to that BE (in your case 10.0.10.10:8040) to stream the actual data.
The error ConnectTimeoutError means your client successfully talked to the FE, but it cannot reach the BE it was redirected to.
Troubleshooting Steps
1. Verify Connectivity
From the machine where you are submitting the load, try to reach the BE port manually:
bash
telnet 10.0.10.10 8040
# OR
curl -I <http://10.0.10.10:8040/api/health>
* If this fails, there is a firewall, security group (AWS/GCP), or routing issue blocking traffic to port 8040 on your BE nodes.
2. Check BE Status
Ensure the BE is actually up and running. Run this in your MySQL client:
sql
SHOW BACKENDS\G
* Check the Alive column. If it is false, the BE is down and cannot accept loads.
* Check the IP column. Ensure the IP listed there is reachable from your client.
3. Internal vs. External IP (Common in Cloud/K8s)
If your StarRocks cluster is in a private network (like a VPC or Kubernetes) and your client is outside:
* The FE will redirect you to the internal IP of the BE (e.g., 10.0.10.10).
* If your client cannot route to that internal IP, the connection will time out.
* Solution: You must ensure your client has a network path to the BEs, or run the load from a machine inside the same network.
4. Configure priority_networks
If your BE nodes have multiple network interfaces (e.g., a public and a private one), they might be registering the "wrong" IP with the FE.
* Check be.conf for the priority_networks parameter.
* It should be set to the CIDR of the network you want StarRocks to use (e.g., priority_networks = 10.0.10.0/24).
5. Port Conflicts
Confirm that be_http_port is actually 8040 in your be.conf. If you changed it to something else, ensure that port is open.
Summary
The FE told your client: "Please send the data to 10.0.10.10:8040", but your client couldn't find a way to get there. Focus on opening port 8040 in your network security settings or ensuring the client can route to the BE's IP address.
References
• data_source/data_cache.md
• administration/management/BE_configuration.md
• using_starrocks/caching/block_cache.mdhc
04/10/2026, 2:23 PMError while loading data: HTTPConnectionPool(host='10.0.10.10', port=8040): Max retries exceeded with url: /api/db/table/_stream_load (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7c14cbc11111>, 'Connection to 10.10.10.10 timed out. (connect timeout=60)'))Rocky
04/10/2026, 2:24 PM10.0.10.10) and the actual IP the connection timed out on (10.10.10.10).
text
HTTPConnectionPool(host='10.0.10.10', port=8040): ...
Caused by ConnectTimeoutError(..., 'Connection to 10.10.10.10 timed out.')
Even if you believe there are no network issues, a ConnectTimeoutError at the TCP level means your client cannot reach the destination IP/Port. Here is why this is happening and how to fix it:
1. The "Redirection" Trap
When you submit a Stream Load, the following sequence usually occurs:
1. Your client sends a request to a StarRocks node (could be an FE or a BE).
2. The node determines which BE should handle the load and sends an HTTP 307 Redirect back to your client with the specific BE's IP and port (8040).
3. Your client library (like Python requests) automatically follows that redirect.
The Issue: The Frontend (FE) is likely telling your client to go to 10.10.10.10, which is likely an internal/private IP that the BE uses to communicate within the cluster. If your client is running on a machine outside that specific private network (e.g., a different VPC, a local laptop, or a different subnet), it will time out trying to reach that internal IP.
2. Why the IP is "Wrong"
StarRocks BEs register themselves with the FE using the IP they find on their network interface. If a BE has multiple interfaces or is running in a container/K8s:
* It might pick a "management" or "internal" IP that isn't routable from your client.
* The FE then passes this "internal" IP to your client during the redirect.
3. How to Fix This
Option A: Use priority_networks (Recommended)
You need to tell the StarRocks BEs which network they should "advertise" to the FE.
1. Edit be.conf on all BE nodes.
2. Set the priority_networks parameter to the CIDR of the network that is reachable by your client.
properties
# Example: If your reachable network is 10.0.10.x
priority_networks = 10.0.10.0/24
3. Restart the BEs.
4. Verify the IP in the cluster by running SHOW BACKENDS; in your MySQL client. The IP column should now show the reachable 10.0.10.x addresses.
Option B: Check Firewall/Security Groups
If the IPs are actually correct and routable, the timeout on port 8040 specifically means:
* The port 8040 is blocked by a firewall (iptables, firewalld) on the BE node.
* The Cloud Security Group (AWS/GCP/Azure) does not allow inbound traffic on 8040.
* Test this: From your client machine, run telnet 10.10.10.10 8040. If it hangs, the network path is blocked.
Option C: Client-side Routing
If you cannot change the StarRocks configuration, ensure the machine running the load has a network route to the 10.10.10.x subnet (e.g., via a VPN or VPC Peering).
Summary Checklist
* [ ] Does SHOW BACKENDS; show the 10.10.10.10 IP? (If yes, FE is redirecting you there).
* [ ] Can your client machine ping 10.10.10.10?
* [ ] Can your client machine telnet 10.10.10.10 8040?
Rocky's Pro Tip: If you are using curl, use the -L or --location-trusted flag. If you are using a Python script, ensure you aren't behind a proxy that is intercepting the redirect incorrectly.
References
• quick_start/shared-data.md
• quick_start/helm.md
• loading/StreamLoad.md
• administration/management/FE_configuration.md
• administration/management/BE_configuration.md
• faq/loading/Stream_load_faq.mdhc
04/10/2026, 2:29 PMError while loading data: HTTPConnectionPool(host='10.10.10.10', port=8040): Max retries exceeded with url: /api/db/table/_stream_load (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7c14cbc11111>, 'Connection to 10.10.10.10 timed out. (connect timeout=60)'))Rocky
04/10/2026, 2:30 PMConnectTimeoutError for 10.10.10.10:8040, it means your client (the script/machine submitting the load) failed to establish a TCP handshake with the StarRocks Backend (BE) within the 60-second limit.
Even if you believe there are no network issues, a "Timeout" (as opposed to "Connection Refused") means the client sent a request and received nothing back. This is almost always caused by one of the following environmental or configuration factors:
1. The "Listen" vs. "Routable" IP
StarRocks BEs bind to specific network interfaces. If a BE has multiple IPs (e.g., an internal 10.x.x.x and a management IP), it might only be listening on the one identified by priority_networks.
* The Issue: If the BE is listening on 10.10.10.10 but you are trying to reach it from a network that doesn't have a direct route to that specific subnet, it will time out.
* Verification: On the BE node itself, run:
bash
netstat -antp | grep 8040
Confirm it shows LISTEN and check which IP it is bound to (e.g., 0.0.0.0:8040 or a specific IP).
2. Environment Proxies (Common Culprit)
If your client machine has http_proxy or https_proxy environment variables set, urllib3 (used by Python's requests) will attempt to route the connection through that proxy.
* The Issue: If your proxy cannot reach the internal StarRocks IP 10.10.10.10, the proxy will time out, which manifests as a ConnectTimeoutError in your script.
* Fix: Try running your load with the proxy disabled:
bash
unset http_proxy https_proxy
# then run your load script
3. Port-Level Blocking (Security Groups/Firewalls)
Ping uses ICMP, but Stream Load uses TCP. Passing a ping test does not mean port 8040 is open.
* The Issue: A firewall (iptables/firewalld) on the BE or a Cloud Security Group (AWS/GCP) might allow traffic to the FE (8030) but block traffic to the BE (8040).
* Verification: From your client machine, run:
bash
telnet 10.10.10.10 8040
# OR
curl -v <http://10.10.10.10:8040/api/health>
If these commands hang, the port is blocked.
4. priority_networks Mismatch
If you are submitting "directly to the BE IP provided by the FE," ensure that the IP the FE gave you is actually the one you expect.
* Run SHOW BACKENDS; in your MySQL client.
* If the IP column shows an address that is not routable from your client's location (like a Docker internal IP or a K8s Pod IP), you must update the priority_networks in be.conf to a CIDR that matches your routable network and restart the BE.
5. BE is Overloaded or Stuck
If the BE is experiencing a "Stop-the-world" GC pause or the CPU is at 100%, the TCP listen queue might be full, causing new connection attempts to be dropped.
* Check the BE logs (be/log/be.INFO and be/log/be.out) for any crash signatures or "High heartbeat" warnings.
Recommended Next Step
Run this command from your client machine:
curl -I <http://10.10.10.10:8040/api/health>
* If it times out: Your network path to port 8040 is definitely blocked (check firewalls/proxies).
* If it returns 200 OK: The network is fine, and the issue might be related to the specific client library handling of 307 redirects. In this case, ensure your script is not accidentally trying to redirect back to a non-routable FE address.
References
• administration/management/BE_configuration.md
• faq/loading/Stream_load_faq.md
• loading/StreamLoad.md
• faq/Deploy_faq.md
• administration/management/BE_blacklist.md
Referenceshc
04/10/2026, 2:35 PMError while loading data: HTTPConnectionPool(host='10.10.10.10', port=8040): Max retries exceeded with url: /api/db/table/_stream_load (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7c14cbc11111>, 'Connection to 10.10.10.10 timed out. (connect timeout=60)'))Rocky
04/10/2026, 2:35 PMConnectTimeoutError on port 8040 (the BE HTTP port) and you have already confirmed that the IP is correct and basic network connectivity (ping) is fine, the issue is likely due to resource saturation or queueing on the Backend (BE) node or the client.
A "Connect Timeout" (especially one as long as 60 seconds) indicates that your client sent a TCP SYN packet, but the BE did not complete the handshake in time. Here are the most common reasons this happens intermittently:
1. BE HTTP Thread Exhaustion
The StarRocks BE has a fixed number of threads dedicated to handling HTTP requests (including Stream Load).
* The Parameter: be_http_num_workers (Default: 48).
* The Issue: If you are running high-concurrency Stream Loads or many concurrent INSERT INTO ... SELECT jobs, these 48 threads can become fully occupied. When all threads are busy, new connection attempts are placed in the OS-level TCP backlog. If the backlog is full or the threads don't free up quickly, the connection will time out.
* Solution: Increase the number of HTTP worker threads in your be.conf and restart the BE:
properties
be_http_num_workers = 128
2. OS-level TCP Backlog Limits
If you have bursts of many connections, the Linux kernel might drop incoming connection requests if the "Listen" queue is full.
* Check: Run this command on the BE node during a period of failure:
bash
netstat -s | grep -i listen
# Look for "SYNs to LISTEN sockets dropped" or "times the listen queue of a networking endpoint was full"
* Solution: Increase the system's maximum connection backlog.
bash
# Check current limits
sysctl net.core.somaxconn
sysctl net.ipv4.tcp_max_syn_backlog
# Increase them (e.g., to 2048 or higher)
sysctl -w net.core.somaxconn=2048
sysctl -w net.ipv4.tcp_max_syn_backlog=2048
3. bRPC Connection Type (High Concurrency)
For environments with extremely high concurrency, the default connection management can sometimes lead to bottlenecks.
* Solution: Change the bRPC connection type to pooled in be.conf to improve RPC efficiency:
properties
brpc_connection_type = pooled
4. Client-side Connection Pool Maxing Out
The error message mentions HTTPConnectionPool(host='10.10.10.10', port=8040): Max retries exceeded. This can happen if your client-side script (e.g., a Python script using requests) is reaching its own internal limit of concurrent connections or retries.
* Troubleshooting: Ensure your client code is reusing connections (using a requests.Session() object) rather than opening a new connection for every single chunk or request.
* Check Proxies: If your environment has a transparent proxy or an http_proxy environment variable set, the intermittent timeout might be happening at the proxy layer.
5. High BE CPU / IO Wait
If the BE node is experiencing extreme CPU load or disk I/O wait (due to heavy compaction or complex queries), the kernel may be slow to process the TCP stack, leading to intermittent handshake timeouts.
* Check: Monitor top or iostat on the BE during the failures. If the CPU load is consistently 100%, you may need to scale out your cluster or reduce the loading frequency.
Summary Checklist
1. Increase be_http_num_workers to 128 or 256 in be.conf.
2. Verify OS backlog with netstat -s to see if packets are being dropped by the kernel.
3. Check for "High Heartbeat" warnings in <http://be.INFO|be.INFO> logs, which indicate the BE is too busy to respond promptly.
4. If using Kubernetes, check if CPU Throttling is occurring on the BE pods.
References
• administration/management/BE_configuration.md
• faq/operation_maintenance_faq.mdRocky
04/10/2026, 2:35 PMhc
04/15/2026, 12:49 PMRocky
04/15/2026, 12:50 PM/opt/starrocks/fe/temp_dir directory is typically related to the BACKUP and RESTORE operations. Here is a breakdown of why this happens and how to manage it.
1. Why is this happening?
The temp_dir (configured by the FE parameter tmp_dir) is used as a staging area to store temporary metadata and snapshot files during the backup and restore processes.
* Expected Behavior: StarRocks is designed to automatically delete these files once a backup or restore job finishes (either successfully or through a handled failure).
* The Cause of Accumulation: If backup or restore jobs are interrupted, cancelled, or time out (due to network issues with remote storage or FE restarts), the cleanup logic may not trigger correctly. Over time, these orphaned temporary files accumulate and consume disk space.
2. Is there an automatic cleanup process?
Unlike the trash directory (which has the catalog_trash_expire_second parameter for periodic cleanup), there is no background thread that periodically scans and purges the temp_dir.
The cleanup is strictly "procedural"—it is tied to the lifecycle of a specific job. If the job's lifecycle is broken (e.g., a hard crash of the FE), the files remain.
3. How to fix and clean up
You can resolve this by following these steps:
Step 1: Check for active jobs
Before deleting anything, ensure there are no legitimate backup or restore tasks currently running.
sql
SHOW BACKUP;
SHOW RESTORE;
If you see jobs in a PENDING, SNAPSHOTING, or UPLOADING state that have been stuck for a long time, you should cancel them:
sql
CANCEL BACKUP FROM <database_name>;
CANCEL RESTORE FROM <database_name>;
Step 2: Manual Cleanup
If no jobs are active, it is perfectly safe to manually delete the contents of the temp_dir.
bash
# Navigate to the directory and remove old files
rm -rf /opt/starrocks/fe/temp_dir/*
Note: Do not delete the directory itself, only its contents.
Step 3: Preventative Tuning
If your backup jobs frequently time out and leave files behind, you can increase the timeout limit in `fe.conf`:
* Parameter: backup_job_default_timeout_ms
* Default: 86400000 (24 hours).
* Action: If your datasets are massive and the remote storage is slow, increasing this can help jobs finish cleanly (and thus trigger the auto-delete).
Summary Recommendation
If you notice this happening frequently, it is common practice for administrators to set up a simple cron job to delete files in that directory that are older than a few days, provided no backups are scheduled during that window.
bash
# Example: delete files older than 3 days in the temp_dir
find /opt/starrocks/fe/temp_dir/ -type f -mtime +3 -delete
References
• administration/management/FE_configuration.md
• administration/Meta_recovery.md
• faq/operation_maintenance_faq.mdhc
04/15/2026, 12:56 PMRocky
04/15/2026, 12:56 PMtemp_dir of an FE where no "backup cron" is enabled is due to how StarRocks handles the Leader FE role and cluster-wide operations.
1. The Leader FE Performs the Work
In a StarRocks cluster, the BACKUP and RESTORE operations are global, cluster-wide tasks. Even if your cron job connects to "the other FE" (e.g., FE-B) to issue the SQL command, the Leader FE is the one that actually coordinates the job, generates metadata snapshots, and writes them to its local temp_dir before uploading them to your remote storage (HDFS/S3).
* Check the Leader: Run SHOW FRONTENDS; in your MySQL client.
* If the FE you are currently looking at has IsMaster (or Role: LEADER) set to true, it is the one responsible for the backup work, regardless of where the SQL command originated.
2. Leader Role Transitions
If your cluster has had a Leader election recently (e.g., due to a restart or network blip), the old Leader may have been in the middle of a backup job when it lost its leadership.
* When a Leader fails or steps down, the temporary files created in its temp_dir are often orphaned.
* The new Leader will start its own process, but it cannot "reach back" and clean up the filesystem of the previous Leader.
3. Cleanup Logic
As mentioned previously, StarRocks' cleanup of temp_dir is event-driven, not time-driven.
* Success/Failure: The files are deleted only when the FE successfully finishes the job (or catches a specific error).
* Hard Crashes/Orphaned Files: If the FE process is killed (kill -9) or the node loses leadership, the "cleanup" code path is never executed. Because there is no background "garbage collector" thread for this directory, the files stay there indefinitely.
Recommended Actions
1. Identify the Leader: Confirm if the FE with the files is (or was) the Leader.
2. Verify Job Status: Run SHOW BACKUP; and SHOW RESTORE;. If there are any CANCELLED or FINISHED jobs that didn't clean up, or if there are very old SNAPSHOTING jobs, they are the source.
3. Manual Purge: If you have confirmed no backups are currently running (SHOW BACKUP returns nothing in progress), it is safe to manually delete the contents:
bash
rm -rf /opt/starrocks/fe/temp_dir/*
4. Cron for Cleanup: Since StarRocks does not provide an automatic periodic cleanup for this specific directory, it is a best practice to add a simple maintenance cron to all FE nodes to delete files older than 7 days:
bash
find /opt/starrocks/fe/temp_dir/ -type f -mtime +7 -delete
Summary
The files exist there because that FE is (or was) the Leader when a backup was initiated. The "cron" only tells the cluster to start; the Leader decides where the temporary metadata work happens.
References
• administration/management/FE_configuration.md
• administration/Meta_recovery.mdhc
04/28/2026, 3:19 PMhttp_client.cpp:173] fail to execute HTTP client, errmsg=Failed to connect to 10.10.10.10 port 8000 after 7151 ms: Couldn't connect to serverRocky
04/28/2026, 3:19 PMhttp_client.cpp:173] fail to execute HTTP client, errmsg=Failed to connect to 10.10.10.10 port 8000 indicates that your StarRocks Backend (BE) is attempting to make an HTTP request to a service at 10.10.10.10:8000, but the connection is being refused or timing out at the TCP level.
In the context of StarRocks, Port 8000 is the default port for the StarRocks Broker process. However, since the error comes from http_client.cpp, it means the BE is specifically trying to communicate via HTTP, not just Thrift (the Broker's primary protocol).
Here are the most likely causes and how to fix them:
1. Broker Service is Down or Unreachable
If you are using a Broker to load data from HDFS or Cloud Storage (e.g., via LOAD LABEL or INSERT INTO ... SELECT with a Broker), the BE needs to communicate with it.
* Check Status: Run the following SQL command in your StarRocks MySQL client:
sql
SHOW BROKER;
* Action: Check if the Broker at 10.10.10.10 shows Alive: true. If it is false, the Broker process on that machine has likely crashed or wasn't started. Log into that machine and check the Broker logs (apache_hdfs_broker.out or broker.log).
2. Misconfigured Storage Endpoint (S3 / MinIO / OSS)
If you are using External Tables, Storage Volumes, or Backup/Restore to an object store (like MinIO), you may have accidentally specified port 8000 in your endpoint URL.
* The Issue: MinIO's API typically runs on port 9000 (its Console often runs on 9001). If your SQL command or configuration used <http://10.10.10.10:8000>, the BE will try to connect there and fail.
* Action: Check your CREATE EXTERNAL TABLE or BACKUP statement. Ensure the aws.s3.endpoint or similar property points to the correct API port.
3. Firewall or Network Security Groups
Even if the service is running, the BE node might be blocked from reaching port 8000 on the target IP.
* Test Connectivity: From the BE node where the error occurs, try to manually connect to that port:
bash
telnet 10.10.10.10 8000
# OR
curl -v <http://10.10.10.10:8000>
* Action: If telnet fails with "Connection refused" or "Timeout," you must open port 8000 in your OS firewall (`iptables`/`firewalld`) or your cloud provider's Security Group.
4. Elasticsearch External Tables
If you are querying Elasticsearch (ES) through StarRocks, the BE acts as an HTTP client to the ES nodes.
* The Issue: ES typically defaults to port 9200. If your ES cluster or a proxy was manually configured to port 8000, ensure the service is actually listening.
* Action: Verify the hosts property in your ES external table DDL:
sql
CREATE EXTERNAL TABLE es_table (...)
ENGINE=ELASTICSEARCH
PROPERTIES (
"elasticsearch.hosts" = "<http://10.10.10.10:8000>",
...
);
5. Lakehouse REST Catalog
If you are using a REST Catalog for Iceberg or another data lake format, it may be running on port 8000.
* Action: Verify that the catalog service is healthy and that the catalog_uri in your StarRocks Catalog configuration is correct.
Summary Checklist:
1. Run SHOW BROKER; to see if a Broker is configured on that port and if it is "Alive."
2. Check if the IP 10.10.10.10 corresponds to a MinIO or Object Storage server and verify its actual API port (usually 9000).
3. Check for Firewalls between the BE and the target IP.
4. Search your BE <http://be.INFO|be.INFO> logs around the time of the error for a "query_id" or "load_id" to identify which specific SQL command or background job is triggering this connection attempt.
References
• deployment/environment_configurations.md
• sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BROKER.mdhc
05/14/2026, 4:23 PMBE tablet clone failed on [no value]Rocky
05/14/2026, 4:23 PMBE tablet clone failed indicates that the cluster is unable to successfully copy a data shard (tablet) from one Backend (BE) node to another.
In StarRocks, cloning is the mechanism used for:
* Replica Repair: If a BE goes down or a disk fails, the cluster "clones" the missing replicas onto healthy nodes.
* Balancing: If one BE has significantly more data than others, the cluster "clones" tablets to underutilized nodes to balance the load.
1. Why did the alert trigger?
The alert is usually based on the metric starrocks_be_engine_requests_total{type="clone", status="failed"}. Common reasons for failure include:
* Network Issues: High latency or packet loss between the source BE and destination BE.
* Disk Issues: The destination BE's disk is full, in read-only mode, or experiencing I/O errors.
* Resource Exhaustion: The BE is under heavy CPU/Memory load and the clone task timed out.
* Version Mismatch: The source replica has a version that is too old or "cold" (already moved to remote storage) and cannot be easily cloned.
2. How to Troubleshoot
Since your alert shows [no value], you first need to identify which tablets and nodes are involved.
Step A: Check the Clone History
The most direct way to see why clones are failing is to check the FE's internal scheduling records. Run this in your MySQL client:
sql
SHOW PROC '/cluster_balance/history_tablets';
* What to look for: Find rows where the State is CANCELLED, TIMEOUT, or UNEXPECTED.
* The "ErrMsg" Column: This column will tell you exactly why the clone failed (e.g., "remote copy failed", "disk full", or "timeout").
Step B: Check BE Logs
Log into your BE nodes and search for clone-related errors in the <http://be.INFO|be.INFO> log:
bash
grep "clone" /opt/starrocks/be/log/be.INFO | grep -i "fail"
This will often show lower-level details like "Connection refused" or specific filesystem errors.
Step C: Check for "Bad" Replicas
If the cluster is repeatedly trying to repair a specific tablet and failing, you can find unhealthy replicas with:
sql
ADMIN SHOW REPLICA STATUS FROM <table_name> WHERE STATUS != "OK";
3. Quick Fixes
* If Disks are Full: Clean up disk space or add more disks/nodes.
* If a BE is Unstable: Restart the BE node that is failing to receive or send clones.
* If the Alert is Transient: Sometimes heavy loading tasks cause clone timeouts. If the alert clears itself and history_tablets shows recent successes, it may have been a temporary resource spike.
* Manual Repair: If a specific tablet is stuck, you can tell the cluster the replica is "bad" to force a fresh clone:
sql
ADMIN SET REPLICA STATUS PROPERTIES("tablet_id" = "12345", "backend_id" = "10001", "status" = "bad");
Summary Recommendation
Check SHOW PROC '/cluster_balance/history_tablets'; first. It is the single most useful tool for identifying the failing node and the specific error message.
References
• administration/management/resource_management/Replica.mdhc
05/14/2026, 4:46 PMType: REPAIR
Medium: HDD
Status: VERSION_INCOMPLETE
State: FINISHEDRocky
05/14/2026, 4:46 PMTabletId from the same row in the SHOW PROC '/cluster_balance/history_tablets'; output.
2. Check the Replica Health
Run the following to see the version status of every copy of that tablet:
sql
SHOW TABLET <TabletId>;
Look at the DetailCmd column in the result. Copy and run that command (it will look like SHOW PROC '/dbs/123/456/...').
* Compare the Version column for all replicas. You will likely see one node has a much lower version number than the others.
3. Force a Full Repair
If the automatic REPAIR keeps finishing with VERSION_INCOMPLETE, the incremental sync is stuck. You can force StarRocks to perform a Full Clone (deleting the old data and copying everything fresh) by marking the lagging replica as "bad":
sql
-- Replace <TabletId> and <BackendId> with the values from the previous step
ADMIN SET REPLICA STATUS PROPERTIES("tablet_id" = "<TabletId>", "backend_id" = "<BackendId>", "status" = "bad");
Once marked as "bad," the FE will notice the replica is effectively "missing" and will perform a full clone from a healthy node.
4. Check BE Logs for Specific Errors
If the tablet stays in this state even after a manual repair, check the BE logs (<http://be.INFO|be.INFO>) on the node that is the destination of the clone. Search for the tablet ID:
bash
grep "<TabletId>" /opt/starrocks/be/log/be.INFO | grep -iE "clone|snapshot"
Look for errors like:
* `no version to clone`: The source node has already cleaned up the data you need.
* `get_rowsets_for_snapshot failed`: There is a physical file missing or corrupted on the source.
Summary
The repair task "finished" but failed to reach the target version. In most cases, marking the specific replica as "bad" is the quickest way to force a clean, successful sync and resolve the alert.
References
• faq/loading/Loading_faq.md
• faq/operation_maintenance_faq.md
• administration/management/resource_management/Replica.md
• administration/management/FE_configuration.mdhc
06/24/2026, 4:41 PMRocky
06/24/2026, 4:42 PMstorage_medium default to "HDD"?
In StarRocks, the storage_medium property for asynchronous materialized views (and regular tables) follows a specific inference logic based on your Backend (BE) disk configuration:
1. Automatic Inference: If you do not explicitly specify storage_medium, StarRocks looks at the disks reported by your BEs (storage_root_path).
2. Hybrid Disks: If your BEs have both SSD and HDD disks, StarRocks defaults to HDD unless you also specify a storage_cooldown_time (in which case it starts on SSD and migrates to HDD later).
3. Single Disk Type: If your BEs only have HDDs, it defaults to HDD. If they only have SSDs, it defaults to SSD.
The system defaults to HDD in hybrid environments to prevent accidentally consuming expensive SSD space for all data by default.
──────────
Performance Impact of HDD
Yes, there is a performance difference, but its impact depends on your workload and caching:
* I/O Latency: HDDs have significantly higher seek times and lower throughput than SSDs. If your Materialized View (MV) is large and the query must read from disk (cold data), you will see slower query response times compared to SSD.
* Refresh Speed: Since asynchronous MVs must "write" results back to disk during a refresh, an HDD-backed MV will take longer to refresh than an SSD-backed one.
* Mitigation (Page Cache): StarRocks enables a Page Cache by default (typically 20% of memory). If your MV's "hot" data fits in memory, the performance difference between HDD and SSD becomes negligible for repeat queries.
* Recommendation: For high-concurrency, low-latency dashboard queries, it is recommended to set "storage_medium" = "SSD".
──────────
Materialized View vs. Logical View: When to use which?
Feature | ***Logical View*** | ***Materialized View (Async)***
Storage | No physical storage. | Physically stores pre-computed results.
Performance | No speedup (runs the full SQL every time). | High speedup (queries the pre-computed table).
Data Freshness | Always real-time. | Eventually consistent (depends on refresh interval).
Resource Usage | High CPU/Memory during query time. | CPU/Memory used during **refresh**; low usage during query.
Query Rewrite | No automatic rewrite. | Supports Transparent Rewrite (automatically speeds up existing queries).
Use a Logical View when:
* You only need to simplify complex SQL or wrap business logic (e.g., masking columns).
* The underlying data changes so frequently that a refresh would be constant.
* The query is already fast enough and you don't want to pay for extra storage.
Use an Asynchronous Materialized View when:
* Query Acceleration: Your queries involve heavy joins or aggregations that take seconds/minutes to run.
* Data Lake Integration: You want to accelerate queries against external data (Hive, Hudi, Iceberg) by caching results locally in StarRocks.
* Transparent Optimization: You want to speed up existing reports without changing the application's SQL (via Query Rewrite).
* Pre-aggregation: You are building a "Metric Store" or "Gold Layer" where data is rolled up (e.g., from raw logs to daily summaries).
References
• using_starrocks/async_mv/use_cases/data_modeling_with_materialized_views.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• sql-reference/sql-statements/materialized_view/CREATE_MATERIALIZED_VIEW.mdhc
06/24/2026, 4:49 PMRocky
06/24/2026, 4:50 PMstorage_medium shows as HDD when the disk is SSD
In StarRocks, the storage medium is determined by the storage_root_path setting in each BE's be.conf file.
* Explicit Labeling: If you do not add ,medium:ssd to your path, StarRocks may default to treating it as HDD.
* Default Behavior: If your be.conf looks like this: storage_root_path = /data/storage, StarRocks often defaults this to HDD.
* To Fix This: You must update the be.conf on every BE node to explicitly tell StarRocks it is an SSD:
bash
# Example be.conf change
storage_root_path = /data/storage,medium:ssd
Note: After changing this, you must restart the BE.
2. Why you can't find storage_medium in SHOW CREATE TABLE
SHOW CREATE TABLE typically only displays properties that are explicitly set or deviate from the system default.
* Inferred Defaults: If you didn't specify storage_medium during creation and the system defaulted it (based on your be.conf), the property is often hidden in the "Create Table" output because it is considered a default state.
* Where to check for sure: Instead of SHOW CREATE TABLE, you can check the actual metadata for each partition to see what medium is being used:
sql
SHOW PARTITIONS FROM <table_name>;
Look for the StorageMedium column in the results. This will show you exactly what the FE (Frontend) has assigned to that specific piece of data.
3. How to verify what the FE thinks about your disks
To see how the FE perceives your Backend storage, run:
sql
SHOW BACKENDS\G
In the Status column (which is a JSON string), you can often see the disk information. For more detail, you can use the internal process view:
sql
SHOW PROC '/backends';
Then find the BackendId and run:
sql
-- Replace <BackendId> with the actual ID
SHOW PROC '/backends/<BackendId>';
This will list each disk path on that BE and clearly show whether StarRocks thinks it is HDD or SSD.
Summary of Action Items:
1. Check SHOW PROC '/backends/<id>' to see the current detected medium.
2. If it says HDD but you have SSDs, update be.conf with ,medium:ssd in the storage_root_path.
3. Restart the BEs.
4. For existing tables/MVs, you may need to manually alter them if they were already created with the wrong medium:
sql
ALTER TABLE <name> MODIFY PARTITION (*) SET ("storage_medium" = "SSD");
References
• administration/management/BE_configuration.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• sql-reference/sql-statements/table_bucket_part_index/SHOW_PARTITIONS.md
References
• administration/management/FE_configuration.md
• deployment/environment_configurations.md
• deployment/plan_cluster.md
• administration/management/BE_configuration.md
• faq/Others.md
• sql-reference/sql-statements/cluster-management/nodes_processes/SHOW_BACKENDS.mdhc
06/24/2026, 4:55 PMRocky
06/24/2026, 4:55 PMstorage_medium is logically set to HDD in StarRocks, the impact is primarily on data placement logic and lifecycle management, rather than a direct software-imposed performance throttle.
Here is what happens in that scenario:
1. Physical Performance vs. Logical Label
* No "Artificial" Slowdown: StarRocks does not artificially slow down I/O just because a disk is labeled "HDD." Your physical SSD will still provide high IOPS and low latency.
* OS Scheduling: As long as your operating system is configured with the correct scheduler (like none or kyber for SSDs), the hardware will perform at its native speed.
2. Impact on Data Placement & Rebalancing
The storage_medium property is the "hint" that the Frontend (FE) uses to decide where to put your data.
* Priority: If your cluster has a mix of real HDDs and real SSDs (properly labeled in be.conf), and you set a table to HDD, the FE will avoid placing that table's data on your SSDs to save the "fast" space for other tables.
* Imbalance: If all your disks are SSDs but are labeled as HDD in the configuration, the FE will treat them all as a single tier of storage. You won't see a performance drop, but you lose the ability to use the "Storage Cooldown" feature.
3. Loss of "Storage Cooldown" (Tiered Storage)
This is the biggest functional loss. StarRocks has a feature where data starts on SSD (for fast ingestion/queries) and automatically migrates to HDD after a certain time (to save costs).
* Cooldown Requirement: This feature only works if the initial storage_medium is set to SSD.
* The Result: If your table is set to HDD from the start, StarRocks assumes it is already on the "cold/cheap" tier. It will never trigger a migration task, even if you configure storage_cooldown_ttl.
4. Background Task Priority
StarRocks uses the medium label to prioritize certain background operations:
* Migration Threads: There are specific BE configurations (like storage_medium_migrate_count) that control how many threads are used to move data between different mediums.
* Compaction: While compaction happens on both, the system's internal heuristics for managing I/O pressure are sometimes more aggressive on SSDs because they can handle higher concurrency. Labeling an SSD as an HDD might result in slightly more conservative background resource allocation in very high-load scenarios.
Summary: Should you fix it?
If your hardware is all SSD, you should ideally fix the labels to reflect reality.
Why fix it?
1. Future-Proofing: If you ever add actual HDDs later, your data placement logic will already be correct.
2. Tiering: It allows you to use storage_cooldown_ttl to manage your data lifecycle.
3. Accuracy: SHOW PROC '/backends/' and other monitoring tools will give you a truthful view of your cluster's resource utilization.
How to fix it:
1. Update be.conf for each BE: storage_root_path = /your/path,medium:ssd.
2. Restart the BEs.
3. Update existing tables: ALTER TABLE <name> MODIFY PARTITION (*) SET ("storage_medium" = "SSD");.
References
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• administration/management/FE_configuration.md
• faq/operation_maintenance_faq.md
• table_design/table_design.md
• faq/Others.md
• introduction/Architecture.mdhc
06/24/2026, 5:05 PMRocky
06/24/2026, 5:05 PMstorage_medium for many partitions is a safe operation in StarRocks. It is designed to be a background task that does not block your data's availability.
Here is a detailed breakdown of what happens when you run `ALTER TABLE ... MODIFY PARTITION (*)`:
1. Is there an immediate performance drop?
No. The ALTER command itself is a metadata-only operation in the Frontend (FE).
* No Heavy Locking: It does not take a long-term "exclusive lock" on the table. Your queries and data loading will continue to run normally.
* Metadata Change: The FE simply updates the "desired" storage medium for the tablets in its catalog and then returns "OK" to you almost instantly.
2. How the background migration works
Once the metadata is updated, the Frontend instructs the Backends (BEs) to begin migrating the physical data (tablets) from HDD to SSD.
* IO & CPU Usage: The migration involves reading data from the HDD and writing it to the SSD. This will consume some disk I/O and a small amount of CPU on the BE nodes.
* Throttling: To prevent this from slowing down your active queries, StarRocks limits how many migrations happen at once.
* Configuration: The speed is controlled by the BE parameter storage_medium_migrate_count (default is 3 threads). This means each BE will only move 3 tablets simultaneously, ensuring that background movement doesn't overwhelm the system.
3. Special Considerations for Materialized Views
Since an asynchronous Materialized View (MV) is physically stored as a table, you use the same command to alter it:
sql
-- Use the MV name just like a table name
ALTER TABLE your_mv_name MODIFY PARTITION (*) SET ("storage_medium" = "SSD");
* Refresh Tasks: The migration happens independently of the MV refresh process. If an MV refresh triggers while a migration is in progress, the new data generated by the refresh will be written directly to the SSD (the new target), while the old data continues to migrate in the background.
* No Integrity Risk: StarRocks ensures data consistency throughout the move. If a query hits a tablet that is currently being moved, it will simply read from the original (HDD) location until the migration of that specific tablet is 100% complete.
4. How to monitor the progress
You can track how many partitions have successfully moved to the SSD by running:
sql
SHOW PARTITIONS FROM your_table_or_mv_name;
Look at the StorageMedium column. It will update from HDD to SSD as each partition finishes its migration.
Summary Checklist
* Safety: High. It's a standard background operation.
* Impact: Low. I/O is throttled by storage_medium_migrate_count.
* Benefit: Once a tablet is moved to SSD, queries hitting that data will immediately start seeing the lower latency and higher throughput of the SSD hardware.
References
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• administration/management/BE_configuration.md
• faq/operation_maintenance_faq.md
References
• faq/operation_maintenance_faq.md
• using_starrocks/async_mv/use_cases/create_partitioned_materialized_view.md
• sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.mdRocky
06/24/2026, 5:05 PMhc
06/24/2026, 5:09 PMRocky
06/24/2026, 5:10 PMbe.conf to reflect this, altering the storage_medium property for your partitions is extremely safe and will not cause performance issues.
Here is exactly what happens in your specific scenario:
1. It becomes a "No-Op" (Metadata-only) change
When you run ALTER TABLE ... MODIFY PARTITION (*) SET ("storage_medium" = "SSD"), the StarRocks Frontend (FE) checks the current location of every tablet.
* The check: The FE looks at the disk where a tablet is stored and asks: "Is this disk an SSD?"
* The result: Since you have already updated your be.conf (adding ,medium:ssd) and restarted the BEs, the BEs are now reporting those disks as SSD to the FE.
* The behavior: Because the tablets are already sitting on disks that the system now recognizes as SSD, no physical data migration will occur. The FE simply updates the metadata for those partitions to match the reality of the hardware. This is nearly instantaneous.
2. Why there is no performance impact
* No Data Movement: Since the tablets don't need to move to a different disk, there is no disk I/O or network traffic generated by "migration."
* FE Metadata Update: Updating the label for thousands of partitions is a lightweight transaction in the FE's image/journal. It does not lock the table for queries or loads.
* Query Consistency: Your queries will continue to run against the same physical data. The only change is that StarRocks now "knows" it's on fast storage, which allows features like Storage Cooldown to be enabled in the future.
3. Recommended Order of Operations
To ensure this goes smoothly without any "Tablet Migrate Failed" errors, follow this order:
1. Update be.conf first: Add ,medium:ssd to your storage_root_path on all BE nodes.
2. Restart BEs: One by one (rolling restart) so the FE receives the updated disk reports.
3. Verify via PROC: Run SHOW PROC '/backends'; and click into a backend to verify that the StorageMedium for the paths now shows SSD.
4. Run the Alter: Execute the ALTER TABLE ... MODIFY PARTITION (*) command.
4. What about Materialized Views?
The same logic applies. If the underlying data for the MV is already on the disks that are now labeled SSD, the alter command will simply update the MV's metadata without moving a single byte of data.
Summary
Because you are not introducing new disks and are simply correcting the label of the existing disks, the "migration" is a logical one. You can safely run this on tables with a large number of partitions without worrying about resource contention or downtime.
References
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• administration/management/BE_configuration.md
• faq/operation_maintenance_faq.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
References
• faq/operation_maintenance_faq.md
• administration/management/FE_configuration.md
• table_design/table_design.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.md
• administration/management/resource_management/spill_to_disk.mdhc
08/12/2026, 1:02 PMRocky
08/12/2026, 1:02 PMsys.role_edges system view.
Using sys.role_edges
This view displays the relationships between roles and their grantees (either other roles or users).
To find all users assigned to a role named 'your_role_name', run:
sql
SELECT TO_USER
FROM sys.role_edges
WHERE FROM_ROLE = 'your_role_name'
AND TO_USER IS NOT NULL;
How to read the results:
* FROM_ROLE: The role you are interested in.
* TO_USER: The user to whom that role is granted.
* TO_ROLE: If this column is populated instead of TO_USER, it means the role was granted to another role (role inheritance).
Important Requirements
* Privileges: By default, you must have the user_admin system role to query this view.
* Availability: This view is available in StarRocks versions 3.0 and later.
Alternative: Checking a Specific User
If you want to go the other way and check what roles a specific user has, you can use:
sql
SHOW GRANTS FOR 'username'@'host';
References
• sql-reference/sys/role_edges.md
• administration/user_privs/authorization/User_privilege.md
• sql-reference/sql-statements/account-management/SHOW_ROLES.md
References
• sql-reference/sys/role_edges.md
• administration/user_privs/authorization/User_privilege.md
• sql-reference/sql-statements/account-management/SHOW_ROLES.md
• administration/user_privs/authorization/privilege_faq.mdhc
08/12/2026, 1:04 PMRocky
08/12/2026, 1:04 PMACCOUNT LOCK command like in some other databases (e.g., Oracle or standard MySQL). To achieve the same effect and prevent a user from logging in without deleting the account, you should use the following method:
1. Set Maximum Connections to 0
The most effective way to "lock" a user in StarRocks is to set their allowable connections to zero. This prevents any new sessions from being established for that user.
sql
-- Lock the user by setting max connections to 0
ALTER USER 'username' SET PROPERTIES ("max_user_connections" = "0");
2. How to "Unlock" the User
To allow the user to log in again, simply set the property back to a positive integer (the default is often 100 or higher depending on your cluster setup).
sql
-- Unlock the user by restoring connection limits
ALTER USER 'username' SET PROPERTIES ("max_user_connections" = "1000");
3. Alternative: Drop the User
If the user account is no longer needed at all, you can permanently remove it:
sql
DROP USER 'username'@'host';
Important Notes:
* Privileges: You must have the user_admin system role to perform these actions on other users.
* Metadata Only: Setting max_user_connections is a metadata change and takes effect immediately for all new connection attempts.
* Active Sessions: Locking a user via max_user_connections = 0 prevents new logins but may not automatically kill an existing active session. To kill an existing session, you can use:
sql
SHOW PROCESSLIST;
KILL [connection_id];
References
• sql-reference/sql-statements/account-management/ALTER_USER.md
• administration/user_privs/authentication/native_authentication.md
• faq/operation_maintenance_faq.md
References
• administration/user_privs/authentication/native_authentication.md
• deployment/post_deployment_setup.md
• quick_start/helm.md
• administration/user_privs/ssl_authentication.mdhc
08/12/2026, 1:23 PMGRANT USAGE ON CATALOG default_catalog TO ROLERocky
08/12/2026, 1:23 PMUSAGE on the default_catalog for a role to access internal data, but it is highly recommended to avoid friction with certain commands.
Here is the breakdown of how the default_catalog behaves regarding the USAGE privilege:
1. Implicit Access for Queries
By default, when a user connects to StarRocks (via MySQL client or JDBC), they are placed inside the default_catalog automatically.
* If a role has privileges on a specific database or table (e.g., GRANT SELECT ON ALL TABLES IN DATABASE my_db TO ROLE my_role), the user can query those objects without having an explicit USAGE grant on the default_catalog.
* Because you are already "inside" the internal catalog upon login, the system does not strictly block data access for lack of the catalog-level USAGE privilege.
2. When USAGE is Required
Even for the default_catalog, the USAGE privilege is required if the user needs to:
* Run SHOW CATALOGS: Without USAGE, the default_catalog will not appear in the list.
* Run SET CATALOG default_catalog: If the user has switched to an external catalog (like a Hive or Iceberg catalog) and wants to switch back to the internal one, the SET CATALOG command requires USAGE on the target catalog.
* Run SHOW DATABASES FROM default_catalog: This explicit metadata query requires catalog-level usage.
3. Best Practice
To ensure a consistent experience (especially if your users might switch between catalogs), it is standard practice to grant USAGE on the default_catalog to the public role. Since every user in StarRocks automatically inherits the public role, this ensures everyone can see the internal catalog and switch back to it if they leave.
sql
-- This ensures all users can always see and switch back to the internal catalog
GRANT USAGE ON CATALOG default_catalog TO ROLE public;
Summary: For basic SELECT queries on internal tables where the user is already in the default context, you don't need it. For a fully functional role that can navigate the system, you should grant it.
References
• data_source/catalog/default_catalog.md
• administration/user_privs/authorization/privilege_item.md
• sql-reference/sql-statements/account-management/GRANT.md
• administration/user_privs/authorization/built_in_roles.md
• data_source/catalog/iceberg/iceberg_rest_security.md
References
• administration/user_privs/authorization/privilege_item.md
• data_source/catalog/default_catalog.md
• data_source/catalog/iceberg/iceberg_rest_security.md
• administration/user_privs/authorization/built_in_roles.md
• administration/user_privs/authorization/user_privs.mdhc
08/12/2026, 1:32 PMRocky
08/12/2026, 1:32 PMGRANT syntax for those objects in StarRocks does not currently support fully qualified names that include the catalog (e.g., you cannot do GRANT SELECT ON TABLE default_catalog.db.tbl).
Here is the breakdown of how it works:
1. The Context Matters
The GRANT command for databases and tables operates on the current catalog of your session.
_ If you just logged in, your session is automatically set to default_catalog by default. In this case, you do not _need* to run SET CATALOG default_catalog; because you are already there.
* However, if you have previously executed SET CATALOG some_external_catalog; in your current session, any subsequent GRANT ON DATABASE ... or GRANT ON TABLE ... will attempt to apply to that external catalog.
2. When you MUST use SET CATALOG
You must run SET CATALOG if:
* You want to grant permissions on objects in a catalog other than the one you are currently in.
* You are writing an automation script and want to be 100% sure the permissions are applied to the correct catalog regardless of the connection's initial state.
3. Example Workflow
To grant permissions on a database inside the internal catalog:
sql
-- Ensure you are in the internal catalog
SET CATALOG default_catalog;
-- Grant permissions on the database
GRANT ALL PRIVILEGES ON DATABASE my_internal_db TO ROLE my_role;
-- Grant permissions on all tables in that database
GRANT SELECT ON ALL TABLES IN DATABASE my_internal_db TO ROLE my_role;
Exceptions
* Catalog-level grants: Commands like GRANT USAGE ON CATALOG default_catalog TO ROLE my_role; do not require you to be in that catalog first, as the catalog name is explicitly part of the syntax.
* System-level grants: Commands like GRANT CREATE RESOURCE ON SYSTEM TO ROLE my_role; are global and do not depend on the catalog context.
Summary: While default_catalog is the default upon login, it is a best practice to include SET CATALOG default_catalog; in setup scripts to ensure the GRANT statements target the correct metadata layer.
References
• sql-reference/sql-statements/account-management/GRANT.md
• data_source/catalog/default_catalog.md
• administration/user_privs/authorization/privilege_item.md
References
• sql-reference/sql-statements/account-management/GRANT.mdhc
08/13/2026, 11:35 AMALTER USER 'new_user'@'%' REQUIRE SSL;Rocky
08/13/2026, 11:35 AMALTER USER 'new_user'@'%' REQUIRE SSL; will not work in StarRocks.
While StarRocks is compatible with the MySQL wire protocol, it does not currently support the per-user REQUIRE SSL syntax in CREATE USER or ALTER USER statements.
How to Force SSL in StarRocks
StarRocks (v3.4.1 and later) manages SSL enforcement at the cluster level rather than the user level. To force all users to use SSL, you must configure the Front End (FE) nodes via the fe.conf file:
1. Enable SSL by providing your keystore details in fe.conf.
2. Force SSL by setting the following parameter:
properties
ssl_force_secure_transport = true
When this is set to true, the FE will reject any connection that is not encrypted with SSL.
Summary of SSL support
* Availability: Introduced in version 3.4.1.
* Global Enforcement: Controlled by ssl_force_secure_transport in fe.conf.
* Per-User Enforcement: Not currently supported. You cannot selectively require SSL for some users while allowing cleartext for others.
If you attempt to run ALTER USER ... REQUIRE SSL, you will likely receive a syntax error because the parser does not recognize the REQUIRE clause for the ALTER USER statement.
References
• administration/user_privs/ssl_authentication.md
• sql-reference/sql-statements/account-management/ALTER_USER.md
• sql-reference/sql-statements/account-management/CREATE_USER.md
References
• administration/user_privs/ssl_authentication.md
• sql-reference/sql-statements/account-management/CREATE_USER.mdhc
08/14/2026, 10:18 AMSUBMIT TASK my_hourly_task
SCHEDULE EVERY 1 HOUR
AS
TRUNCATE TABLE target_table;
INSERT INTO target_table SELECT * FROM source_table;Rocky
08/14/2026, 10:18 AMSUBMIT TASK currently only supports a single ETL statement (like INSERT or CREATE TABLE AS SELECT). It cannot execute multiple statements separated by semicolons.
2. Schedule Syntax: The SCHEDULE clause requires the INTERVAL keyword and parentheses.
Recommended Solution
In StarRocks, the standard way to perform a "truncate and reload" operation in a single atomic step is using INSERT OVERWRITE. This replaces the data in the target table with the results of the query without needing a separate TRUNCATE command.
Corrected Query:
sql
SUBMIT TASK my_hourly_task
SCHEDULE EVERY(INTERVAL 1 HOUR)
AS
INSERT OVERWRITE target_table
SELECT * FROM source_table;
Key Differences:
* INSERT OVERWRITE: This is the best practice for refreshing a table. It is more efficient than TRUNCATE + INSERT because it handles the data swap atomically.
* Schedule Clause: Must be EVERY(INTERVAL 1 HOUR).
* Atomicity: INSERT OVERWRITE ensures that the table is never empty for users querying it during the reload; the old data is only replaced once the new data is fully prepared.
Monitoring your task:
After submitting, you can check the status and history of your task using these system views:
sql
-- View task definition
SELECT * FROM INFORMATION_SCHEMA.tasks WHERE task_name = 'my_hourly_task';
-- View execution history
SELECT * FROM INFORMATION_SCHEMA.task_runs WHERE task_name = 'my_hourly_task';
References
• sql-reference/sql-statements/loading_unloading/ETL/SUBMIT_TASK.md
• loading/InsertInto.md
• sql-reference/sql-statements/loading_unloading/INSERT.md
References
• sql-reference/sql-statements/loading_unloading/ETL/SUBMIT_TASK.md
• loading/InsertInto.mdhc
08/17/2026, 12:09 PMRocky
08/17/2026, 12:10 PMSHOW GRANTS depend on whose permissions you are trying to view:
1. To view your own permissions (SHOW GRANTS;):
No special permissions are required. Every user is allowed to see their own granted privileges and assigned roles.
2. To view permissions for another user or role (SHOW GRANTS FOR <user_or_role>;):
You must have the user_admin system-defined role. Only users with this role (or the db_admin / root which inherit high-level privileges) can inspect the privileges of other identities in the cluster.
Summary Table
Statement | Required Permission/Role
SHOW GRANTS; | None (any user can run this)
SHOW GRANTS FOR 'user'@'%'; | user_admin role
SHOW GRANTS FOR ROLE role_name; | user_admin role
Alternative: System Views
If you are an administrator and want to query permissions across the entire system using SQL filters, you can also query the following system views (which also require the user_admin role by default):
* sys.grants_to_users
* sys.grants_to_roles
References
• sql-reference/sql-statements/account-management/SHOW_GRANTS.md
• administration/user_privs/authorization/User_privilege.md
• sql-reference/sys/grants_to_users.md
References
• sql-reference/sql-statements/account-management/SHOW_GRANTS.md
• administration/user_privs/authorization/User_privilege.md
• sql-reference/sys/grants_to_users.md
• sql-reference/sys/grants_to_roles.md
References
• sql-reference/sql-statements/account-management/SHOW_GRANTS.md
• sql-reference/sys/grants_to_users.md
• sql-reference/sys/grants_to_roles.md
• sql-reference/information_schema/schema_privileges.md
• administration/user_privs/authorization/User_privilege.mdhc
08/17/2026, 12:15 PM* sys.grants_to_users
* sys.grants_to_rolesRocky
08/17/2026, 12:15 PMgrants_to_users shows privileges granted directly to users, while grants_to_roles shows privileges granted to roles.
1. List privileges granted directly to Users
This query shows which users have been given specific permissions directly (without a role).
sql
SELECT
GRANTEE,
OBJECT_TYPE,
OBJECT_NAME,
PRIVILEGE_TYPE,
IS_GRANTABLE
FROM sys.grants_to_users;
2. List privileges granted to Roles
This query shows the permissions assigned to each user-defined role.
sql
SELECT
GRANTEE AS ROLE_NAME,
OBJECT_TYPE,
OBJECT_NAME,
PRIVILEGE_TYPE,
IS_GRANTABLE
FROM sys.grants_to_roles;
3. Bonus: See which Users have which Roles
If you want to see the "Grantee → Role" mapping to understand which users inherit the permissions from the query above, use the role_edges view:
sql
SELECT
GRANTEE,
ROLE
FROM sys.role_edges;
Key Column Descriptions:
* GRANTEE: The user (e.g., 'rachel'@'%') or the role name receiving the permission.
* OBJECT_TYPE: The level of the privilege (e.g., DATABASE, TABLE, SYSTEM).
* OBJECT_NAME: The specific name of the database or table.
* PRIVILEGE_TYPE: The actual action allowed (e.g., SELECT, INSERT, CREATE TABLE).
Note: Accessing these views requires the user_admin role.
References
• sql-reference/sys/grants_to_users.md
• sql-reference/sys/grants_to_roles.md
• sql-reference/sys/role_edges.md
References
• sql-reference/sys/grants_to_users.md
• sql-reference/sys/grants_to_roles.md
• sql-reference/information_schema/column_privileges.md
• sql-reference/sys/sys.md
• sql-reference/sys/role_edges.mdhc
08/17/2026, 12:20 PMsys.grants_to_users
sys.grants_to_roles
sys.role_edgesRocky
08/17/2026, 12:20 PMUNION ALL to combine the data from these three views into a single result set.
The following query identifies the Grantee (the user), whether the permission is Direct or comes from a Role, and the specific Object and Privilege details:
sql
-- 1. Get privileges granted directly to users
SELECT
GRANTEE,
'Direct' AS GRANTED_VIA,
OBJECT_TYPE,
CONCAT_WS('.', OBJECT_CATALOG, OBJECT_DATABASE, OBJECT_NAME) AS OBJECT,
PRIVILEGE_TYPE
FROM sys.grants_to_users
UNION ALL
-- 2. Get privileges granted to users via roles
SELECT
re.TO_USER AS GRANTEE,
re.FROM_ROLE AS GRANTED_VIA,
gr.OBJECT_TYPE,
CONCAT_WS('.', gr.OBJECT_CATALOG, gr.OBJECT_DATABASE, gr.OBJECT_NAME) AS OBJECT,
gr.PRIVILEGE_TYPE
FROM sys.role_edges re
JOIN sys.grants_to_roles gr ON re.FROM_ROLE = gr.GRANTEE
WHERE re.TO_USER IS NOT NULL;
Explanation:
* sys.grants_to_users: Provides privileges explicitly assigned to a user account.
* sys.role_edges: Acts as the bridge, mapping which users (TO_USER) belong to which roles (FROM_ROLE).
* sys.grants_to_roles: Provides the actual permissions assigned to those roles.
* CONCAT_WS: Used here to create a readable string of the object path (Catalog.Database.Table).
Note on Nested Roles:
If your RBAC structure uses nested roles (roles granted to other roles), this query will only show permissions for roles granted directly to users. To see the full inheritance tree for deeply nested roles, you would typically need a recursive query or to inspect the role_edges view repeatedly.
References
• sql-reference/sys/grants_to_users.md
• sql-reference/sys/grants_to_roles.md
• sql-reference/sys/role_edges.md
References
• sql-reference/sys/role_edges.md
• sql-reference/sys/grants_to_roles.md
• sql-reference/sys/grants_to_users.md
• sql-reference/sys/sys.md
• sql-reference/information_schema/schema_privileges.mdhc
08/17/2026, 12:59 PMsqlalchemy.exc.ProgrammingError: (pymysql.err.ProgrammingError) (1064, 'StarRocks planner use long time 3204 ms in logical phase, This probably because 1. FE Full GC, 2. Hive external table fetch metadata took a long time, 3. The SQL is very complex. You could 1. adjust FE JVM config, 2. try query again, 3. enlarge new_planner_optimize_timeout session variable')Rocky
08/17/2026, 12:59 PMStarRocks planner use long time ... in logical phase (Error 1064) occurs when the StarRocks query optimizer (the "planner") exceeds its allotted time limit (default 3000ms) while trying to generate an execution plan.
This is usually caused by one of three reasons:
1. Complex SQL: The query has a large number of joins or subqueries that require more time to optimize.
2. FE Full GC: The Frontend (FE) is experiencing a "Stop-the-World" Garbage Collection, pausing the planner's work.
3. Slow Metadata Access: For external tables (like Hive or Iceberg), fetching metadata from the remote metastore is taking too long.
Recommended Solutions
1. Increase the Optimizer Timeout (Quick Fix)
If the query is complex but valid, you can increase the timeout for the current session or globally.
* Session Level:
sql
SET new_planner_optimize_timeout = 10000; -- Set to 10 seconds
* Global Level:
sql
SET GLOBAL new_planner_optimize_timeout = 10000;
2. Check and Adjust FE Memory (Long-term Fix)
If this happens frequently or for simple queries, it is likely a Full GC issue.
* Diagnose: Check the fe.gc.log (located in the FE log/ directory) or run jstat -gcutil <FE_PID> 1000 to see if the Old Generation memory (O) is near 100%.
* Fix: Increase the JVM heap size in fe/conf/fe.conf. Locate the JAVA_OPTS line and increase -Xmx and -Xms.
_ _Example:* For clusters with ~1 million tablets, at least 16GB is recommended (-Xmx16g -Xms16g).
_ _Rule of thumb:* If your FE has more than 32GB of RAM, you can set -Xmx to 80% of total memory.
3. Optimize External Metadata (If applicable)
If you are querying Hive/Iceberg/JDBC tables:
* Ensure the connection to the external Metastore is stable.
* Check if you can enable or refresh the Metadata Cache for the specific catalog to speed up planning.
Summary of System Variables
Variable | Default | Unit | Description
new_planner_optimize_timeout | 3000 | ms | Max time the optimizer can spend planning a query.
query_timeout | 300 | sec | Max time the query is allowed to run after planning.
References
• faq/Sql_faq.md
• sql-reference/System_variable.md
• faq/loading/Loading_faq.md
• faq/fe_mem_faq.md
• administration/management/FE_configuration.md
References
• faq/Sql_faq.md
• sql-reference/System_variable.md
• faq/loading/Loading_faq.md
• faq/fe_mem_faq.md
• administration/management/FE_configuration.md
• faq/Others.md
References
• knowledge/trouble_shooting/fe_memory_problems.md
• faq/Others.md
• faq/fe_mem_faq.md
• administration/management/FE_configuration.md
• faq/operation_maintenance_faq.md
• administration/Meta_recovery.md
• administration/management/monitoring/Monitor_and_Alert.mdhc
08/17/2026, 1:02 PMnew_planner_optimize_timeoutRocky
08/17/2026, 1:02 PMnew_planner_optimize_timeout does not require restarting the StarRocks FE.
It is a system variable, which means you can modify it dynamically using the SET command. The change takes effect immediately:
* For the current session only:
sql
SET new_planner_optimize_timeout = 10000;
* Globally (for all future sessions):
sql
SET GLOBAL new_planner_optimize_timeout = 10000;
Note: If you set it globally, existing connections will not see the change; only new connections established after the command will use the new value.
Difference between "System Variables" and "FE Configs"
* System Variables (like this one): Set via SQL, no restart needed.
* FE Configurations (found in fe.conf): Usually require a restart unless they are explicitly marked as "mutable" in the documentation.
References
• sql-reference/System_variable.md
• faq/loading/Loading_faq.md
• administration/management/FE_configuration.md
References
• sql-reference/System_variable.md
• administration/management/FE_configuration.md
• faq/loading/Loading_faq.mdhc
08/17/2026, 1:03 PMSET GLOBAL new_planner_optimize_timeout = 10000;Rocky
08/17/2026, 1:04 PMSET GLOBAL is sufficient to persist the change.
In StarRocks, when you run SET GLOBAL new_planner_optimize_timeout = 10000;, the value is automatically persisted in the Frontend (FE) metadata (stored in the edit logs and image files).
* No fe.conf changes needed: You do not need to add this variable to the fe.conf file.
* Survives Restarts: Because it is stored in the metadata, the value will remain 10000 even if you restart the FE nodes or the entire cluster.
* Effect on Sessions:
* New sessions: All connections created after the command is run will use the new value.
* Existing sessions: Connections that are already open will continue to use the old value. To update an active session without reconnecting, run SET new_planner_optimize_timeout = 10000; (without GLOBAL).
Summary of Persistence
Action | Persistence | Scope
SET <var> = ... | No (Lost after session ends) | Current session only
SET GLOBAL <var> = ... | Yes (Stored in FE metadata) | All future sessions
References
• sql-reference/System_variable.md
• administration/management/FE_configuration.md
• faq/loading/Loading_faq.md
References
• sql-reference/System_variable.md
• administration/management/FE_configuration.mdhc
08/28/2026, 10:52 AM- SQL connectivity to staging works: DELETE statements on port 9030 complete successfully.
- The subsequent stream-load request to the staging FE/load-balancer on port 8030 fails with:
('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))Rocky
08/28/2026, 10:52 AMConnectionResetError(54, 'Connection reset by peer') during a Stream Load is a common networking issue that typically occurs because the TCP connection is abruptly closed by the server-side (the Frontend, Backend, or an intermediate Load Balancer).
Since your DELETE statements (metadata operations) work on port 9030 but the PUT request (data transfer) fails on port 8030, the most likely causes are related to how Stream Load handles data and redirection.
1. Network Redirection (The 307 Redirect)
StarRocks Stream Load follows a two-step process:
1. The client sends a PUT request to the Frontend (FE) on port 8030.
2. The FE responds with an HTTP 307 Temporary Redirect, directing the client to a specific Backend (BE) node on port 8040.
3. The client then sends the actual data to that BE node.
The Problem:
If your client or Load Balancer is in a different network than the StarRocks nodes, the FE might be redirecting the client to a private IP address of a BE that the client cannot reach.
* Check: Verify if the client can reach the BE nodes directly on port 8040.
* Fix: Ensure the BE nodes are configured with reachable IPs in their priority_networks setting, or use a reverse proxy (like Nginx) that handles the redirection for the client.
2. Load Balancer Timeouts and Body Size Limits
Because Stream Load involves sending large payloads, many standard Load Balancer configurations will drop the connection if:
* client_max_body_size (Nginx) / Payload Limit: The data file exceeds the LB's allowed request size. The LB will send a TCP RST (reset), resulting in your error.
* Idle Timeout: The LB closes the connection if it doesn't see progress within a few seconds.
3. Missing Expect: 100-continue Header
StarRocks expects the Expect: 100-continue header for Stream Load. This allows the FE to tell the client "Yes, I am ready" (or "Redirect to this BE") before the client starts uploading a massive file.
* If your client (e.g., a Python script using requests) starts streaming the body immediately without waiting for the 100-continue response, and the FE tries to send a Redirect or an Error, the connection may be reset by the LB or the FE.
* Fix: Ensure your code sends the Expect: 100-continue header.
4. BE Configuration (streaming_load_max_mb)
If the file you are uploading is larger than the BE's limit (default 10GB), the BE may reject it.
* Check: BE configuration streaming_load_max_mb.
* Note: Usually, this returns a specific HTTP error message, but in some network environments, it can trigger a connection reset.
Troubleshooting Steps
1. Try curl first: Use the official recommended command to rule out client library issues:
bash
curl --location-trusted -u <user>:<pass> -H "Expect:100-continue" \
-T <file_path> http://<fe_host>:8030/api/<db>/<table>/_stream_load
The --location-trusted flag is critical as it allows curl to follow the 307 redirect and pass credentials to the BE.
2. Verify Port 8040: From the machine running the load, try to telnet or nc to one of the BE nodes on port 8040. If this is blocked, Stream Load will fail after the FE redirect.
3. Check LB Logs: Look at your Load Balancer logs (Nginx/ALB/F5) for any "Request Entity Too Large" or "Connection timed out" errors.
References
• loading/StreamLoad.md
• faq/loading/Stream_load_faq.md
• sql-reference/sql-statements/loading_unloading/STREAM_LOAD.md
• administration/management/FE_configuration.md
• administration/management/resource_management/Load_balance.mdRocky
08/28/2026, 10:52 AMhc
08/28/2026, 11:51 AM- SQL connectivity to staging works: DELETE statements on port 9030 complete successfully.
- The subsequent stream-load request to the staging FE/load-balancer on port 8030 fails with:
('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))Rocky
08/28/2026, 11:51 AMConnection reset by peer error during a Stream Load, you should examine logs in the following locations, ordered by the most likely source of the reset:
1. Load Balancer / Proxy Logs (If applicable)
If you are using a Load Balancer (like Nginx, HAProxy, or an AWS ALB) on port 8030, this is the most common place where the connection is reset.
* What to look for: Look for "413 Request Entity Too Large," "504 Gateway Timeout," or explicit TCP reset messages.
* Why: LBs often have a client_max_body_size or idle timeout that is shorter than the time required to stream your data.
2. Frontend (FE) Logs
The FE handles the initial handshake and redirects the client to a BE.
* fe.audit.log: Check if the PUT request even reached the FE. If it’s not here, the connection was dropped by the network/LB before StarRocks saw it.
* fe.log / fe.warn.log: Search for the label of your load or "StreamLoad". If the FE is rejecting the request (e.g., due to authentication or full task queues), it will be logged here.
* Location: ${STARROCKS_HOME}/log/
3. Backend (BE) Logs
Since Stream Load redirects the data flow to a BE node (typically on port 8040), the BE is often the "peer" that resets the connection if it encounters an issue mid-stream.
* <http://be.INFO|be.INFO> or be.WARNING: Search for the TxnId or the Label of your load. Look for "fail to receive data" or "close connection" messages.
* be.out: If the BE process itself encountered a low-level error or a crash (rare), it might be logged here.
* Location: ${STARROCKS_HOME}/log/
4. BE Error Log (Data Errors)
If the connection is reset because of a specific data quality issue that caused the BE to abort:
* error_log: Check the directory ${STARROCKS_HOME}/storage/error_log. These files contain specific rows that failed validation.
Summary Checklist for your specific error:
1. Check fe.audit.log: Did the FE receive the request?
2. Check <http://be.INFO|be.INFO> on all BEs: Search for the load label. If you see "connection closed by client," the problem is on your application/network side. If you see a BE-side error, that is the cause.
3. Validate Port 8040: The most common cause for "Connection Reset" after the initial request is that the client cannot reach the Backend IP on port 8040 after being redirected by the FE.
References
• administration/management/logs.md
• loading/loading_introduction/troubleshooting_loading.md
• faq/loading/Stream_load_faq.md
• loading/StreamLoad.md
References
• administration/management/logs.md
• loading/loading_introduction/troubleshooting_loading.md
• faq/loading/Stream_load_faq.md
• loading/StreamLoad.md
References
• administration/management/logs.md
• loading/loading_introduction/troubleshooting_loading.mdhc
08/28/2026, 12:10 PM- SQL connectivity to staging works: DELETE statements on port 9030 complete successfully.
- The subsequent stream-load request to the staging FE/load-balancer on port 8030 fails with:
('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))Rocky
08/28/2026, 12:10 PMConnectionResetError on port 8030 usually occurs because of how the ELB handles the HTTP 307 Redirect or the large data payload.
Here are the most common causes and how to fix them:
1. The "Unreachable BE" Problem (307 Redirect)
StarRocks Stream Load is a two-step process:
1. Handshake: Your application sends a PUT request to the ELB (port 8030).
2. Redirect: The FE responds with an HTTP 307 Temporary Redirect, providing the private IP and port (8040) of a Backend (BE) node.
3. Data Transfer: Your application then tries to connect directly to that BE IP.
Why it fails: If your application is running outside the VPC (e.g., on your local machine or a different network), it cannot reach the BE's private IP. When the client attempts this connection and fails, or if the ELB resets the connection because it doesn't support the redirected flow, you get a Connection Reset.
* Solution: Use a Network Load Balancer (NLB) instead of an ALB if possible. NLBs are more transparent for StarRocks traffic.
* Alternative: If using an ALB, ensure your client is within the same VPC as the StarRocks cluster, or use a proxy that handles the redirection (like Nginx) to keep the traffic within the ELB.
2. Missing Expect: 100-continue Header
StarRocks requires the Expect: 100-continue header.
* The Issue: Without this header, your application may start streaming the data immediately. If the FE/LB tries to send the 307 Redirect while the client is still pushing data, the TCP window can become desynchronized, leading the AWS ELB to send a TCP RST (Reset).
* Solution: In Python (Requests), this is not always enabled by default for all versions. In curl, it is automatic. Ensure your application explicitly waits for the 100 Continue response before sending the body.
3. AWS ALB Idle Timeout
The default AWS ELB idle timeout is 60 seconds.
* The Issue: If your Stream Load takes longer than 60 seconds to stream or if there is a lull in data packets (common with large files or complex transformations), the ELB will abruptly close the connection.
* Solution: Increase the Idle Timeout in your AWS ELB attributes to a higher value (e.g., 3600 seconds).
4. BE Port 8040 is Blocked
The ELB might only be configured to listen on port 8030.
* The Issue: After the 307 redirect, the client needs to talk to the BE on port 8040. If your Security Groups only allow 8030 (FE) and 9030 (MySQL), the connection to the BE will be blocked, causing a timeout or reset.
* Solution: Ensure the Security Group for your BE nodes allows inbound traffic on port 8040 from your application/ELB.
Troubleshooting Steps
1. Check Redirection: Run the load using curl -v --location-trusted .... Look at the Location: header in the response. If it contains a private IP (e.g., 10.x.x.x), your client must be able to route to that IP.
2. Verify direct BE access: From the application server, try telnet <BE_IP> 8040. If it fails, the redirection will never work.
3. Bypass the LB: If possible, try to Stream Load directly to a BE's IP on port 8040 to see if the error persists. If it works directly but fails via ELB, the ELB configuration (timeout or header handling) is the culprit.
References
• loading/StreamLoad.md
• faq/loading/Stream_load_faq.md
• administration/management/FE_configuration.md
• administration/management/resource_management/Load_balance.md
References
• quick_start/helm.mdhc
08/28/2026, 12:11 PM- The subsequent stream-load request to the staging FE/load-balancer on port 8030 fails with:
('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))Rocky
08/28/2026, 12:12 PMConnectionResetError through an AWS NLB, the issue is usually related to how the NLB manages TCP sessions, target health, or the specific network path to the Backends (BEs).
Since it "worked before," look for changes in your environment related to the following four areas:
1. The 350-Second NLB Idle Timeout
AWS Network Load Balancers have a fixed idle timeout of 350 seconds (approx. 5.8 minutes) that cannot be changed.
* The Problem: If your data file has grown or your network speed has slowed, and the connection remains "idle" (no TCP packets sent) for more than 350 seconds, the NLB will drop the connection and send a TCP RST (Reset).
* Why it worked before: Your previous loads likely finished within this window.
* The Fix:
* Enable TCP Keepalives on your client-side (e.g., in your Python requests or urllib3 configuration).
* If the file is large, split it into smaller chunks or increase the streaming_load_max_mb and speed up the transfer.
2. Unhealthy Targets or Cluster Scaling
If you recently added, removed, or restarted nodes, the NLB may be resetting connections.
* The Problem: When an NLB target (FE) is marked unhealthy, the NLB immediately sends a TCP RST for any packets received on existing client connections to that target.
* Check: Go to the AWS Console -> Target Groups -> Your FE Target Group. Ensure all FEs are Healthy. Check the TCP_ELB_Reset_Count metric in CloudWatch; a spike here confirms the NLB is the source of the reset.
* Cross-Zone Balancing: If you have FEs in multiple Availability Zones but "Cross-Zone Load Balancing" is disabled (the default for NLB), and a node in one zone goes down, clients hitting that zone's IP will get resets.
3. Port 8040 & Security Group Changes
Stream Load is a two-step process. The NLB handles the request to port 8030, but the FE then redirects the client to a BE node.
1. Request: Client -> NLB (8030) -> FE (8030).
2. Redirect: FE returns a 307 Temporary Redirect to a BE IP on port 8040.
3. Data: Client -> BE (8040).
* The Problem: If a Security Group rule was recently tightened and port 8040 is no longer open to your client, the connection will fail.
* Why it resets: Sometimes the "Reset" is actually the client or an intermediate proxy giving up when the BE is unreachable.
* The Fix: Ensure port 8040 is open from the client to all BE private/public IPs.
4. Client IP Preservation & Asymmetric Routing
By default, NLBs with "Instance" targets preserve the Client IP.
* The Problem: If you recently changed VPC routing, NACLs, or added a NAT Gateway, the return traffic from the FE/BE might be trying to take a different path than the inbound traffic (Asymmetric Routing). AWS will drop these packets and reset the connection.
* The Fix: If your client is in a different VPC or outside AWS, try disabling "Client IP Preservation" on the NLB Target Group attributes (this changes the source IP to the NLB's private IP, which often fixes routing loops).
Recommended Troubleshooting Steps
1. Bypass the NLB: Try to run the curl command directly against an FE's private/public IP. If it works, the issue is strictly the NLB configuration.
2. Use `curl -v`: Look for the Location header in the response. Check if that IP:Port (usually 8040) is reachable from your application server.
3. Check FE Logs: Look at fe.warn.log or fe.audit.log. If you see the request there, the FE received it and the reset happened after the handshake (likely during the redirect or data transfer).
References
• loading/StreamLoad.md
• faq/loading/Stream_load_faq.md
• administration/management/FE_configuration.mdRocky
08/28/2026, 12:12 PMhc
08/28/2026, 1:23 PM- The subsequent stream-load request to the staging FE/load-balancer on port 8030 fails with:
('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))Rocky
08/28/2026, 1:24 PMConnectionResetError (54) with larger data is almost certainly caused by one of three specific "threshold" issues related to time, memory, or network routing.
1. The 350-Second NLB Idle Timeout
The most common cause for "Connection Reset" with an AWS NLB is its fixed 350-second (5.8 minute) idle timeout.
* The Issue: If your data transfer takes longer than 350 seconds, or if there is a period of "silence" while the BE is processing a large batch (e.g., during a memory flush), the NLB will silently drop the connection. When your application or the StarRocks BE tries to send the next packet, the NLB responds with a TCP RST (Reset).
* The Fix:
* Enable TCP Keepalives: Ensure your client library (e.g., Python requests or Java HttpClient) has TCP keepalives enabled. This sends small packets to keep the NLB session active.
* Split the Data: Instead of one massive load, split the data into smaller chunks (e.g., 1-2 GB each) that complete within 5 minutes.
* Check NLB Metrics: In AWS CloudWatch, check the TCP_ELB_Reset_Count metric. A spike here during your load confirms the NLB is the culprit.
2. StarRocks Internal Timeouts
With larger data, you may be hitting StarRocks' own safety limits.
* stream_load_default_timeout_second (FE): The default is 600 seconds. If the load takes longer than this, the FE will abort the transaction, and the BE will close the connection.
* Solution: Pass a higher timeout header in your request: -H "timeout:3600".
* streaming_load_max_mb (BE): If your data exceeds this limit (default 10GB or 100GB depending on version), the BE may abort.
* Solution: Verify this in be.conf or check the <http://be.INFO|be.INFO> logs for "body exceed max size".
3. Asymmetric Routing and MTU (NLB Specific)
Larger data transfers involve significantly more packets and higher throughput, which can expose network configuration flaws that smaller loads don't trigger.
* Client IP Preservation: If your NLB has "Client IP Preservation" enabled and your BEs are in a private subnet, the return traffic from the BE might attempt to bypass the NLB and go directly to the client. This "Asymmetric Routing" causes the client's OS to reset the connection because it's receiving packets from an IP it didn't initiate a connection with.
* Solution: In the NLB Target Group settings, try disabling Client IP Preservation.
* MTU Mismatch: Large data packets (especially if using Jumbo Frames 9001 MTU inside AWS) that cross into a network with a standard 1500 MTU can be dropped if "Fragmentation" isn't handled correctly, leading to a reset.
4. BE Memory Pressure
Large loads require significant memory for buffering and sorting (controlled by write_buffer_size in be.conf, default 100MB).
* The Issue: If the load is so large that it pushes the BE over its load_process_max_memory_limit_percent (default 30% of BE memory), the BE will kill the process to protect the system, resulting in an immediate connection reset.
* Check: Search the be.WARNING logs for "memory limit exceeded" or "cancel load job".
Recommendation: How to identify the culprit
1. Check FE Logs (fe.audit.log and fe.warn.log): If the load is logged with a status like CANCELLED and a message "timeout," increase the timeout header.
2. Check BE Logs (<http://be.INFO|be.INFO>): Search for the Label of your load. If you see "connection closed by peer," the NLB or Client timed out. If you see an internal error followed by "close connection," the BE is the source.
3. Bypass the NLB: If possible, try the same large load directly against a BE IP on port 8040. If it works, the issue is 100% the AWS NLB configuration (Timeout or Client IP Preservation).
References
• loading/StreamLoad.mdRocky
08/28/2026, 1:24 PMhc
08/28/2026, 1:29 PM- The subsequent stream-load request to the staging FE/load-balancer on port 8030 fails with:
('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))Rocky
08/28/2026, 1:30 PMConnectionResetError (Error 54) on port 8030 (the FE/NLB) specifically during "subsequent" requests after successfully processing smaller data, the issue is likely rooted in how the AWS Network Load Balancer (NLB) manages TCP state and connection persistence.
Because it worked for smaller data but fails now, and occurs on "subsequent" attempts, here are the most likely causes and solutions:
1. NLB 350-Second Idle Timeout (Most Likely)
AWS NLBs have a hard-coded 350-second (5.8 minute) idle timeout.
* The Issue: When you perform a Stream Load, your application establishes a connection to the FE (port 8030) to get the redirect to a BE. Even if you then send the data "directly" to the BE IP, your application's HTTP client library often keeps the original connection to the FE/NLB open in a connection pool for re-use.
* The Failure: If your large data transfer to the BE takes longer than 350 seconds, the NLB will silently drop the "idle" connection to the FE. When your application tries to start the next Stream Load by re-using that pooled connection, the NLB sees traffic for a session it no longer tracks and sends a TCP RST (Reset), resulting in the ConnectionResetError.
* The Fix:
* Disable Connection Pooling: Configure your client (e.g., Python requests.Session()) to close the connection after each load, or set a max_idle_time for the pool significantly lower than 300 seconds.
* Enable TCP Keepalives: Ensure your OS and client library are sending TCP keepalive packets to prevent the NLB from timing out the session.
2. Missing Expect: 100-continue Header
StarRocks expects the Expect: 100-continue header for Stream Loads.
* The Issue: For larger data, if your client sends the HTTP headers and starts pushing the request body before the FE has a chance to process the handshake/redirect, the NLB can become overwhelmed or desynchronized. If the FE closes the socket to send the 307 Redirect while the client is still pushing data, the NLB will reset the connection.
* The Fix: Ensure your request explicitly includes the header -H "Expect: 100-continue". This forces the client to wait for a "Go ahead" from the FE before it sends any part of the body.
3. NLB "Diamond Routing" (Flow Collision)
If you have Cross-Zone Load Balancing and Client IP Preservation both enabled on your NLB, you can hit a known AWS issue called "Flow Collision."
* The Issue: High-throughput loads from a single client can cause the NLB to map different connections to the same internal backend using the same 5-tuple (source IP/port, dest IP/port). This causes the NLB to reset the "colliding" connection.
* The Fix:
1. Go to your NLB Target Group attributes.
2. Disable "Client IP Preservation" OR Disable "Cross-Zone Load Balancing".
_ _Note: Disabling Client IP Preservation is usually the safer fix as it changes the source IP to the NLB's private IP, avoiding routing collisions.*
4. StarRocks Transaction Timeout
While the error appears on port 8030, it could be triggered by an internal FE timeout.
* The Issue: If the large data load takes longer than the FE's stream_load_default_timeout_second (default 600s), the FE will abort the transaction. If your client is still trying to communicate with the cluster via the LB during this abort, the connection can be reset.
* The Fix: Increase the timeout in your request header: -H "timeout:3600".
Recommended Troubleshooting
1. Verify via `curl`: Run the load using curl -v --location-trusted .... If curl works while your application fails, your application's connection pooling is the culprit.
2. Check NLB Metrics: In CloudWatch, look for TCP_ELB_Reset_Count. If this spikes exactly when your load fails, the NLB is explicitly closing the connection.Rocky
08/28/2026, 1:30 PMfe.audit.log for the Label of the failed load. If it doesn't even appear in the audit log, the connection was reset by the NLB before it ever reached the StarRocks FE.
References
• faq/operation_maintenance_faq.md
• quick_start/helm.md
• faq/loading/Stream_load_faq.md
• loading/StreamLoad.md
• administration/management/monitoring/metrics.md
• sql-reference/sql-statements/loading_unloading/STREAM_LOAD.md
• loading/Stream_Load_transaction_interface.mdhc
08/28/2026, 1:33 PM('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))Rocky
08/28/2026, 1:34 PMrequests or Java's HttpClient) keep this connection open in a pool to reuse it for the next request.
* The Problem: While your application is busy sending large amounts of data "directly" to the BE IP, the initial connection to the NLB/FE (port 8030) sits idle.
* The Failure: AWS NLBs have a fixed 350-second idle timeout. If your direct data transfer to the BE takes longer than ~5.8 minutes, the NLB silently drops the idle connection to the FE.
* The Result: When your application finishes the first load and attempts a "subsequent" load, it tries to reuse the now-dead connection in its pool. The NLB responds with a TCP RST (Reset), leading to the ConnectionResetError.
* The Fix:
* Disable Connection Pooling: In your application, set the HTTP headers to Connection: close for the request to the FE, or configure your client library to not persist connections.
* Shorten Pool TTL: Set your connection pool's "Max Idle Time" to something lower than 300 seconds.
2. BE Memory Pressure (BE-Side Reset)
If you are certain the reset is happening during the data transfer to the BE (port 8040), the BE may be abruptly closing the connection because it ran out of memory or hit a safety limit.
* load_process_max_memory_limit_percent: By default, StarRocks limits the memory used by all loading tasks to 30% of the BE's total memory. If a very large load pushes the BE over this limit, the BE will kill the loading thread to protect the system, which causes an immediate TCP Reset.
* Check: Look at the be.WARNING or <http://be.INFO|be.INFO> logs for the string memory limit exceeded or cancel load job.
* streaming_load_max_mb: The default is 10 GB (pre-v3.0) or 100 GB (v3.0+). If your data exceeds this, the BE will stop reading and close the socket.
* Check: Search BE logs for body exceed max size.
3. MTU and Segment Size Issues
Large data transfers result in many full-sized TCP segments.
* The Issue: If there is an MTU mismatch between your application server and the BE (e.g., your app server is using a standard 1500 MTU but the BE/VPC is configured for Jumbo Frames 9001, or vice versa), large packets may be dropped or rejected by network interfaces or intermediate security groups, resulting in a reset.
* The Fix: Ensure the MTU is consistent across your network path (usually 1500 is the safest for cross-VPC or external traffic).
4. StarRocks Transaction Timeout
* The Issue: If the large load takes longer than the FE's stream_load_default_timeout_second (default 600 seconds), the FE will abort the transaction and notify the BE. The BE will then close the connection.
* The Fix: Increase the timeout in your request header: -H "timeout:3600" (setting it to 1 hour).
Summary of Actions
1. Check FE Audit Logs: Look for the "Label" of the failed load. If the state is CANCELLED with a type: TIMEOUT, increase your timeout header.
2. Check BE Info Logs: Search for Connection reset by peer or memory limit exceeded.
3. App Configuration: If using Python requests, try using a fresh Session() or explicitly closing the connection after the redirect step to ensure the NLB timeout doesn't poison your pool.
ReferencesRocky
08/28/2026, 1:34 PMhc
08/28/2026, 2:36 PM- The subsequent stream-load request to the staging FE/load-balancer on port 8030 fails with:
('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))
This provides stronger evidence that the issue is intermittent routing/connectivity before the FE redirects to a BE:
- The same 10-row chunk can fail with `ConnectionResetError(54)` and then succeed on a retry.
- Therefore it is not caused by payload size or by a malformed row in that chunk.
- Every failed attempt resets before the FE returns a redirect, so no BE IP is available for those failed attempts.Rocky
08/28/2026, 2:37 PMrequests or Java HttpClient) usually keeps that initial "FE connection" open in a connection pool for future use.
* The Trigger: AWS NLBs have a hard-coded 350-second idle timeout. If your direct-to-BE data transfer takes longer than 5.8 minutes, the NLB silently drops the idle connection to the FE.
* The Error: When your app attempts a "subsequent" load, it pulls that "dead" connection from its pool. The NLB, having discarded the state, responds with a TCP RST, causing the ConnectionResetError(54).
* The Fix:
* Disable connection pooling in your application for the redirect request.
* Or, set your application's Connection Max Idle Time to 60 seconds (well below the 350s limit).
2. Flow Collisions / Diamond Routing (The "Intermittent" Failure)
This explains why a 10-row chunk might fail once but succeed on a retry.
* The Mechanism: This happens when an NLB has both Client IP Preservation and Cross-Zone Load Balancing enabled.
* The Trigger: If multiple connections from the same client IP/port attempt to reach the FE, the NLB can occasionally map a new connection to an internal "flow" that is still being cleaned up or exists in another AZ. This results in a "Flow Collision," where the NLB sends an immediate TCP RST.
* The Fix:
1. Go to the AWS Target Group settings for your FE (port 8030).
2. Disable "Client IP Preservation". This causes the FE to see the NLB's private IP instead of the client's, which resolves the routing collision.
3. Alternatively, Disable "Cross-Zone Load Balancing", though disabling Client IP Preservation is the standard fix for intermittent resets.
3. StarRocks FE Backlog (Less Likely but Possible)
If the NLB is healthy, the FE itself might be dropping the connection if it cannot handle the initial handshake fast enough.
* Check: In your fe.warn.log, look for "connect processor exception" or "IOException: Connection reset by peer."
* Fix: If you see these, you may need to increase the OS-level backlog on the FE host:
bash
# Increase the maximum number of pending connections
sysctl -w net.core.somaxconn=1024
Summary of Recommended Actions
1. NLB Level: Disable Client IP Preservation in the FE Target Group.
2. Application Level: Ensure you are not reusing connections that have been idle for more than 300 seconds. If using Python, use a new requests.Session() or set headers={'Connection': 'close'} for the initial request to port 8030.
3. CloudWatch Metrics: Monitor the TCP_ELB_Reset_Count metric. If it spikes during these failures, it confirms the NLB is the source of the RST packets.
References
• faq/operation_maintenance_faq.md
• loading/StreamLoad.md
• faq/loading/Stream_load_faq.md
• administration/management/FE_configuration.md
References
• faq/operation_maintenance_faq.md
• faq/loading/Stream_load_faq.mdhc
08/28/2026, 2:57 PM('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))Rocky
08/28/2026, 2:58 PMExpect: 100-continue (Most Common)
This is the most frequent cause of ConnectionResetError when sending Stream Loads directly to an FE.
* The Issue: StarRocks FEs do not want to receive the data body; they only want the headers so they can decide which BE should handle the load. If your application sends the HTTP request headers and immediately starts streaming the data body, the FE will attempt to send a 307 Temporary Redirect and close the connection.
* The Reset: If the FE closes the socket while your application is still pushing the data body, the FE's network stack sends a TCP RST (Reset). Your application receives this reset before it can process the 307 Redirect response, making it appear as if the FE "never sent the redirect."
* The Fix: Ensure your HTTP client is configured to use the Expect: 100-continue header. This forces the client to send the headers, wait for a 100 Continue from the FE, and then send the data (or follow the redirect).
2. FE HTTP Thread Pool Exhaustion
The FE uses a worker thread pool to handle incoming HTTP requests on port 8030.
* The Issue: If you have many concurrent loads or high-latency network connections, the FE might exhaust its http_worker_threads_num. When the pool is full, the FE may drop new connections or take so long to respond that the client/LB resets.
* The Fix:
* Check fe.conf for http_worker_threads_num. The default is typically 0 (which scales to 2x CPU cores). You can try increasing this to 1024 or higher if you have high concurrency.
* Check for qe_max_connection (default 4096), although this primarily limits MySQL/Query connections.
3. OS-Level TCP Backlog (somaxconn)
If the FE is receiving bursts of requests, the operating system's listen backlog might be overflowing.
* The Issue: When the number of pending TCP connections exceeds the kernel limit, the OS will reject or reset new connections.
* Verification: Run the following on the FE host:
bash
netstat -s | grep TCPBacklogDrop
If the count is increasing, the backlog is too small.
* The Fix: Increase the somaxconn limit on the FE host:
bash
sysctl -w net.core.somaxconn=2048
4. FE Transaction Limits
StarRocks has internal limits on the number of concurrent transactions.
* max_running_txn_num_per_db: Default is 1000. If your application is starting thousands of transactions simultaneously, the FE will reject new ones.
* stream_load_max_txn_num_per_be (v3.3+): If set, this limits how many loads a single "BE" (or client IP seen by the FE) can have in progress.
* Check: Look in fe.warn.log for messages like streamload txn num per be exceeds limit or current running txns exceed limit.
5. FE Memory/GC Pressure
If the FE is undergoing a Full GC or is low on memory, it may become unresponsive and drop connections.
* Verification: Search fe.log for Full GC or java.lang.OutOfMemoryError.
* The Fix: Ensure the FE has sufficient JVM heap (at least 8GB-16GB for production) and check fe.conf for -Xmx settings.
Summary Checklist
1. Headers: Verify your app sends Expect: 100-continue.
2. FE Logs: Search fe.warn.log for connect processor exception or IOException: Connection reset by peer.
3. Audit Logs: Check fe.audit.log. If the failed request doesn't appear there at all, the reset happened at the TCP/Handshake layer (OS Backlog or Network). If it appears with a status, the FE logic rejected it.
References
• faq/operation_maintenance_faq.mdRocky
08/28/2026, 2:58 PMhc
08/28/2026, 3:02 PM('Connection aborted.', ConnectionResetError(54, 'Connection reset by peer'))Rocky
08/28/2026, 3:02 PMConnectionResetError at the FE IP address before a redirect is issued, the problem is almost certainly a protocol conflict between your application's HTTP client and the StarRocks FE's HTTP server.
The most likely causes are:
1. Missing Expect: 100-continue Header (Most Common)
When you send a Stream Load to an FE, the FE reads only the headers to decide which BE should handle the data. It then immediately sends a 307 Temporary Redirect response.
* The Conflict: If your application (especially if using Python requests) starts sending the data body immediately after the headers without waiting for the FE's permission, the FE will send the redirect and close the socket while your application is still pushing data.
* The Result: When a server closes a socket while the client is still sending data, the network stack triggers a TCP RST (Reset). Your application receives ConnectionResetError(54) and fails before it can even see the 307 Redirect message.
* The Fix: You must configure your HTTP client to use the Expect: 100-continue header. This forces the client to send headers first and wait for the FE to say "Continue" (or "Redirect") before it starts uploading the payload.
_ _Python Example:* requests.put(url, data=data, headers={'Expect': '100-continue'})
2. FE Not in a "Leader" or "Providing Service" State
If the FE you are hitting is not the Leader or is having metadata issues, it may abruptly close the connection.
* Check FE Status: Run SHOW FRONTENDS; in your MySQL client.
* Verify that IsMaster (Leader) is true for at least one node.
* Verify Alive is true for the node you are targeting.
* Check IP Mismatch: If the FE host has multiple network interfaces, verify the priority_networks in fe.conf. If the FE is bound to a different IP than what the client is hitting, it may reset connections.
3. FE HTTP Thread Pool Exhaustion
If the FE’s HTTP server is overwhelmed, it will reject new connections immediately.
* The Fix: Check fe.conf for the following parameters and consider increasing them:
* `http_worker_threads_num`: Default is 0 (scales with CPU). Try setting it to 1024.
* Check FE Logs: Look at fe.warn.log for java.io.IOException: Connection reset by peer or Too many open files.
4. OS-Level TCP Backlog (somaxconn)
If you are sending many requests at once, the Linux kernel's queue for "pending" connections might be full, causing the OS to reset the connection before the StarRocks process even sees it.
* The Fix: Increase the system-wide limit on both the FE and the client machine:
bash
# Check current limit
cat /proc/sys/net/core/somaxconn
# Increase to 2048
sysctl -w net.core.somaxconn=2048
5. Incorrect URL Syntax
Ensure you are hitting the specific Stream Load API endpoint. If you hit a generic FE port with the wrong path, the FE may close the connection.
* Correct Syntax: http://<fe_ip>:8030/api/<db>/<table>/_stream_load
Diagnostic Steps
1. Test with `curl`: Run a test from the application server using curl. Curl handles the Expect: 100-continue and redirect logic automatically:
bash
curl --location-trusted -u user:pass -H "Expect:100-continue" \
-T test_file.csv http://<FE_IP>:8030/api/<db>/<table>/_stream_load
If curl works but your app fails, the issue is your application's HTTP header/pooling configuration.
2. Check FE Audit Log: Look at fe/log/fe.audit.log. If you do not see the failed requests listed there, the connection is being reset by the OS or Network before the StarRocks application can log it.
References
• sql-reference/sql-statements/loading_unloading/STREAM_LOAD.md
• faq/operation_maintenance_faq.mdhc
08/31/2026, 12:36 PMReceive packet header failed, remote IP address may close the channel.Rocky
08/31/2026, 12:36 PMReceive packet header failed, remote IP address may close the channel is a specific warning from the StarRocks MySQL protocol handler (typically running on port 9030).
If you are seeing this log while your Stream Load is failing with a ConnectionResetError, it points to one of two scenarios:
Scenario 1: Port Misconfiguration (Targeting 9030)
The most likely reason for this specific log appearing during a Stream Load is that your application is accidentally sending the HTTP PUT request to the MySQL port (9030) instead of the HTTP port (8030).
* The Conflict: The FE expects a 4-byte MySQL packet header on port 9030. When it receives an HTTP header (e.g., PUT /api/...), the packet parsing fails immediately.
* The Log: The FE logs Receive packet header failed and closes the connection.
* The Error: Your client sees Connection reset by peer because the FE aborted the "illegal" MySQL connection.
* The Fix: Ensure your Stream Load URL uses the correct port (default 8030 for FE).
Scenario 2: The Log is a "Red Herring" (Load Balancer Checks)
If you are certain you are hitting port 8030, this log message is likely unrelated to the Stream Load failure. It is a common side effect of:
* Load Balancer Health Checks: If you have an AWS NLB or proxy checking port 9030, it will open and close connections without sending MySQL packets, triggering this log every few seconds.
* MySQL Client Connection Pooling: If your application also connects to StarRocks via MySQL to check table status before loading, and it closes those connections abruptly, you will see this log.
If Scenario 2 is true, why is Stream Load failing?
If you are hitting the correct port (8030), the ConnectionResetError(54) is usually caused by the HTTP "Expect: 100-continue" Handshake:
1. The Issue: StarRocks FE reads only headers and then sends a 307 Redirect. If your client starts sending the data body before it receives that redirect, the FE will close the socket to stop the data flow it doesn't want to handle.
2. The Result: Your client receives a TCP RST (Reset) because it was still sending data to a closing socket. This results in the ConnectionResetError before the client can read the redirect.
3. The Fix:
* Add Header: Ensure your request includes the header "Expect: 100-continue".
* Use Curl for Testing: Verify the load works with curl --location-trusted -H "Expect:100-continue". If curl works but your code fails, your HTTP library is not handling the 100-continue/307-redirect handshake correctly.
Summary Checklist
* Verify Port: Double-check that your code is hitting http://<FE_IP>:8030 and not port 9030.
* Verify Headers: Ensure "Expect: 100-continue" is present in your request.
* NLB Settings: If using an AWS NLB, ensure Client IP Preservation is disabled in the FE Target Group, as this can cause intermittent resets due to "Flow Collisions."
References
• faq/operation_maintenance_faq.md
• loading/StreamLoad.md
• faq/loading/Stream_load_faq.md
• administration/management/FE_configuration.md
References
• faq/loading/Stream_load_faq.md
• loading/StreamLoad.md
• administration/management/monitoring/metrics.md
• quick_start/helm.md
• sql-reference/sql-statements/loading_unloading/STREAM_LOAD.mdhc
09/01/2026, 2:24 PMReceive packet header failed, remote IP address may close the channel.Rocky
09/01/2026, 2:24 PMReceive packet header failed, remote IP address may close the channel is almost certainly a red herring (unrelated) to your Stream Load failure.
1. Why that log message is likely unrelated
This specific log entry is generated by the MysqlChannel in the StarRocks FE. It occurs when a connection is opened to the MySQL port (9030) but is closed before a valid MySQL packet header (4 bytes) is sent.
* Common Cause: Load balancer health checks (like AWS NLB or K8s Readiness Probes) frequently "ping" port 9030 to see if it's open and then immediately close the connection.
* Proof: You mentioned that after restarting Stage, the Stream Loads succeeded, but the log message persisted. This confirms the log is coming from a background process (like an LB) and not your ETL helper.
2. How to inspect the packet headers
If you want to verify what exactly is hitting your FE and causing both the log and the ConnectionResetError, you can use tcpdump on the FE host.
To inspect the MySQL port (9030) triggering the log:
Run this to see which IP is hitting port 9030 and what they are sending:
bash
sudo tcpdump -i any port 9030 -X -vv
* If you see "empty" connections that open and immediately close (FIN/RST), it's a health check.
* If you see your ETL server's IP hitting this port, your helper function is accidentally targeting the wrong port.
To inspect the Stream Load port (8030) where the reset occurs:
This will help you see if the FE is sending the 307 Redirect before the RST (Reset) packet:
bash
sudo tcpdump -i any port 8030 -A -vv
Look for the following sequence:
1. Client -> FE: PUT /api/... with Expect: 100-continue
2. FE -> Client: HTTP/1.1 307 Temporary Redirect
3. The Reset: If you see a [RST] packet immediately after the FE sends the 307, but the client is still pushing data, the client is ignoring the 307 and forcing the FE to reset the connection.
3. Why did a restart "fix" it?
Since a restart resolved the ConnectionResetError in Stage, the issue was likely resource exhaustion on the FE rather than a code bug:
* HTTP Thread Exhaustion: The FE might have run out of http_worker_threads_num. Even with 100-continue, if no threads are available to process the header, the connection might time out or reset.
* TCP Backlog: If the OS-level somaxconn is full, the kernel will reset connections before they reach the StarRocks application.
* Memory/GC Pressure: If the FE was in a long "Stop-the-World" GC pause, it would stop responding to heartbeats and active connections, leading to resets.
Recommended Next Steps
1. Check FE Threads: Check your fe.conf for http_worker_threads_num. If it's at the default (0/dynamic), consider setting it to 1024.
2. Check FE Logs for GC: Search fe.gc.log (if enabled) or fe.log for "Full GC" or "Pause" messages around the time of the failure.
3. Check Audit Log: Look at fe.audit.log. If the failed Stream Loads are not in the audit log, the FE never successfully parsed the HTTP request, pointing to a network/OS limit issue.
References
• faq/operation_maintenance_faq.md
• loading/StreamLoad.md
• administration/management/FE_configuration.md
• faq/loading/Stream_load_faq.md
• administration/management/monitoring/metrics.md
References
• faq/operation_maintenance_faq.md
• administration/Meta_recovery.md
• faq/loading/Loading_faq.md
• faq/Others.mdhc
09/01/2026, 2:29 PMhttp_worker_threads_numRocky
09/01/2026, 2:29 PMhttp_worker_threads_num, you must modify the configuration file and restart the FE node, as this parameter is not mutable (it cannot be changed dynamically via SQL).
Steps to change:
1. Locate the configuration file:
Navigate to the conf directory of your StarRocks FE installation and open fe.conf.
bash
vi /path/to/starrocks/fe/conf/fe.conf
2. Add or update the parameter:
Find http_worker_threads_num. If it doesn't exist, add it to the file.
properties
# Example: Setting it to 1024
http_worker_threads_num = 1024
* Note: The default value is 0, which StarRocks interprets as 2 * CPU_cores. If you are seeing connection resets under high load, setting this to a fixed higher value (like 1024) is a common troubleshooting step.
3. Restart the FE node:
You must restart the FE for the change to take effect.
bash
# Stop the FE
/path/to/starrocks/fe/bin/stop_fe.sh
# Start the FE
/path/to/starrocks/fe/bin/start_fe.sh --daemon
4. Verify the change:
Log into StarRocks via your MySQL client and run:
sql
ADMIN SHOW FRONTEND CONFIG LIKE 'http_worker_threads_num';
Important Considerations:
* Not Dynamic: Because Is mutable is No for this parameter, using ADMIN SET CONFIG ("http_worker_threads_num" = "1024"); will not work.
* High Concurrency: If you increase this value significantly, monitor the FE's memory usage and the OS file descriptor limit (ulimit -n), as each thread and active connection consumes resources.
* Load Balancers: If you are using an AWS NLB or similar, ensure your idle timeout settings on the balancer are compatible with your Stream Load durations to-be-increased thread capacity to be-loaded data transfer times.
References
• administration/management/FE_configuration.md
• faq/loading/Stream_load_faq.md
• administration/management/Configuration.md
References
• administration/management/FE_configuration.mdhc
09/02/2026, 11:17 AMReceive packet header failed, remote IP address may close the channel.Rocky
09/02/2026, 11:18 AMReceive packet header failed, remote IP address may close the channel remains a red herring (unrelated) to your actual Stream Load success or failure. It is triggered by a connection attempt to the MySQL port (9030) that closes prematurely—most likely a health check from a load balancer (NLB/ALB) or Kubernetes probe that occurs regardless of your data loading.
The reason your Stream Load fails with a "Delete then Insert" flow but succeeds with an "Overwrite" flow is likely due to Transaction/Lock Contention or Metadata Overhead causing a delay that triggers an HTTP timeout.
1. Why "Delete then Insert" Fails
When you perform a manual delete (either via a separate SQL command or a complex WHERE filter in Stream Load) followed by an insert, several things happen:
* Transaction Complexity: For Primary Key tables, a DELETE and an INSERT are row-level operations that require the FE to lock and update the primary key index (metadata). This is significantly more resource-intensive than a bulk overwrite.
* Latency & 100-Continue: If the FE is busy processing the "Delete" logic or waiting for a lock to be released, it may delay sending the 100 Continue response. If your client or an intermediate proxy (like an AWS NLB) has a short timeout, it will close the connection (RST), leading to the Connection reset by peer error.
* Version Explosion: Doing frequent deletes and inserts creates many small data versions. If the FE is under pressure or the BE is busy compacting these versions, the transaction "Begin" or "Commit" phase can slow down significantly.
2. Why "Overwrite" Succeeds
Whether you are using INSERT OVERWRITE or the PARTITION OVERWRITE feature in a Stream Load:
* Atomic Metadata Swap: Overwrite operations in StarRocks are generally metadata-level swaps. The system writes the new data into a temporary structure and then "swaps" it with the existing data in one atomic, efficient step.
* Low Lock Contention: It avoids the row-by-row locking and index updates required by a standard DELETE.
* Speed: Because it is faster, the FE can respond to the Expect: 100-continue handshake and the subsequent 307 Redirect much more quickly, preventing your client or proxy from timing out and resetting the connection.
How to verify this
If you want to prove this is a timeout/contention issue:
1. Check FE Audit Log: Look for the DELETE and INSERT commands. Check the query_time and status. If the DELETE takes several seconds, it's likely holding up the subsequent load.
2. Monitor FE Memory/GC: During the "Delete then Insert" flow, check if the FE is experiencing Full GC. Large metadata updates (deletes) can trigger heavy memory usage, causing the FE to pause and drop connections.
3. Tcpdump: As suggested before, run tcpdump -i any port 8030 -vv on the FE. You will likely see a long gap between the client's PUT request and the FE's response, after which the client sends a [RST] because it gave up.
Recommended Action
Continue using the Overwrite method. In StarRocks, bulk "Delete then Insert" is an anti-pattern for large datasets. Using Partition Overwrite or Primary Key Upsert is the architecturally correct way to handle this:
* For Primary Key tables: Simply stream the new data; StarRocks handles the row-level replacement (upsert) automatically and much more efficiently.
* For other tables: Use the PARTITION OVERWRITE feature during Stream Load to replace specific data ranges.
References
• loading/StreamLoad.md
• sql-reference/sql-statements/loading_unloading/STREAM_LOAD.md
• loading/Load_to_Primary_Key_tables.md
• faq/operation_maintenance_faq.mdRocky
09/02/2026, 11:18 AMhc
09/02/2026, 12:08 PMNo matching function with signature: initcap_java(varchar(65533)Rocky
09/02/2026, 12:08 PMNo matching function with signature: initcap_java(varchar(65533)) indicates that StarRocks cannot find a function named initcap_java that accepts a VARCHAR argument in your current context.
1. Is initcap_java a Custom UDF?
initcap_java is not a built-in StarRocks function. It appears to be a Java User Defined Function (UDF) that was likely created by your team or imported from another system.
To check if the function exists and see its defined signature, run:
sql
-- Check for functions in the current database
SHOW FUNCTIONS;
-- Check for global functions
SHOW GLOBAL FUNCTIONS;
If you find it, check the Argument types column. If it was created with a different type (e.g., INT or multiple arguments), it won't match a VARCHAR input.
2. Common Causes for the Signature Error
* Database Scope: If the UDF was created in a specific database (e.g., analytics_db), you must either be in that database or call it using the fully qualified name: analytics_db.initcap_java(column).
* Global vs. Local: If it's not a GLOBAL UDF, it is only visible within the database where it was created.
* Type Mismatch: In the Java code (the evaluate method), the input must be java.lang.String to match VARCHAR. If the CREATE FUNCTION statement used a different type than what is being passed, this error occurs.
3. Recommended Solution: Use the Built-in initcap
StarRocks already has a built-in, high-performance C++ function called initcap() that does exactly what you need (converts the first letter of each word to uppercase).
Try replacing initcap_java with the native `initcap`:
sql
SELECT initcap('hello world');
-- Result: "Hello World"
Using the native function is preferred because:
1. Performance: It is significantly faster than a Java UDF (no JVM overhead or data serialization).
2. Maintenance: No need to manage JAR files or UDF declarations.
3. Stability: It is a core part of the engine and won't have "missing signature" issues for standard string types.
4. If you must use the Java UDF
If you have custom logic in initcap_java that the built-in function doesn't provide:
1. Verify the definition: Ensure you ran CREATE FUNCTION with (VARCHAR) as the argument.
2. Check the JAR: Ensure the evaluate method in your Java class is public String evaluate(String str).
3. Check the call: If your column is CHAR or STRING, try an explicit cast: initcap_java(CAST(col AS VARCHAR)).
References
• sql-reference/sql-functions/string-functions/initcap.md
• sql-reference/sql-functions/JAVA_UDF.md
References
• sql-reference/sql-functions/string-functions/initcap.md
• sql-reference/sql-functions/string-functions/upper.md
• sql-reference/sql-functions/string-functions/ucase.md
• sql-reference/System_limit.md
• sql-reference/System_variable.md
• knowledge/usage/best-practice.md
• sql-reference/sql-functions/string-functions/left.md
• release_notes/release-3.5.mdhc
09/02/2026, 12:16 PMRocky
09/02/2026, 12:16 PMdb.udf) is required depends on how the function was created and your current session context:
1. Global UDFs (Recommended)
If the function was created using the GLOBAL keyword (supported since v3.0), you do not need to reference the database name. It can be called from any database or catalog.
* Syntax: CREATE GLOBAL FUNCTION my_func(...)
* Usage: SELECT my_func(col) FROM table;
2. Database-Specific UDFs
If the function was created without the GLOBAL keyword, it belongs to a specific database namespace.
* If you are in the same database: You do not need the prefix.
sql
USE my_db;
SELECT my_func(col) FROM table; -- Works
* If you are in a different database: You must use the prefix.
sql
USE other_db;
SELECT my_db.my_func(col) FROM table; -- Required
* Cross-Catalog: If you are accessing the function from a different catalog, the full path is required: catalog_name.db_name.func_name().
How to Check
If you are unsure how a function was defined, you can check its scope:
* SHOW FUNCTIONS; — Lists functions in the current database.
* SHOW GLOBAL FUNCTIONS; — Lists functions available globally.
Summary
Function Type | Reference Required?
Global UDF | No
Database UDF | Only if calling from a different database
References
• sql-reference/sql-functions/JAVA_UDF.md
• sql-reference/sql-statements/Function/CREATE_FUNCTION.md
• sql-reference/sql-functions/Python_UDF.md
References
• sql-reference/sql-functions/JAVA_UDF.md
• sql-reference/sql-functions/Python_UDF.md
• sql-reference/sql-statements/Function/CREATE_FUNCTION.mdhc
09/03/2026, 5:08 PMRocky
09/03/2026, 5:09 PMSHOW FULL TABLES command. This is the most direct way to see the type of every object in a database.
sql
SHOW FULL TABLES;
Output example:
Tables_in_db | Table_type
orders_table | BASE TABLE
active_orders_view | VIEW
orders_summary_mv | MATERIALIZED VIEW
* BASE TABLE: A standard StarRocks table.
* VIEW: A logical view (no data stored).
* MATERIALIZED VIEW: An asynchronous or synchronous materialized view.
──────────
2. The Queryable Way (Information Schema)
If you need to filter or join results in a script, query the information_schema.tables and information_schema.materialized_views tables.
* To find Tables and Logical Views:
sql
SELECT TABLE_NAME, TABLE_TYPE
FROM information_schema.tables
WHERE TABLE_SCHEMA = 'your_db_name';
Note: In some versions, Materialized Views may also appear here as BASE TABLE. To be certain, cross-reference with the next query.
* To find Materialized Views specifically:
sql
SELECT TABLE_NAME
FROM information_schema.materialized_views
WHERE TABLE_SCHEMA = 'your_db_name';
──────────
3. Check a Specific Object
If you have an object name and want to see its definition (which confirms its type), use the SHOW CREATE commands:
* For a Table: SHOW CREATE TABLE <name>;
* For a View: SHOW CREATE VIEW <name>;
* For a Materialized View: SHOW CREATE MATERIALIZED VIEW <name>;
4. Specialized Commands
* Materialized Views only: Run SHOW MATERIALIZED VIEWS; to see detailed metadata like refresh status and last refresh time.
* Dependencies: If you want to see which base tables a materialized view depends on, query the system view:
sql
SELECT * FROM sys.object_dependencies WHERE object_name = 'your_mv_name';
References
• sql-reference/information_schema/tables.md
• sql-reference/information_schema/materialized_views.md
• sql-reference/sql-statements/materialized_view/SHOW_MATERIALIZED_VIEW.md
• sql-reference/sys/object_dependencies.md
References
• using_starrocks/Materialized_view-single_table.md
• using_starrocks/async_mv/Materialized_view.md
• table_design/table_design.md
• sql-reference/sys/object_dependencies.md
• sql-reference/information_schema/tables.mdhc
09/03/2026, 5:24 PMSELECT TABLE_NAME, TABLE_TYPE
FROM information_schema.tables
WHERE TABLE_SCHEMA = 'your_db_name';
SELECT TABLE_NAME
FROM information_schema.materialized_views
WHERE TABLE_SCHEMA = 'your_db_name';Rocky
09/03/2026, 5:24 PMLEFT JOIN between information_schema.tables and information_schema.materialized_views.
In some versions of StarRocks, Materialized Views (MVs) are reported as VIEW or BASE TABLE in the standard tables metadata. By joining them, you can override that label whenever a match is found in the materialized views registry.
The Combined Query
Replace 'your_db_name' with your actual database name:
sql
SELECT
t.TABLE_NAME,
CASE
WHEN mv.TABLE_NAME IS NOT NULL THEN 'MATERIALIZED VIEW'
WHEN t.TABLE_TYPE = 'BASE TABLE' THEN 'TABLE'
ELSE t.TABLE_TYPE
END AS OBJECT_TYPE
FROM information_schema.tables t
LEFT JOIN information_schema.materialized_views mv
ON t.TABLE_SCHEMA = mv.TABLE_SCHEMA
AND t.TABLE_NAME = mv.TABLE_NAME
WHERE t.TABLE_SCHEMA = 'your_db_name'
ORDER BY OBJECT_TYPE, t.TABLE_NAME;
How this works:
1. LEFT JOIN: It takes everything from the tables list (which includes standard tables and views).
2. mv.TABLE_NAME IS NOT NULL: If an entry exists in the materialized_views table with the same name, we prioritize labeling it as a MATERIALIZED VIEW.
3. t.TABLE_TYPE: If no match is found in the MV table, it falls back to the default type (e.g., VIEW for logical views or BASE TABLE for physical tables).
Alternative: Using UNION
If you prefer to see only the distinct lists merged:
sql
SELECT TABLE_NAME, TABLE_TYPE
FROM information_schema.tables
WHERE TABLE_SCHEMA = 'your_db_name'
AND TABLE_NAME NOT IN (SELECT TABLE_NAME FROM information_schema.materialized_views WHERE TABLE_SCHEMA = 'your_db_name')
UNION ALL
SELECT TABLE_NAME, 'MATERIALIZED VIEW' AS TABLE_TYPE
FROM information_schema.materialized_views
WHERE TABLE_SCHEMA = 'your_db_name';
References
• sql-reference/information_schema/tables.md
• sql-reference/information_schema/materialized_views.md
• sql-reference/sql-statements/materialized_view/SHOW_MATERIALIZED_VIEW.md
References
• sql-reference/information_schema/materialized_views.md
• sql-reference/information_schema/tables.md
• sql-reference/information_schema/columns.mdhc
09/03/2026, 5:59 PMRocky
09/03/2026, 5:59 PMALTER command. The syntax depends on whether you are using an Asynchronous (multi-table) or Synchronous (single-table/rollup) materialized view.
1. Asynchronous Materialized Views (Default)
For asynchronous materialized views (the most common type used for complex joins and aggregations), use the ALTER MATERIALIZED VIEW statement:
sql
ALTER MATERIALIZED VIEW old_mv_name RENAME new_mv_name;
2. Synchronous Materialized Views (Rollups)
Synchronous materialized views (often called "rollups") are technically indexes attached to a specific base table. To rename one, you must reference the base table:
sql
ALTER TABLE base_table_name RENAME ROLLUP old_mv_name new_mv_name;
Important Considerations:
* Privileges: You must have the ALTER privilege on the materialized view (or the base table for synchronous MVs) to perform a rename.
* Downstream Objects: Renaming a materialized view does not automatically update other views or scripts that reference the old name. You will need to update those manually.
* Query Rewrite: If the materialized view was being used for automatic query rewrite, the rewrite functionality will continue to work under the new name without additional configuration.
References
• sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• using_starrocks/async_mv/Materialized_view.md
References
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• sql-reference/sql-statements/table_bucket_part_index/CREATE_TABLE.mdhc
09/10/2026, 11:20 AMALTER MATERIALIZED VIEW order_mv SWAP WITH order_mv_new;Rocky
09/10/2026, 11:20 AMSWAP WITH command is an atomic exchange of names and metadata. It does not delete anything.
* Before Swap: You have order_mv (Old Data) and order_mv_new (New Data).
* After Swap: The names are flipped. order_mv now points to the New Data, and order_mv_new now points to the Old Data.
* Result: Both objects persist so that the operation is safe and reversible. Usually, after verifying the swap was successful, you would manually run DROP MATERIALIZED VIEW order_mv_new; to clean up the old version.
2. Why permissions "moved" to the _new name
In StarRocks (specifically from version 3.0 onwards), privileges are internally bound to the Object ID, not just the string name.
1. When you granted permissions to order_mv, those permissions were attached to the underlying object (let's call it Object A).
2. When you performed the SWAP, Object A was renamed to order_mv_new.
3. Because the permissions are tied to Object A, they "followed" the object to its new name (order_mv_new).
4. The new object (Object B), which is now named order_mv, likely has no permissions because it was created fresh as order_mv_new.
Recommended Workflow for Updating MVs
To update a materialized view statement and maintain permissions on the "production" name, follow these steps:
1. Build the new MV: CREATE MATERIALIZED VIEW order_mv_new ...
2. Swap: ALTER MATERIALIZED VIEW order_mv SWAP WITH order_mv_new;
3. Re-apply Permissions: Since the production name order_mv is now technically a "new" object (Object B), you must re-grant the necessary privileges to it.
sql
GRANT SELECT ON MATERIALIZED VIEW order_mv TO ROLE report_role;
4. Cleanup: Once verified, drop the old version (which now has the _new name).
sql
DROP MATERIALIZED VIEW order_mv_new;
Tip: If you use Roles to manage permissions, re-applying the grant to the name order_mv after the swap is the standard way to ensure your users regain access to the updated data.
References
• sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
• sql-reference/sql-statements/account-management/GRANT.md
• administration/user_privs/authorization/privilege_item.md
References
• sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• knowledge/usage/best-practice.md
• faq/Others.mdhc
09/10/2026, 11:28 AMALTER MATERIALIZED VIEW order_mv SWAP WITH order_mv_new;Rocky
09/10/2026, 11:28 AMsql
ALTER MATERIALIZED VIEW order_mv SWAP WITH order_mv_new;
Why this works
Because SWAP WITH is an atomic exchange of names and metadata, running it a second time performs a 180-degree flip back to the starting position:
1. The Names: The object currently named order_mv_new (which holds your original data and permissions) will be renamed back to order_mv.
2. The Data: The object currently named order_mv (the new one) will be renamed back to order_mv_new.
3. The Permissions: Since permissions are tied to the Object ID (not just the string name), the permissions that "followed" the object to the _new name will follow it back to the original name.
──────────
If your goal was actually to keep the New Logic on the order_mv name:
If you want the production name (order_mv) to have the new logic but you were surprised that the permissions moved to the old version, reversing the swap will only put you back at the beginning.
To successfully upgrade the logic while keeping permissions on the production name, you must:
1. Perform the Swap (which you already did).
2. Re-apply the Grants to the name order_mv (because as far as the database is concerned, the object now named order_mv is a brand new entity with no permissions).
sql
GRANT SELECT ON MATERIALIZED VIEW order_mv TO ROLE <your_role>;
3. Drop the old version (order_mv_new) once you are satisfied.
References
• sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
• administration/user_privs/authorization/privilege_item.md
• faq/Others.md
References
• sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
• sql-reference/sql-statements/table_bucket_part_index/ALTER_TABLE.md
• knowledge/usage/best-practice.md
• faq/Others.mdhc
09/10/2026, 12:18 PMRocky
09/10/2026, 12:18 PM_new name—the permissions were stuck to that specific ID.
* When you DROP: The Object ID is deleted from the system metadata. Once that ID is gone, all privilege entries associated with it are also purged.
2. Dropping and Re-creating
If you drop a materialized view and then create a new one with the exact same name, the new MV will have a brand new Object ID. Because the ID is new, it will have no permissions inherited from the old one. You will have to run your GRANT statements again for the new object.
Summary of behavior (v3.0+):
Action | Effect on Permissions
Rename / Swap | Permissions stay with the object (they follow the ID to the new name).
Drop | Permissions are deleted immediately.
Recreate (same name) | Permissions must be re-granted (it is a "new" object to the system).
Recommendation: If you have successfully swapped and you now drop order_mv_new (the old one), any permissions currently attached to order_mv_new will be gone forever. Make sure you have already applied the necessary grants to the "production" order_mv name before you finish your cleanup.
References
• administration/user_privs/authorization/privilege_faq.md
• sql-reference/sql-statements/materialized_view/DROP_MATERIALIZED_VIEW.md
• administration/user_privs/authorization/privilege_item.md
References
• administration/user_privs/authorization/privilege_item.md
• sql-reference/sql-statements/materialized_view/DROP_MATERIALIZED_VIEW.md
• administration/user_privs/authorization/privilege_faq.md
• using_starrocks/async_mv/Materialized_view.mdhc
09/10/2026, 12:22 PMRocky
09/10/2026, 12:22 PMsql
ALTER MATERIALIZED VIEW old_name RENAME new_name;
The underlying object remains the same; only its "label" changes. Therefore, all roles and users who had access to old_name will still have the exact same access to the view under its new_name.
Summary of how permissions behave:
* Rename / Swap: Permissions stay with the object. If you rename "A" to "B", the permissions follow the object to name "B".
* Drop: Permissions are deleted permanently. The Object ID is purged from the system.
* Create: A new object gets a new ID. Even if you use a name that existed previously, it starts with zero permissions (except for the owner/admin).
Why this matters for your workflow:
If you are doing a "Blue/Green" deployment of a Materialized View:
1. You build mv_new (Object B).
2. You swap mv_prod (Object A) with mv_new (Object B).
3. Result: Your production permissions are now attached to the object named mv_new (Object A), and your "clean" production name mv_prod (Object B) has no permissions yet.
This is why, after a swap or rename, you usually need to run a GRANT statement on the "production" name to ensure users can access the new logic/data.
References
• administration/user_privs/authorization/privilege_faq.md
• sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
• administration/user_privs/authorization/privilege_item.md
References
• administration/user_privs/authorization/privilege_item.md
• sql-reference/sql-statements/account-management/GRANT.md
• administration/user_privs/authorization/privilege_faq.md
• sql-reference/sql-statements/materialized_view/ALTER_MATERIALIZED_VIEW.md
• using_starrocks/async_mv/use_cases/data_modeling_with_materialized_views.mdhc
09/10/2026, 12:32 PMRocky
09/10/2026, 12:33 PMinformation_schema.
Option 1: Query information_schema (Recommended)
This allows you to select only the TABLE_NAME column, avoiding the "wall of text" caused by the DDL column.
sql
SELECT TABLE_NAME
FROM information_schema.materialized_views
WHERE TABLE_SCHEMA = 'your_database_name';
Option 2: Use SHOW TABLES
In StarRocks, SHOW TABLES lists both physical tables and materialized views in a single column. If you only want to see names, this is the quickest command, though it doesn't distinguish between a standard table and an MV.
sql
SHOW TABLES;
Why "SHOW MATERIALIZED VIEWS" is messy
While the command SHOW MATERIALIZED VIEWS; exists, it always returns a fixed set of columns, including the text column which contains the full CREATE statement. This often makes the output difficult to read in a standard terminal.
References
• sql-reference/information_schema/materialized_views.md
• sql-reference/sql-statements/materialized_view/SHOW_MATERIALIZED_VIEW.md
• sql-reference/sql-statements/table_bucket_part_index/SHOW_TABLES.md
References
• sql-reference/information_schema/materialized_views.md
• sql-reference/sql-statements/materialized_view/SHOW_MATERIALIZED_VIEW.md
• sql-reference/sql-statements/table_bucket_part_index/SHOW_TABLES.md
• administration/management/resource_group.md
• administration/management/external_config/Configuration_of_StarRocks.md
References
• sql-reference/sql-statements/materialized_view/SHOW_MATERIALIZED_VIEW.md
• sql-reference/information_schema/materialized_views.mdhc
09/10/2026, 12:36 PMRocky
09/10/2026, 12:36 PMDROP MATERIALIZED VIEW command for each view.
Correct Syntax (One at a time)
sql
DROP MATERIALIZED VIEW IF EXISTS mv1;
DROP MATERIALIZED VIEW IF EXISTS mv2;
DROP MATERIALIZED VIEW IF EXISTS mv3;
Why a list doesn't work
While some commands like GRANT allow a comma-separated list of objects, the DROP MATERIALIZED VIEW syntax is strictly defined to accept only one mv_name at a time:
sql
DROP MATERIALIZED VIEW [IF EXISTS] [database.]mv_name
Pro-Tip: Batching via Scripting
If you have a large number of materialized views to drop (e.g., all views with a certain prefix), you can generate the SQL statements quickly by querying the `information_schema`:
Step 1: Generate the drop statements
sql
SELECT CONCAT('DROP MATERIALIZED VIEW ', table_schema, '.', table_name, ';')
FROM information_schema.materialized_views
WHERE table_name LIKE 'old_version_%';
Step 2: Copy and execute the output
The query above will return a list of valid SQL commands that you can copy-paste into your terminal or editor to run all at once.
References
• sql-reference/sql-statements/materialized_view/DROP_MATERIALIZED_VIEW.md
• sql-reference/information_schema/materialized_views.md
• using_starrocks/async_mv/Materialized_view.md
References
• best_practices/query_tuning/query_profile_operator_metrics.md
• faq/loading/Loading_faq.md
• sql-reference/System_variable.md
• faq/operation_maintenance_faq.md
• knowledge/trouble_shooting/fe_deadlock_problems.md
• best_practices/query_tuning/query_planning.mdhc
10/01/2026, 1:16 PMRocky
10/01/2026, 1:16 PMCREATE REPOSITORY command with the same repository name and location used by the cluster that created the backups.
Example (AWS S3):
sql
CREATE REPOSITORY my_existing_repo
WITH BROKER
ON LOCATION "<s3a://my-backup-bucket/starrocks_backups>"
PROPERTIES(
"aws.s3.access_key" = "XXXXXXXX",
"aws.s3.secret_key" = "YYYYYYYY",
"aws.s3.region" = "us-east-1"
);
Note: For AWS S3 or Google GCS, ensure you use the s3a:// prefix as required by StarRocks.
2. (Optional) Create as Read-Only
If you only intend to restore data from the existing repository and want to prevent this cluster from accidentally overwriting or adding new snapshots, use the READ ONLY keyword:
sql
CREATE READ ONLY REPOSITORY my_existing_repo ...
3. Verify Connection and Snapshots
Once the repository is created, verify that StarRocks can see the existing backup snapshots:
sql
-- Check if the repository is listed and 'ErrMsg' is empty
SHOW REPOSITORIES;
-- List the available snapshots in that repository
SHOW SNAPSHOT ON my_existing_repo;
If SHOW SNAPSHOT returns the list of your previous backups, you have successfully connected and can now proceed with the RESTORE command.
References
• administration/management/Backup_and_restore.md
• sql-reference/sql-statements/backup_restore/CREATE_REPOSITORY.md
• sql-reference/sql-statements/backup_restore/SHOW_SNAPSHOT.md
References
• administration/cluster_snapshot.md
• administration/management/Backup_and_restore.md
• sql-reference/sql-statements/backup_restore/SHOW_SNAPSHOT.md
• sql-reference/sql-statements/backup_restore/SHOW_REPOSITORIES.mdhc
10/05/2026, 1:31 PMCommunications link failure
The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.Rocky
10/05/2026, 1:31 PMbash
ps aux | grep starrocks
If it is not running, check the logs at fe/log/fe.log for errors that may have prevented it from starting (e.g., metadata corruption or port conflicts).
2. Verify the Query Port
By default, StarRocks listens for MySQL/JDBC connections on port 9030.
* Check configuration: Open fe/conf/fe.conf and look for the query_port parameter.
* Check listening status: Run the following to see if the FE is actually listening on that port:
bash
netstat -tunlp | grep 9030
3. Test Network Connectivity
From the client machine (where your application or IDE is running), try to reach the FE server's port:
bash
# Using telnet
telnet <fe_ip_address> 9030
# Or using nc (Netcat)
nc -zv <fe_ip_address> 9030
* If it fails: A firewall (iptables, firewalld) or a Cloud Security Group (AWS/GCP/Azure) is likely blocking traffic on port 9030.
4. Verify IP Binding (priority_networks)
If your server has multiple network interfaces, StarRocks might be binding to an internal-only or incorrect IP address.
* Check FE Logs: Search fe.log for the line Use IP init local addr, IP: /<ip_address>.
* Fix: If the IP shown is incorrect, explicitly set the correct network in `fe/conf/fe.conf`:
properties
priority_networks = 192.168.1.0/24 # Example CIDR matching your desired IP
Restart the FE after making this change.
5. JDBC URL and Timeout Settings
Ensure your JDBC connection string follows this format:
text
jdbc:mysql://<fe_ip>:9030/<database_name>?connectTimeout=5000
* SSL: If your client defaults to requiring SSL but the StarRocks cluster is not configured for it, try adding &useSSL=false to the connection string.
* Wait Timeout: If connections drop after being idle, check the StarRocks global variable wait_timeout (default is usually 8 hours).
Summary of Ports
* 9030: MySQL Query Port (Client connections)
* 8030: HTTP Port (Web UI and some loading APIs)
* 9020: RPC Port (Internal communication)
* 9010: Edit Log Port (Leader election)
References
• administration/management/FE_configuration.md
• deployment/deploy_manually.md
• administration/Meta_recovery.md
• faq/operation_maintenance_faq.md
References
• administration/management/FE_configuration.md
• faq/Deploy_faq.md
• administration/Meta_recovery.md
• deployment/deploy_manually.md
• administration/management/resource_management/Load_balance.mdhc
10/05/2026, 3:09 PMERROR 1064 (HY000): Getting analyzing error. Detail message: Failed to list snapshot in repo: stage_backups, err: failed to list remote path: <s3a://stage_backups/__starrocks_repository_stage_backups/__ss_*>. msg: Fail to get file status: <s3a://stage_backups/__starrocks_repository_stage_backups>: listObjects() on <s3a://stage_backups/__starrocks_repository_stage_backups>: software.amazon.awssdk.serRocky
10/05/2026, 3:09 PMCREATE REPOSITORY command.
* If your production repository was named prod_backups, the folder in S3 is named __starrocks_repository_prod_backups.
* If you created the new repository in Stage as stage_backups, StarRocks is looking for __starrocks_repository_stage_backups.
* The Fix: Ensure the repository name in your CREATE REPOSITORY command in the Stage cluster exactly matches the repository name used in the Production cluster. Alternatively, rename the folder in S3 to match your new repository name.
2. Missing s3:ListBucket Permissions
The error listObjects() explicitly points to a failure when trying to list the contents of the bucket.
* Even if you have s3:GetObject permission, StarRocks needs s3:ListBucket to find the snapshots.
* The Fix: Ensure the IAM User or Role associated with your aws.s3.access_key has the following policy applied to the Stage bucket:
json
{
"Effect": "Allow",
"Action": ["s3:ListBucket", "s3:GetBucketLocation"],
"Resource": ["arn:aws:s3:::your-stage-bucket-name"]
},
{
"Effect": "Allow",
"Action": ["s3:GetObject"],
"Resource": ["arn:aws:s3:::your-stage-bucket-name/*"]
}
3. Region or Endpoint Mismatch
The software.amazon.awssdk.ser (likely S3Exception) can occur if the FE/BE nodes cannot reach the S3 endpoint because the region is incorrect or the network is blocked.
* The Fix: Check your CREATE REPOSITORY statement.
* Ensure aws.s3.region is correct for the new Stage bucket.
* Ensure you are using the s3a:// prefix (e.g., ON LOCATION "<s3a://my-stage-bucket/backup_folder>").
* If you are in a VPC, ensure the Stage cluster nodes have an S3 VPC Endpoint or internet access to reach S3.
Recommended Troubleshooting Steps:
1. Check S3 Folder Name: Open the S3 console for your Stage bucket. Look for a folder starting with __starrocks_repository_. Note that exact name.
2. Re-create the Repo: Drop the current repo and re-create it using that exact name:
sql
DROP REPOSITORY stage_backups;
CREATE REPOSITORY <exact_old_repo_name_from_s3>
WITH BROKER
ON LOCATION "<s3a://stage_backups/>"
PROPERTIES(
"aws.s3.access_key" = "...",
"aws.s3.secret_key" = "...",
"aws.s3.region" = "us-east-1" -- double check this
);
3. Check FE Logs: If it still fails, check fe/log/fe.warn.log or fe/log/fe.log. It will contain the full Java stack trace which will explicitly say "Access Denied" or "Unknown Host" at the end of the software.amazon.awssdk... line.
References
• sql-reference/sql-statements/backup_restore/CREATE_REPOSITORY.md
• administration/management/Backup_and_restore.md
• sql-reference/sql-statements/backup_restore/SHOW_SNAPSHOT.md
References
• sql-reference/sql-statements/backup_restore/CREATE_REPOSITORY.md
• data_source/catalog/iceberg/iceberg_rest_s3.mdhc
10/05/2026, 5:06 PMRocky
10/05/2026, 5:07 PMSET CATALOG default_catalog; is not strictly required to create a role or grant permissions, but it depends on how you write your commands.
1. Creating a Role
Creating a role is a global operation. Roles in StarRocks are cluster-level objects, not tied to a specific catalog. You can run the following from any catalog context:
sql
CREATE ROLE my_new_role;
2. Granting Permissions
Whether you need to switch catalogs depends on whether you use fully qualified names for the objects (databases/tables).
* Option A: Using SET CATALOG (Context-based)
If you switch to the catalog first, you can use short names for databases and tables.
sql
SET CATALOG default_catalog;
GRANT SELECT ON DATABASE my_db TO ROLE my_new_role;
* Option B: Explicit Catalog (No switch needed)
You can grant permissions on any catalog's objects from your current session by explicitly naming the catalog in the GRANT statement.
sql
-- Granting on internal objects from any context
GRANT SELECT ON DATABASE default_catalog.my_db TO ROLE my_new_role;
-- Granting on external catalog objects
GRANT USAGE ON CATALOG hive_catalog TO ROLE my_new_role;
Summary Recommendation
While not required, it is a best practice to either:
1. Explicitly switch to default_catalog at the start of your RBAC scripts to ensure you don't accidentally grant permissions on an external catalog (like Hive or Iceberg) that happens to have a database with the same name.
2. Use fully qualified names (e.g., default_catalog.db_name.table_name) for maximum clarity and safety.
Note: To manage roles and permissions, you must have the user_admin system role or the GRANT privilege on the target objects.
References
• sql-reference/sql-statements/Catalog/CREATE_EXTERNAL_CATALOG.md
• administration/user_privs/authorization/privilege_item.md
• sql-reference/sql-statements/Catalog/SET_CATALOG.md
• data_source/catalog/iceberg/iceberg_rest_security.md
• data_source/catalog/unified_catalog.md
• administration/user_privs/authorization/User_privilege.mdhc
10/05/2026, 5:29 PMServer requests authentication using unknown plugin authentication_openid_connect_client. See TODO: add plugins doco here on how to configure or author authentication plugins.Rocky
10/05/2026, 5:30 PMauthentication_openid_connect_client plugin.
* Solution: Upgrade your MySQL client to version 9.2.0 or later.
* Usage: Once upgraded, you can connect by providing an identity token file:
bash
mysql -h <fe_ip> -P 9030 \
--authentication-openid-connect-client-id-token-file=/path/to/token.txt \
-u <username>
2. Use the StarRocks JDBC OAuth2 Plugin
If you are connecting via a Java/JDBC application (like DBeaver or a custom app), the standard MySQL JDBC driver does not support OIDC out of the box.
* Solution: Use the starrocks-jdbc-oauth2-plugin.
* Reference: You can find the implementation and instructions in the StarRocks GitHub repository.
3. Verify Security Integration Configuration
Since you mentioned using Security Integration and Group Provider, ensure your authentication_chain includes the OIDC integration and that the type is set correctly:
* Check config: ADMIN SHOW FRONTEND CONFIG LIKE 'authentication_chain';
* Check Integration:
sql
-- Ensure the type is authentication_oauth2
CREATE SECURITY INTEGRATION my_oidc_integration
PROPERTIES (
"type" = "authentication_oauth2",
"auth_server_url" = "...",
...
);
Why this happens
When StarRocks is configured with OIDC (via Security Integration), it acts as a server that supports the authentication_openid_connect_client method. If the client (e.g., an older mysql CLI or mysql-connector-java) doesn't have this plugin in its library, it throws the "unknown plugin" error.
References
• administration/user_privs/authentication/oauth2_authentication.md
• administration/user_privs/authentication/jwt_authentication.md
• administration/user_privs/authentication/security_integration.md
• administration/user_privs/group_provider.md
References
• administration/user_privs/group_provider.mdhc
10/05/2026, 5:33 PMServer requests authentication using unknown plugin authentication_openid_connect_client. See TODO: add plugins doco here on how to configure or author authentication plugins.Rocky
10/05/2026, 5:33 PMauthentication_jwt, the StarRocks server signals the client to use a plugin named authentication_openid_connect_client to pass the token.
Your MCP server (likely using a standard MySQL library like mysql2 for Node.js or mysql-connector-python) does not recognize this plugin name.
Why this is happening
When StarRocks receives a connection for a user mapped to a JWT/OIDC security integration:
1. The server sends an AuthSwitchRequest to the client.
2. The request tells the client: "Stop using the default password method and use authentication_openid_connect_client instead."
3. The client library looks at its internal list of supported plugins. If it doesn't find it, it throws the error you see.
Solutions
1. If your MCP server is using a MySQL CLI
If your MCP server is a wrapper around a shell command (like the mysql command), you must upgrade the MySQL client on the machine running the MCP server to version 9.2.0 or later.
* Standard MySQL clients before 9.2 do not include this plugin.
* Once upgraded, the command looks like this:
bash
mysql -h <fe_host> -P 9030 -u <username> \
--authentication-openid-connect-client-id-token-file=/path/to/jwt.txt
2. If your MCP server is using Node.js (mysql2 or mysql library)
Currently, standard Node.js MySQL libraries do not support this specific OIDC plugin.
* Workaround: You may need to use a JDBC-based MCP server (if available) with the StarRocks JDBC OAuth2 Plugin, which was specifically designed to handle this protocol switch.
* Alternative: If you are developing the MCP server yourself, you would need to manually implement the authentication_openid_connect_client flow in your database client configuration (handling the AuthSwitchRequest by sending the JWT token as cleartext or as defined by the OIDC spec).
3. Use an SSL/Cleartext Fallback (If possible)
For some integrations, StarRocks can be configured to allow plain text or LDAP-style cleartext if SSL is enabled. However, for JWT security integrations, the authentication_openid_connect_client plugin is the strictly enforced protocol for passing the token via the MySQL wire.
Recommendation for MCP Users
Since Claude Desktop MCP servers are typically automated environments:
1. Verify the Token: Ensure the JWT token is being generated correctly and is accessible to the MCP server.
2. Driver Compatibility: If you are using a Python-based MCP, check if mysql-connector-python (official Oracle version) supports OIDC plugins.
3. Check FE Logs: Check fe/log/fe.log to see if the server successfully identified the user and attempted the auth switch.
References
• administration/user_privs/authentication/jwt_authentication.md
• administration/user_privs/authentication/security_integration.md
• administration/user_privs/group_provider.md
References
• administration/user_privs/ssl_authentication.md
• administration/user_privs/authentication/native_authentication.md
• administration/user_privs/authentication/security_integration.md
• integrations/authenticate_to_aws_resources.mdhc
10/06/2026, 3:06 PMRocky
10/06/2026, 3:07 PMDB_1.
Here is the breakdown of why this happens, based on how StarRocks handles object identities and permissions:
1. Permissions are tied to the Object ID, not the Name
In StarRocks, privileges for internal objects (databases and tables) are bound to their internal unique ID, not their string name.
* When you granted permissions on DB_1, StarRocks mapped those permissions to ID_101 (the internal ID of your original database).
* When you rename DB_1 to DB_3, the object ID_101 is now called DB_3. The user still has access to DB_3 because the ID hasn't changed.
2. Restored databases are "New" objects
When you restore DB_2 from a backup:
* StarRocks creates a new object with a new internal ID (e.g., ID_202).
* Permissions are not included in backups: StarRocks backups do not include user/role privilege configurations. Therefore, DB_2 (ID_202) starts with no permissions granted to anyone (except admins).
3. Renaming does not transfer permissions
When you rename DB_2 (ID_202) to `DB_1`:
* It is still the object ID_202.
* Renaming an object does not cause it to "inherit" permissions that used to belong to a different ID that previously held that name.
Summary of the State After Your Operations:
Logical Name | Internal ID | User Access? | Reason
DB_3 | ID_101 (Original) | Yes | Permission followed the ID during the rename.
DB_1 | ID_202 (Restored) | No | New object ID; no permissions were ever granted to it.
How to fix it:
To ensure the user has access to the "new" DB_1, you must manually grant the permissions again after the restore/rename process:
sql
GRANT ALL ON DATABASE DB_1 TO USER 'username'@'%';
References
• administration/user_privs/authorization/privilege_faq.md
• sql-reference/sql-statements/Database/ALTER_DATABASE.md
• sql-reference/sql-statements/backup_restore/RESTORE.md
References
• sql-reference/sql-statements/backup_restore/RESTORE.md
• administration/user_privs/authorization/User_privilege.md
• sql-reference/sql-statements/account-management/GRANT.mdhc
10/06/2026, 3:39 PMSQL Error [5064] [42000]: Getting analyzing error. Detail message: cannot to compute object's checksum.hc
10/06/2026, 3:43 PMSQL Error [5064] [42000]: Getting analyzing error. Detail message: cannot to compute object's checksum.Rocky
10/06/2026, 3:43 PMcannot to compute object's checksum (SQL Error 5064) occurs when the StarRocks Front End (FE) is unable to download or access the JAR file specified in your CREATE FUNCTION statement.
When you run CREATE FUNCTION, the FE must fetch the JAR file to calculate a MD5 checksum for metadata consistency and to ensure BEs (Back Ends) can later download the correct file.
Common Causes & Solutions
1. Network Accessibility
The URL provided in the AS 'http://...' clause must be reachable from all FE nodes in your cluster.
* Test: Log into your FE server(s) and try to curl the JAR URL.
bash
curl -I <http://your-server:port/path/to/udf.jar>
* If the FE is behind a proxy or firewall that blocks outgoing HTTP requests, the checksum calculation will fail.
2. Insufficient Permissions (Cloud Storage)
If you are hosting the JAR on cloud storage (like AWS S3 or Alibaba Cloud OSS):
* Requirement: The file must be Publicly Readable (or accessible via the configured credentials/policy of the FE).
* OSS users: Ensure the file permission is set to "Public Read" (公共读).
* S3 users: Ensure the bucket policy allows the FE's IP or IAM role to perform GetObject.
3. Incorrect URL
Ensure the URL is a direct link to the .jar file and doesn't point to a redirect page (like a login screen or a GitHub blob page instead of the "raw" file).
4. HTTP Server Issues
If you are using a local HTTP server (e.g., python3 -m http.server):
* Ensure the server is running on a port that is open across the internal network.
* Check if the server process has crashed or timed out.
How to verify
Check the FE leader's fe.log (usually located at fe/log/fe.log). You will typically find a more detailed exception right before this error message, such as Connection Refused, 403 Forbidden, or 404 Not Found.
Correct Syntax Example:
sql
CREATE FUNCTION my_udf(string)
RETURNS string
PROPERTIES (
"symbol" = "com.starrocks.udf.sample.UDFStringTest",
"type" = "StarrocksJar",
"file" = "http://<reachable_ip>:<port>/udf-1.0-SNAPSHOT-jar-with-dependencies.jar"
);
References
• sql-reference/sql-functions/JAVA_UDF.md
• sql-reference/sql-statements/data-definition/CREATE_FUNCTION.md
• administration/management/FE_configuration.md
References
• sql-reference/sql-functions/JAVA_UDF.md
• administration/user_privs/authorization/privilege_faq.md
• sql-reference/sql-functions/Scalar_functions.md
• sql-reference/sql-statements/data-definition/CREATE_FUNCTION.md
• sql-reference/sql-functions/aggregate-functions/approx_count_distinct.md
• administration/management/FE_configuration.md
• administration/management/Resource_group.md
• administration/user_privs/authentication/security_integration.md
• sql-reference/sql-statements/data-definition/CREATE_ROUTINE_LOAD.md
• deployment/helm.mdRocky
10/06/2026, 3:43 PMRocky
10/06/2026, 3:43 PMRocky
10/06/2026, 3:43 PMRocky
10/06/2026, 3:43 PMRocky
10/06/2026, 3:43 PMRocky
10/06/2026, 3:44 PMRocky
10/06/2026, 3:44 PMRocky
10/06/2026, 3:44 PMRocky
10/06/2026, 3:44 PMRocky
10/06/2026, 3:44 PMCREATE FUNCTION statement.
When you create a Java UDF, the FE must first access the JAR file to verify it and calculate a checksum for metadata consistency across the cluster. If the FE cannot reach the file, the checksum calculation fails, leading to this error.
Common Causes and Solutions
1. Network Connectivity Issues
The FE node must be able to reach the HTTP(S) or Object Storage (S3/OSS) server where the JAR is hosted.
* Test: Log into your FE machine and run a curl command against the URL:
bash
curl -I <your_jar_url>
* Solution: Ensure there are no firewall rules, security groups, or proxy settings blocking the FE from reaching the host.
2. Incorrect URL in PROPERTIES
Verify the uri property in your SQL statement matches the actual location of the JAR.
sql
CREATE FUNCTION my_udf(INT) RETURNS INT
PROPERTIES (
"symbol" = "com.example.MyUDF",
"type" = "StarrocksJar",
"uri" = "http://<ip>:<port>/path/to/my-udf.jar" -- Ensure this is correct
);
3. Permissions on the JAR file
If the JAR is hosted on a cloud storage service (like AWS S3, Alibaba Cloud OSS, or Google GCS):
* Public Access: Ensure the file has "Public Read" permissions so the FE can download it without authentication.
* Private Access: If the file is private, the FE requires the appropriate credentials (Access Key/Secret Key) to be configured or inherited via IAM roles.
4. HTTP Server Issues
If you are using a simple Python HTTP server (python3 -m http.server) to host the JAR:
* Ensure the server is running on a port that is open to the FE.
* Ensure the server didn't crash or timeout during the request.
5. Case Sensitivity and File Path
Ensure the file name and path are exactly correct, including case sensitivity. If the file is not found (404 error), the FE will return the "cannot to compute object's checksum" error.
Summary of Checkpoints
1. FE Logs: Check the fe/log/fe.warn.log or fe.log on the leader FE. It usually contains a more detailed error (like Connection refused or 404 Not Found) immediately preceding the checksum error.
2. Access: Can you download the JAR file manually using wget or curl from the FE server console?
3. Port: If using a custom port (e.g., 8080 or 8000), ensure it is allowed in your network's ingress rules.
References
• sql-reference/sql-functions/JAVA_UDF.md
• sql-reference/sql-statements/account-management/CREATE_FUNCTION.md
References
• sql-reference/sql-functions/JAVA_UDF.mdhc
10/06/2026, 5:21 PMState: DOWNLOADRocky
10/06/2026, 5:22 PMDOWNLOAD state, it typically means the Front End (FE) is having trouble submitting or preparing the download tasks to the Back Ends (BEs). This is distinct from the DOWNLOADING state, where the BEs are actually pulling data from the repository.
Here is where to check and what to look for:
1. Check the Job Status in Detail
Run the following SQL command to see the internal error message and unfinished tasks:
sql
SHOW RESTORE FROM <your_database_name>;
Pay close attention to these columns:
* UnfinishedTasks: Lists the IDs of tasks that haven't started. If this list is long or not changing, FE is failing to dispatch them.
* TaskErrMsg: This is the most important field. It will often contain the specific reason for the hang (e.g., "all BE nodes are down" or "failed to connect to broker").
* Status: Shows the high-level status message.
2. Check the FE Logs
Since DOWNLOAD is a submission phase handled by the FE, check the fe.log (and fe.warn.log) on the Leader FE node. Search for keywords like:
* RestoreJob
* Snapshot
* Repository
* AgentBatchTask
Common log errors include:
* Connectivity issues to the Repository: FE needs to list files in the remote storage (S3/HDFS/OSS) to generate the download plan. If the FE cannot reach the storage, it will hang here.
* BE Availability: If there are no healthy BEs available to receive tasks, the job will stay in DOWNLOAD.
* Deadlocks: In rare cases, FE metadata locks can cause the RestoreJob thread to hang.
3. Check the BE Logs
While the FE manages the state, the BEs must acknowledge the task. Check be.log on your BE nodes for:
* download or snapshot related errors.
* Check if the BE has enough download_worker_count (default is usually sufficient, but if many restores are running, workers might be exhausted).
4. Common Causes to Verify
* Repository Credentials: Ensure the CREATE REPOSITORY credentials are still valid and the FE/BE nodes have the necessary network permissions (e.g., IAM roles, S3 bucket policies, or Security Groups).
* Broker Status (if using a Broker): If you are using a Broker for HDFS/S3, check if the Broker process is alive (SHOW BROKER;) and check the broker.log.
* FE Parameters:
* `max_download_task_per_be`: (Default 0, unlimited). If this was manually set very low, it could bottleneck submission.
* Disk Space: Ensure the BE nodes have sufficient disk space for the snapshots.
Summary Checklist
1. SHOW RESTORE: Look for TaskErrMsg.
2. fe.log: Search for RestoreJob failures.
3. SHOW BACKENDS: Ensure all BEs are Alive: true.
4. Network: Verify FE can curl or access the remote storage endpoint.
References
• administration/management/Backup_and_restore.md
• administration/management/monitoring/metrics.md
• loading/SparkLoad.md
• knowledge/trouble_shooting/fe_deadlock_problems.md
• administration/management/FE_configuration.md
• faq/Exporting_faq.mdhc
10/06/2026, 6:23 PMERROR 5064 (42000): Getting analyzing error. Detail message: Class 'TestUdf' not found in object_fileRocky
10/06/2026, 6:23 PMsymbol property inside that JAR.
Here are the most common reasons and how to fix them:
1. Missing Package Name
The symbol property must be the fully qualified class name, including the package.
* Incorrect: "symbol" = "TestUdf"
* Correct: "symbol" = "com.mycompany.udf.TestUdf"
Check your Java source code for the package declaration at the top of the file.
2. Case Sensitivity
Java class names and package names are case-sensitive. Ensure the symbol string exactly matches the casing in your code.
* If your class is TestUDF and you wrote TestUdf, it will fail.
3. Verify JAR Contents
You can manually check if the class is actually present in the JAR file you uploaded by running this command in your terminal:
bash
jar -tf your-udf-file.jar | grep TestUdf
The output should look like com/mycompany/udf/TestUdf.class. If it doesn't appear, the class wasn't included in the build.
4. Shaded/Fat JAR Issues
If your UDF depends on external libraries, you must provide a "fat JAR" (a JAR with all dependencies included).
* If you are using Maven, ensure you are using the maven-assembly-plugin or maven-shade-plugin.
* Often, developers accidentally upload the "slim" JAR (e.g., my-udf-1.0.jar) instead of the one with dependencies (e.g., my-udf-1.0-jar-with-dependencies.jar).
5. Nested or Inner Classes
If TestUdf is an inner class, you must use the $ separator instead of a dot.
* Example: "symbol" = "com.package.OuterClass$TestUdf"
Example of a Correct Statement:
sql
CREATE FUNCTION my_test_func(string)
RETURNS string
PROPERTIES (
"symbol" = "com.example.udf.TestUdf", -- Must be fully qualified
"type" = "StarrocksJar",
"file" = "<http://192.168.1.10:8080/udfs/my-udf-1.0.jar>"
);
Next Step if it still fails:
Check the FE (Front End) logs (fe.log). When this error occurs, the FE often prints the list of classes it did find in the JAR, which can help you identify if there is a path mismatch or a build issue.
References
• sql-reference/sql-functions/JAVA_UDF.md
• sql-reference/sql-statements/Function/CREATE_FUNCTION.md
References
• sql-reference/sql-functions/JAVA_UDF.md
• sql-reference/sql-statements/Function/CREATE_FUNCTION.md
• sql-reference/sql-functions/Python_UDF.mdhc
10/07/2026, 10:31 AMWARN (pool-9585014-thread-3|226102) [LDAPGroupProvider.matchUserAndUpdateGroups():201] LDAP group member attribute 'member' not found in attributes: {cn=cn: groups}Rocky
10/07/2026, 10:31 AMLDAP group member attribute 'member' not found in attributes: {cn=cn: groups} indicates that StarRocks successfully found an LDAP object, but that specific object does not contain the member attribute.
Based on the attribute map shown in your log ({cn=cn: groups}), it appears StarRocks is matching an object where the Common Name (cn) is simply "groups". This often happens if the search filter is too broad and matches a container or Organizational Unit (OU) instead of the actual group objects.
1. Verify the LDAP Filter
If your ldap_group_filter is too generic (e.g., matching by cn only), it might be hitting the "groups" container itself. Containers usually do not have a member attribute, whereas group objects do.
* Solution: Narrow your filter to only include group object classes.
* For Active Directory: Use (&(objectClass=group)(cn=your_actual_group))
* For OpenLDAP: Use (&(objectClass=groupOfNames)(cn=your_actual_group))
2. Check Bind User Permissions
The LDAP account configured in ldap_bind_root_dn must have explicit permissions to read the member (or memberUid) attribute.
* Diagnosis: Even if an LDAP Admin can see the attribute, the specific "Bind User" used by StarRocks might have restricted access.
* Test: Use an external tool like ldapsearch from the StarRocks FE machine, using the same Bind DN and password:
bash
ldapsearch -h <host> -D "<bind_dn>" -w "<password>" -b "<base_dn>" "cn=groups" member
If this returns the object without the member field, the issue is with the Bind User's permissions or the LDAP server's ACLs.
3. Case Sensitivity and Attribute Names
Ensure that the attribute name in your LDAP server matches what is defined in the Group Provider.
* Check if your LDAP uses member or memberUid.
* Update your Group Provider properties if necessary:
sql
-- If using memberUid
"ldap_group_member_attr" = "memberUid"
4. Large Groups (Active Directory Range Retrieval)
If the group has a very large number of members (typically >1500), Active Directory might return the members in "ranges" (e.g., member;range=0-1499).
* If this is the case, the standard member attribute will appear "missing" to some LDAP clients.
* Verification: Check if the group causing the warning is exceptionally large.
Summary Checklist
1. Refine the Filter: Ensure you are targeting objectClass=group or groupOfNames.
2. Verify the Match: The log shows cn: groups. Is "groups" actually the name of your group, or is it the name of the folder/OU containing your groups? If it's the folder, your filter is incorrect.
3. Permissions: Confirm the Bind User can read the member attribute of the target objects.
References
• administration/user_privs/group_provider.md
• administration/user_privs/authentication/ldap_authentication.md
References
• administration/user_privs/group_provider.md
• administration/user_privs/authentication/ldap_authentication.mdhc
10/07/2026, 11:09 AMRocky
10/07/2026, 11:09 AMGROUP PROVIDER, StarRocks identifies the group name based on the attribute you specify in ldap_group_identifier_attr (usually cn).
* FreeIPA Group: cn=analysts,cn=groups,dc=example,dc=com
* Group Provider Config: "ldap_group_identifier_attr" = "cn"
* Resulting External Group Name: analysts
2. Granting Permissions
You then link a StarRocks role (which can have any name you like) to that external group using the GRANT statement:
sql
-- The role name can be different from the FreeIPA group name
CREATE ROLE starrocks_readonly_role;
-- Link the role to the external group fetched from FreeIPA
GRANT starrocks_readonly_role TO EXTERNAL GROUP analysts;
3. Key Points to Remember
* Case Sensitivity: By default, LDAP/FreeIPA cn values are usually matched as they appear in the LDAP server. If your FreeIPA group is Analysts, use EXTERNAL GROUP Analysts.
* External Group vs. Internal Role:
* The Role is a StarRocks object (e.g., sales_admin).
* The External Group is a reference to the name provided by your FreeIPA server (e.g., freeipa_sales_dept).
* Check the Log: If you aren't sure what name StarRocks is seeing, check the fe.warn.log or fe.log. When a user logs in, the LDAPGroupProvider will log the groups it matches for that user.
Verification Command
You can verify which roles are mapped to which external groups by checking the grant metadata or attempting a login with a user in that group and running:
sql
SHOW GRANTS FOR <user>;
-- Or check the active roles
SELECT current_role();
References
• administration/user_privs/group_provider.md
• administration/user_privs/authentication/ldap_authentication.md
References
• administration/user_privs/group_provider.mdhc
10/07/2026, 11:15 AMGRANT starrocks_readonly_role TO EXTERNAL GROUP analysts;
ERROR 1064 (HY000): Getting syntax error at line 1, column 42. Detail message: Unexpected input 'GROUP', the most similar input is {<EOF>, ';'}.Rocky
10/07/2026, 11:15 AMEXTERNAL keyword but is not expecting the word GROUP to follow it.
While the StarRocks 3.5 documentation lists GRANT <role> TO EXTERNAL GROUP <name>;, there are a few reasons why this specific error occurs:
1. Version-Specific Syntax (Check for 3.5.x)
Although Group Provider was introduced in v3.5.0, the syntax for granting roles to external groups was refined during the development of the 3.5 release cycle.
* Try omitting the GROUP keyword: In some early 3.5 builds or specific configurations, the syntax might be:
sql
GRANT starrocks_readonly_role TO EXTERNAL analysts;
* Try using quotes: If your group name contains special characters or is a reserved word, wrap it in single quotes:
sql
GRANT starrocks_readonly_role TO EXTERNAL GROUP 'analysts';
2. Verify Feature Availability
The EXTERNAL GROUP syntax is only available if the Group Provider feature is fully enabled and recognized by the FE.
* Check your fe.log during startup to ensure there are no errors related to the Group Provider initialization.
* Ensure you have already created the Group Provider using CREATE GROUP PROVIDER ... before attempting the GRANT. Although this is a syntax error, some parser rules in StarRocks are dynamically loaded based on feature state.
3. Check for Typos or Hidden Characters
The error column 42 points exactly to the letter G in GROUP. This confirms the parser reached EXTERNAL and stopped there.
* Ensure there isn't a double space or a non-breaking space character between EXTERNAL and GROUP.
* Re-type the command manually instead of copying and pasting to avoid hidden encoding issues.
4. Alternative: Mapping via LDAP Search (If using LDAP)
If the GRANT statement continues to fail, verify that you are not trying to grant a role to a group that StarRocks cannot yet "see." You can check the current group mappings known to the system using:
sql
-- This shows roles granted to external groups
SHOW GRANTS FOR EXTERNAL GROUP analysts;
If this command also returns a syntax error on GROUP, it is a strong indicator that your specific minor version of 3.5 has a different keyword requirement or the feature is disabled.
Recommendation:
If you are on an early 3.5.x release (like 3.5.0 or 3.5.1), consider upgrading to the latest patch (e.g., 3.5.4+) where the Group Provider syntax and stability have been significantly improved.
References
• administration/user_privs/group_provider.md
• sql-reference/sql-statements/account-management/GRANT.md
References
• administration/user_privs/group_provider.md
• sql-reference/sql-statements/account-management/GRANT.mdhc
10/07/2026, 11:20 AMRocky
10/07/2026, 11:21 AMSHOW commands:
* Verify Creation:
sql
-- If this returns the DDL, the provider exists in metadata
SHOW CREATE GROUP PROVIDER <your_provider_name>;
* Check List of Providers:
StarRocks currently does not have a standalone SHOW GROUP PROVIDERS command in v3.5. You primarily verify them individually using the command above.
2. Verify Linking to Security Integration
In StarRocks 3.5, simply creating a Group Provider is not enough for it to be active during login. It must be linked to a Security Integration (like your LDAP integration).
* Check the link:
sql
-- Look for the 'group_provider' property in the output
SHOW SECURITY INTEGRATIONS;
* Link it if missing:
If the group_provider property is empty, the FE will not use it to resolve groups. Run:
sql
ALTER SECURITY INTEGRATION <your_integration_name> SET (
"group_provider" = "<your_group_provider_name>"
);
3. Check FE Logs for Synchronous Verification
StarRocks verifies the connection to your LDAP server synchronously when you create or alter a Group Provider.
* If the CREATE GROUP PROVIDER command succeeded, the FE was able to connect to LDAP and bind with the credentials provided.
* Check fe.log for "LDAP refresh" or "GroupProvider" entries. You should see messages indicating the cache is being built or refreshed (default every 900s).
4. Regarding the GRANT Syntax Error
The error Unexpected input 'GROUP' on version 3.5 is often caused by one of two things:
1. Reserved Words: If your group name is a reserved word or contains special characters, you must use quotes:
sql
GRANT starrocks_readonly_role TO EXTERNAL GROUP 'analysts';
2. Missing "External" Permission: The GRANT ... TO EXTERNAL GROUP syntax requires the Group Provider feature to be initialized. Ensure the CREATE GROUP PROVIDER statement was successful before running the GRANT.
Summary Checklist:
1. Did CREATE GROUP PROVIDER succeed? (Verify with SHOW CREATE GROUP PROVIDER).
2. Is it linked to your SECURITY INTEGRATION? (Verify with SHOW SECURITY INTEGRATIONS).
3. Are you using quotes for the group name in the GRANT statement?
References
• administration/user_privs/group_provider.md
• sql-reference/sql-statements/account-management/GRANT.md
References
• administration/user_privs/group_provider.md
• sql-reference/sql-statements/account-management/GRANT.md
References
• administration/user_privs/group_provider.mdhc
10/07/2026, 11:28 AMRocky
10/07/2026, 11:29 AMLDAP group member attribute 'member' not found in attributes: {cn=cn: groups} indicates that StarRocks found an LDAP entry that matches your search, but that specific entry does not contain the member attribute required to identify its users.
Based on your FreeIPA version (4.13.1) and the log output, here are the most likely causes and solutions:
1. The Filter is Matching the "Groups" Container
In FreeIPA, the standard location for groups is cn=groups,cn=accounts,dc=....
The log entry shows the attribute found is {cn=cn: groups}. This suggests StarRocks is picking up the parent container entry itself (which is named groups but has no members) rather than the individual group entries inside it.
* Solution: Narrow your ldap_group_filter to only match group objects.
* Recommendation: Use a filter like (&(objectClass=ipausergroup)(cn=your_group_name)) or specifically for all groups: (objectClass=ipausergroup).
sql
-- Example property update
"ldap_group_filter" = "(&(objectClass=ipausergroup)(cn=analysts))"
2. LDAP Bind DN Permissions (ACIs)
Even if the LDAP admin sees the member attribute, the Bind DN user you configured in StarRocks might not have permissions to read it. FreeIPA uses Access Control Instructions (ACIs) that often restrict sensitive attributes like member.
* How to Verify: Run the following command from the StarRocks FE machine using the same credentials:
bash
ldapsearch -x -H ldap://<your_ipa_server> \
-D "uid=starrocks_svc,cn=users,cn=accounts,dc=example,dc=com" \
-W -b "cn=groups,cn=accounts,dc=example,dc=com" \
"(cn=analysts)" member
If the result returns the DN but no member lines, your bind user lacks the "Read Group Membership" permission in FreeIPA.
* Fix: Ask your admin to grant the System: Read Group Membership permission to the StarRocks service account.
3. Attribute Name Mismatch (member vs memberUid)
FreeIPA groups often support two different ways of listing members:
* member: Contains the full Distinguished Name (DN) of the users. (StarRocks default).
* memberUid: Contains only the login usernames (UIDs). This is used for POSIX compatibility.
If your FreeIPA groups only use memberUid, you must explicitly tell StarRocks to look for that:
sql
-- Update your Group Provider properties
"ldap_group_member_attr" = "memberUid"
4. Configuration Check for StarRocks 3.5
Ensure your CREATE GROUP PROVIDER matches the structure expected by FreeIPA:
sql
CREATE GROUP PROVIDER freeipa_provider
PROPERTIES(
"type" = "ldap",
"ldap_conn_url" = "<ldap://ipa.example.com:389>",
"ldap_bind_base_dn" = "cn=accounts,dc=example,dc=com", -- Base for users/groups
"ldap_group_filter" = "(objectClass=ipausergroup)", -- Specific to FreeIPA groups
"ldap_group_identifier_attr" = "cn",
"ldap_group_member_attr" = "member", -- Use "memberUid" if using POSIX groups
"ldap_user_search_attr" = "uid=([^,]+)" -- Extract UID from member DN
);
Note on the Syntax Error:
If you are still getting the Unexpected input 'GROUP' error on version 3.5, it is highly likely you are on a very early 3.5.0 build. Try wrapping the group name in quotes: GRANT ... TO EXTERNAL GROUP 'analysts';. If that fails, verify the feature is active by running SHOW SECURITY INTEGRATIONS; and ensuring the group_provider field is not empty.
References
• administration/user_privs/group_provider.md
• administration/user_privs/authentication/ldap_authentication.md
References
• administration/user_privs/group_provider.mdhc
10/07/2026, 4:59 PMmysql> GRANT test_group TO EXTERNAL GROUP 'test_group';
ERROR 1064 (HY000): Getting syntax error at line 1, column 42. Detail message: Unexpected input 'GROUP', the most similar input is {<EOF>, ';'}.
mysql> GRANT test_group TO EXTERNAL 'test_group';
ERROR 1064 (HY000): Getting syntax error at line 1, column 42. Detail message: Unexpected input ''test_group'', the most similar input is {<EOF>, ';'}.
mysql> GRANT test_group TO EXTERNAL test_group;
ERROR 1064 (HY000): Getting syntax error at line 1, column 42. Detail message: Unexpected input 'test_group', the most similar input is {<EOF>, ';'}.Rocky
10/07/2026, 5:00 PMUnexpected input 'GROUP' at column 42—indicates that the SQL parser in your StarRocks FE does not recognize the EXTERNAL GROUP keyword sequence. Instead, it stops after the keyword EXTERNAL, treating it as a user/role name, and then finds the word GROUP invalid.
Although Group Provider was introduced in StarRocks v3.5.0, there are a few reasons why this specific syntax might be rejected in version 3.5.8:
1. Feature Availability (Enterprise vs. Community)
In StarRocks 3.5, the Group Provider feature (which includes the EXTERNAL GROUP syntax) is often associated with the Enterprise Edition or specific "Enterprise-ready" security features.
* Verification: Check if you can run CREATE GROUP PROVIDER .... If that command also returns a syntax error, the Group Provider feature is not included in your current StarRocks build.
* Note: If you are using the open-source Community Edition, this specific RBAC extension for external groups may not be available in the standard parser.
2. FE Configuration and Initialization
StarRocks sometimes gates new grammar rules behind configuration flags or requires the feature to be "active" before the parser accepts the syntax.
* Create the Provider First: You must successfully create at least one Group Provider (LDAP, Unix, or File) before attempting to grant roles to external groups.
sql
-- Example for a file-based provider
CREATE GROUP PROVIDER my_file_provider PROPERTIES("type" = "file", "group_file_url" = "file:///path/to/groups");
* Check Security Integration: Ensure your authentication chain is configured to use security integrations, as the EXTERNAL GROUP logic relies on the system's ability to resolve these groups during login.
sql
ADMIN SHOW FRONTEND CONFIG LIKE 'authentication_chain';
3. Alternative Syntax (Earlier 3.5 builds)
In some developmental or patch versions of the 3.5 series, the syntax was refined. If EXTERNAL GROUP fails, try the following variants:
* Direct Role Assignment (No 'GROUP' keyword):
sql
GRANT test_group TO EXTERNAL 'test_group';
* Using the ROLE keyword for the target (if 'test_group' is a role):
sql
GRANT ROLE test_group TO EXTERNAL GROUP 'test_group';
4. Reserved Keywords
Since GROUP is a reserved keyword in StarRocks, if your group name is also test_group, the parser might be getting confused.
* Try quoting the group name:
sql
GRANT test_group TO EXTERNAL GROUP 'test_group';
(Note: You already tried this, but ensure there are no trailing spaces or hidden characters in your terminal copy-paste.)
Recommendation
If CREATE GROUP PROVIDER fails with a syntax error, it confirms the feature is missing from your build. If it succeeds but the GRANT statement fails, it is likely a bug or a missing configuration in v3.5.8. You should:
1. Run SELECT version(); to confirm the exact build.
2. Check the fe.log for any "Group Provider" initialization errors.
3. If this is critical, consider testing on a v3.6.x or v4.0 (if available) where these security integrations are more mature.
References
• administration/user_privs/group_provider.md
• sql-reference/sql-statements/account-management/GRANT.md
References
• administration/user_privs/group_provider.md
• sql-reference/sql-statements/account-management/GRANT.md
References
• administration/user_privs/group_provider.mdRocky
10/07/2026, 5:00 PMhc
10/07/2026, 5:06 PMRocky
10/07/2026, 5:07 PMGRANT command is failing, along with the fix for your FreeIPA warnings.
1. Fixing the LDAP Warnings (FreeIPA)
The warning LDAP group member attribute 'member' not found in attributes: {cn=cn: groups} means StarRocks' search is matching the FreeIPA group container (the folder where groups live) instead of the actual groups themselves.
* The Cause: Your ldap_bind_base_dn or ldap_group_filter is too broad. It is matching the entry cn=groups,cn=accounts,dc=..., which is a container and does not have a member attribute.
* The Fix: Update your ldap_group_filter to target only actual group objects. In FreeIPA, these typically have the ipausergroup object class.
sql
-- Update your provider to use a more specific filter
ALTER GROUP PROVIDER <your_provider_name> SET (
"ldap_group_filter" = "(objectClass=ipausergroup)"
);
* Attribute Check: If your groups are POSIX groups, they might use memberUid instead of member. If the warnings persist after fixing the filter, try:
sql
"ldap_group_member_attr" = "memberUid"
2. Solving the GRANT Syntax Error
The error Unexpected input 'GROUP' in version 3.5.8 indicates the SQL parser is stopping after the word EXTERNAL. This usually happens for one of three reasons:
A. Ambiguous Syntax (Try the ROLE keyword)
In some builds of 3.5.x, the parser is more strict. Ensure you are explicitly defining that you are granting a ROLE:
sql
-- Use this specific format
GRANT ROLE test_group TO EXTERNAL GROUP 'test_group';
B. Reserved Word Conflict
GROUP is a reserved keyword. If the parser is struggling, ensure the external group name is quoted, and try to avoid naming your StarRocks role exactly the same as the external group if possible (though it should technically work).
sql
GRANT 'test_role' TO EXTERNAL GROUP 'test_group';
C. Feature Toggle (Rare)
While rare in 3.5.8, some deployments require the feature to be explicitly "seen" by the FE's internal catalog before the grammar is fully unlocked.
1. Verify the provider is visible: SHOW CREATE GROUP PROVIDER <name>;
2. Verify the security integration links it: SHOW SECURITY INTEGRATIONS; (The group_provider column must show your provider name).
3. Final Verification Checklist
To confirm the FE has fully "recognized" the feature:
1. Check Metadata: Run SHOW CREATE GROUP PROVIDER <name>. If it returns the DDL, the FE has it in its catalog.
2. Check Integration: Run SHOW SECURITY INTEGRATIONS. If your LDAP integration shows your provider in the group_provider property, the FE is actively trying to use it for logins.
3. Check Logs for Cache Sync: If the warnings in fe.warn.log have stopped after updating the filter, look for a "finish refresh ldap group cache" message in fe.log. This confirms the FE has successfully downloaded the group list into memory.
If the GRANT syntax still fails:
It is possible that in your specific build of 3.5.8, the EXTERNAL GROUP syntax is only enabled when using an external authorizer like Apache Ranger. However, for internal RBAC, the syntax above is the documented standard. If it continues to fail, you may need to define the role-to-group mapping via a File Group Provider as a workaround to see if the parser accepts it there.
References
• administration/user_privs/group_provider.md
• sql-reference/sql-statements/account-management/GRANT.md
• administration/user_privs/authentication/ldap_authentication.md
Referenceshc
10/07/2026, 5:15 PMmysql> GRANT ROLE test_group TO EXTERNAL GROUP 'test_group';
ERROR 1064 (HY000): Getting syntax error at line 1, column 11. Detail message: No viable statement for input 'GRANT ROLE test_group'.Rocky
10/07/2026, 5:15 PMhc
10/07/2026, 5:17 PMmysql> GRANT ROLE test_group TO EXTERNAL GROUP 'test_group';
ERROR 1064 (HY000): Getting syntax error at line 1, column 11. Detail message: No viable statement for input 'GRANT ROLE test_group'.Rocky
10/07/2026, 5:18 PMGRANT Syntax
In your second attempt, you received an error: No viable statement for input 'GRANT ROLE test_group'.
* The Error: You added the keyword ROLE before the role name.
* The Fix: The correct syntax for granting a role is GRANT <role_name> TO .... You do not use the keyword ROLE at the start.
* Correct Command: GRANT test_group TO EXTERNAL GROUP 'test_group';
2. Why the Unexpected input 'GROUP' Error?
If the command GRANT test_group TO EXTERNAL GROUP 'test_group'; still returns Unexpected input 'GROUP', it means your FE's SQL parser does not recognize the EXTERNAL GROUP keyword sequence. This usually occurs for two reasons:
* Missing Linkage: Your Security Integration and Group Provider are likely not "connected." You mentioned SHOW SECURITY INTEGRATIONS does not show a group_provider column.
* Action: You must explicitly bind the Group Provider to your Security Integration.
* Command:
sql
ALTER SECURITY INTEGRATION <your_ldap_integration_name>
SET ("group_provider" = "<your_group_provider_name>");
* After running this, use SHOW CREATE SECURITY INTEGRATION <name> to verify the property is listed. If it isn't there, the FE won't attempt to sync groups or enable the EXTERNAL GROUP grammar.
* Edition Restriction (Community vs. Enterprise): In StarRocks 3.5, the Group Provider feature (the ability to map LDAP/external groups to StarRocks roles) is typically an Enterprise Edition feature.
* In the Community Edition, you can authenticate via LDAP (users can log in), but you cannot map LDAP groups to roles using the EXTERNAL GROUP syntax.
* Verification: Run SELECT version();. If the version string does not mention "Enterprise" or "Pro," the EXTERNAL GROUP grammar may be disabled in the parser.
3. Fixing the LDAP Warnings
The warning LDAP group member attribute 'member' not found in attributes: {cn=cn: groups} confirms your FE is searching for groups but hitting a container (like cn=groups) instead of the actual group objects.
* The Fix: Change your ldap_group_filter to be more specific so it only finds actual group entries (which have the member or memberUid attribute).
* Example for FreeIPA/LDAP:
sql
ALTER GROUP PROVIDER <name> SET (
"ldap_group_filter" = "(objectClass=ipausergroup)" -- Or "posixGroup" / "groupOfNames"
);
4. Summary Checklist
1. Check Edition: Confirm if you are using the Enterprise/Pro edition. If you are on Community, this specific syntax is likely not available.
2. Bind the Provider: Ensure the Security Integration has the "group_provider" property set (see step 2).
3. Check Logs: You will only see finish refresh ldap group cache in fe.log once the Security Integration is correctly linked and the LDAP filter is corrected. Until then, the FE will not attempt to fetch groups.
If you are on Community Edition and need to manage permissions, you currently have to grant roles directly to individual users (e.g., GRANT role TO USER 'ldap_user'@'%';) rather than external groups.
References
• data_source/External_table.md
• sql-reference/sql-statements/Catalog/CREATE_EXTERNAL_CATALOG.mdhc
10/07/2026, 5:25 PMALTER SECURITY INTEGRATION <your_ldap_integration_name>
SET ("group_provider" = "<your_group_provider_name>");
was run and SHOW CREATE SECURITY INTEGRATION <name> listed the group provider. However HOW SECURITY INTEGRATIONS only shows Name Type Comment columns.Rocky
10/07/2026, 5:26 PMUnexpected input 'GROUP' error and the missing fe.log messages—suggests that while you have successfully created the metadata (DDL), the Group-to-Role mapping feature is likely not active in your current StarRocks edition or the LDAP search is failing so early that the system hasn't initialized the cache.
1. Fix the "member attribute not found" Warnings
The warning LDAP group member attribute 'member' not found in attributes: {cn=cn: groups} is the most critical clue.
* The Problem: Your StarRocks FE is connecting to LDAP but is "finding" the container (the folder) that holds the groups (usually cn=groups,cn=accounts...) instead of the groups themselves. Because a folder doesn't have a member attribute, the sync fails.
* The Fix: You must narrow your ldap_group_filter so it only matches actual group objects.
sql
-- For FreeIPA, use 'ipausergroup'
ALTER GROUP PROVIDER <your_provider_name> SET (
"ldap_group_filter" = "(objectClass=ipausergroup)"
);
If you are using standard LDAP/AD, try (objectClass=groupOfNames) or (objectClass=group).
2. Solve the GRANT Syntax Error
The error Unexpected input 'GROUP' at the EXTERNAL GROUP position indicates the SQL parser does not recognize that keyword sequence.
* Standard Syntax: The correct syntax is GRANT <role_name> TO EXTERNAL GROUP <group_name>;. (Note: Do not use the ROLE keyword before the role name, as that will trigger a different 1064 error).
* Edition Check: In StarRocks 3.5, while LDAP Authentication is available in the Community Edition, Group Provider (mapping LDAP groups to StarRocks Roles) is typically an Enterprise/Pro feature.
* If you are running the Community Edition, the EXTERNAL GROUP keyword is not supported in the SQL parser, which is why you see Unexpected input 'GROUP'.
* Verification: Run SELECT version();. If it does not specify "Enterprise" or "Pro", you cannot grant roles to external groups directly.
* Workaround for Community: You must grant roles to the individual LDAP users directly:
sql
GRANT <role_name> TO USER 'ldap_user_name'@'%';
3. Verify the "Missing" Columns and Logs
* SHOW SECURITY INTEGRATIONS: It is normal for this command to only show Name, Type, Comment. To see the group_provider link, you must use SHOW CREATE SECURITY INTEGRATION <name>, which you confirmed already shows the property.
* fe.log: You will only see finish refresh ldap group cache after the LDAP filter (Step 1) is fixed and the system successfully retrieves at least one group. If the filter is wrong or the feature is disabled (Community Edition), the background sync task will not start.
Summary of Actions
1. Check Edition: Verify if you are using StarRocks Enterprise. If not, the EXTERNAL GROUP syntax is unavailable.
2. Update Filter: Run the ALTER GROUP PROVIDER command above to target ipausergroup.
3. Check Permissions: Ensure the user running the GRANT command has the user_admin role.
4. Quote Group Names: If your group name has special characters, use single quotes: GRANT test_role TO EXTERNAL GROUP 'test-group-name';.
If you are on Enterprise and the error persists after fixing the filter, please check fe.log for any "Access Denied" or "Invalid Credentials" errors during the LDAP bind phase.
References
• administration/user_privs/group_provider.mdhc
10/07/2026, 5:33 PMGRANT Syntax Error?Rocky
10/07/2026, 5:33 PMGRANT syntax error.
In StarRocks, these are two entirely different stages of execution:
1. Parsing Stage (Syntax Error): This happens the moment you hit "Enter." The SQL parser checks if your command follows the StarRocks language rules. It does not check your LDAP connection, the database, or the log files. If it says Unexpected input 'GROUP', it means that the specific phrase EXTERNAL GROUP is not recognized by your StarRocks FE's "dictionary."
2. Execution Stage (LDAP Warning): This is a background process. The FE successfully parsed your CREATE GROUP PROVIDER command earlier and is now trying to talk to your LDAP server. It found a connection but is warning you that your search filter is returning an object (like a container) that doesn't have the member attribute.
Why you are getting the Syntax Error
The error No viable statement for input 'GRANT ROLE ...' and Unexpected input 'GROUP' occur for the following reasons:
1. Incorrect Keyword Usage
In your first error message, you used GRANT ROLE test_group ....
* The Problem: In StarRocks, you do not use the keyword ROLE immediately after GRANT.
* The Correct Syntax: GRANT <role_name> TO EXTERNAL GROUP '<group_name>';
2. StarRocks Edition (Most Likely)
The Group Provider feature (the ability to map LDAP groups to StarRocks roles) was introduced in StarRocks 3.5 and is an Enterprise Edition feature.
* While the CREATE GROUP PROVIDER command might be partially available in some builds, the parser for GRANT ... TO EXTERNAL GROUP is often strictly tied to the Enterprise/Pro license.
* If you are running the Community Edition, the SQL parser literally does not have the "EXTERNAL GROUP" branch in its grammar tree. This is why it tells you it expected USER or ROLE but found GROUP.
How to verify
Run this command:
sql
SELECT version();
* If the result is something like 3.5.x-community, you cannot use EXTERNAL GROUP. You must grant roles directly to LDAP users: GRANT <role> TO USER 'username'@'%';.
* If the result is 3.5.x-enterprise or 3.5.x-pro and you still get the error, ensure you have no typos and are using exactly:
GRANT test_group TO EXTERNAL GROUP 'test_group'; (Remove the word ROLE).
Addressing the LDAP Warning
Even though it's not causing the syntax error, the warning LDAP group member attribute 'member' not found means your group mapping won't work anyway. Your ldap_group_filter is hitting the group container (like cn=groups) instead of the group entries.
Fix: Update your filter to target the specific object class of your groups (e.g., (objectClass=ipausergroup) or (objectClass=groupOfNames)).
References
• data_source/External_table.md
• sql-reference/sql-statements/Catalog/CREATE_EXTERNAL_CATALOG.md
• data_source/feature-support-data-lake-analytics.md
• administration/user_privs/group_provider.mdhc
10/07/2026, 5:37 PMRocky
10/07/2026, 5:37 PMGRANT ... TO EXTERNAL GROUP syntax is an Enterprise Edition feature and is currently not available in any Community Edition of StarRocks (including v3.5, v4.0, or v4.1).
This is why your StarRocks cluster returns a syntax error (Unexpected input 'GROUP'). The SQL parser in the Community Edition binary does not contain the grammar rules for EXTERNAL GROUP.
Options to Resolve This:
1. Use the Enterprise/Pro Edition
If you need the capability to map LDAP/External groups directly to StarRocks roles, you must use the Enterprise/Pro binary. You can contact StarRocks support or their commercial partners (like CelerData) for a trial or license.
2. Community Edition Workaround (Manual Mapping)
Since the Community Edition does not support group-level role assignment, you must grant roles to individual users.
* Authenticate via LDAP: Users can still log in using their LDAP credentials via Security Integration.
* Authorize Individually: You must manually grant roles to each user:
sql
GRANT <role_name> TO USER 'ldap_user_name'@'%';
3. Why the metadata commands work
You noticed that CREATE GROUP PROVIDER and ALTER SECURITY INTEGRATION might succeed or show up in DDL. This is because the Community Edition shares some metadata code with the Enterprise Edition, but the SQL Parser (which reads your GRANT command) and the Background Sync Logic (which populates the cache) are restricted in the Community binary.
Summary of Version Compatibility
Feature | Community Edition | Enterprise/Pro Edition
LDAP Authentication | ✅ Supported | ✅ Supported
Security Integration (OAuth/JWT) | ❌ Limited/No | ✅ Supported
Group Provider (Group Sync) | ❌ No | ✅ Yes (from v3.5)
GRANT TO EXTERNAL GROUP | ❌ No | ✅ Yes (from v3.5)
If you are using StarRocks for an enterprise environment and require this automation, I recommend reaching out to the StarRocks community Slack or their commercial team to discuss the Enterprise transition.
References
• administration/user_privs/group_provider.md
• introduction/what_is_starrocks.md
• developers/How_to_Contribute.mdhc
10/07/2026, 5:41 PMRocky
10/07/2026, 5:41 PMmysql.user table, StarRocks delegates the entire login process to your LDAP via a Security Integration.
2. Authorization: Upon successful login, StarRocks checks which LDAP groups the user belongs to (using the Group Provider). It then assigns the session any roles that were granted to those groups using GRANT <role> TO EXTERNAL GROUP <group_name>.
3. Virtual Identity: StarRocks creates a temporary, session-scoped "dummy user" internally. This identity exists only for the duration of the connection and is discarded when the user logs out. No CREATE USER command is ever needed.
Requirements to achieve this
To make this work, you must fulfill three requirements:
1. Use StarRocks Enterprise/Pro Edition
As established in our previous conversation, the SQL parser for EXTERNAL GROUP and the logic for session-based dummy users are Enterprise-only features. In the Community Edition, every user must be pre-created with CREATE USER.
2. Configure the Security Integration
You must link your Security Integration to your Group Provider and (optionally) restrict login to specific groups.
sql
CREATE SECURITY INTEGRATION ldap_integration
PROPERTIES (
"type" = "authentication_ldap_simple",
"group_provider" = "your_group_provider_name", -- Link to your Group Provider
"permitted_groups" = "bi_users,admin_users", -- Only users in these LDAP groups can log in
"authentication_ldap_simple_server_host" = "...",
...
);
3. Map Groups to Roles
Once the integration is active, you grant permissions to the group name exactly as it appears in LDAP:
sql
GRANT read_only_role TO EXTERNAL GROUP 'bi_users';
Why this explains your previous error
The reason you encountered the Unexpected input 'GROUP' error is that your current StarRocks version (Community) expects the GRANT command to target a local USER or ROLE. It does not recognize EXTERNAL GROUP because the "Virtual User" feature is not compiled into the Community binary.
Summary
* Is it possible? Yes, in StarRocks v3.5+ Enterprise/Pro Edition.
* Does the user need to exist? No. The user can log in immediately upon their first connection.
* Workflow: Login (LDAP) → Fetch Groups (Group Provider) → Map Roles (External Group Grant) → Session Starts.
If you are evaluating this for a production environment, you would need to switch from the Community Edition to the Enterprise/Pro distribution to enable this specific "zero-touch" user management flow.
References
• administration/user_privs/authentication/security_integration.md
• administration/user_privs/group_provider.md
• best_practices/authentication_authorization.md
References
• administration/user_privs/group_provider.md
• administration/user_privs/authentication/ldap_authentication.mdhc
10/07/2026, 5:50 PMRocky
10/07/2026, 5:51 PMGRANT command isn't working:
1. Unified Documentation
The documentation at <http://docs.starrocks.io|docs.starrocks.io> is often a "unified" source. While most of the content covers the open-source Community Edition, it also includes advanced features developed for Enterprise users. Unfortunately, the documentation team sometimes misses the specific "Enterprise" or "Pro" label on new features like the Group Provider or External Group mapping.
2. Grammar-Level Restrictions
The Unexpected input 'GROUP' error is the most definitive sign. In the Community Edition, the SQL parser (the part of the code that understands your commands) literally does not have the "EXTERNAL GROUP" branch in its grammar file.
* In Community: GRANT is followed by <privilege> and then TO {ROLE | USER}.
* In Enterprise: the grammar is extended to TO {ROLE | USER | EXTERNAL GROUP}.
3. Feature vs. Metadata
You might have noticed that CREATE GROUP PROVIDER or ALTER SECURITY INTEGRATION worked without a syntax error. This is because the metadata structures for these features often exist in the shared code, but the runtime logic and extended SQL syntax (like mapping those groups to roles) are locked behind the Enterprise/Pro binary.
How to confirm for your specific installation
You can check if your version supports the Enterprise features by looking for the "Pro" or "Enterprise" suffix in the version string:
sql
SELECT version();
If it returns something like 3.x.x-community, then the GRANT ... TO EXTERNAL GROUP syntax is simply not compiled into your FE (Frontend) binary.
Is there a workaround for Community?
If you are sticking with the Community Edition, the "Virtual User" goal isn't currently possible. You must follow the standard LDAP workflow:
1. Create the user manually (or via script): CREATE USER 'username'@'%' IDENTIFIED WITH authentication_ldap_simple ...;
2. Grant roles directly to the user: GRANT role_name TO USER 'username'@'%';
Rocky's Tip: If you're looking for a feature comparison, the most reliable way is often the StarRocks vs CelerData (Enterprise) feature lists, as the community documentation can sometimes be ambiguous about which binary contains which logic.hc
10/08/2026, 12:25 PMRocky
10/08/2026, 12:25 PM"Enterprise-Ready Security and Authentication"Under this heading, the documentation specifically lists: * OAuth 2.0 and JWT support. * Security Integration with LDAP and group-based access (This is the feature that enables
GRANT ... TO EXTERNAL GROUP).
2. Why the error Unexpected input 'GROUP' occurs
In the Community Edition, the SQL parser does not include the grammar for "EXTERNAL GROUP." When you run a GRANT command, the Community binary only expects TO USER or TO ROLE.
You can verify your current edition by running:
sql
SELECT version();
If the result contains -community, the binary itself lacks the code necessary to execute group-based grants.
3. Feature Comparison for Clarity
Feature | StarRocks Community | StarRocks Enterprise / CelerData Pro
LDAP/AD Authentication | ✅ Included | ✅ Included
Manual User Creation (CREATE USER) | ✅ Required | ❌ Optional (Virtual users supported)
Group Provider (Group Sync) | ❌ Not Included | ✅ Included
GRANT ... TO EXTERNAL GROUP | ❌ Not Included | ✅ Included
Recommended Action
If you are currently using the Community Edition and require this "zero-touch" user management (where users are granted permissions automatically based on LDAP groups), you would need to:
1. Switch to the Enterprise binary (provided by CelerData or StarRocks commercial partners).
2. Use the Workaround: In the Community Edition, you must use a script to sync your LDAP groups to StarRocks by manually running CREATE USER and GRANT ... TO USER for each person.
For further confirmation or to request an Enterprise trial, you can reach out to the #starrocks-enterprise or #questions channels in the StarRocks Community Slack.
References
• administration/user_privs/group_provider.md
• administration/user_privs/authentication/security_integration.md
• introduction/what_is_starrocks.md
References
• administration/user_privs/group_provider.md
• data_source/catalog/iceberg/iceberg_rest_security.md
• sql-reference/sql-statements/account-management/GRANT.md