Slackbot
02/03/2026, 2:34 PMMarian
02/12/2026, 9:55 PMRocky
02/12/2026, 9:55 PMsql
CREATE SECURITY INTEGRATION aws_sso_integration
PROPERTIES (
"type" = "authentication_oauth2",
"auth_server_url" = "<https://portal.sso>.<region>.<http://amazonaws.com/|amazonaws.com/>...",
"token_server_url" = "<https://oidc>.<region>.<http://amazonaws.com/token|amazonaws.com/token>",
"client_id" = "<your_client_id>",
"client_secret" = "<your_client_secret>",
"jwks_url" = "<https://oidc>.<region>.<http://amazonaws.com/keys.json|amazonaws.com/keys.json>",
"redirect_url" = "http://<fe_ip>:<fe_http_port>/api/oauth2",
"principal_field" = "email" -- or another field matching the StarRocks username
);
2. Create a user that uses this integration:
sql
CREATE USER 'username' IDENTIFIED WITH authentication_oauth2;
2. Accessing AWS Resources (Temporary Credentials)
If you are trying to use AWS Temporary Credentials (Access Key, Secret Key, and Session Token) to access data in S3 or Glue, StarRocks supports this via the aws.s3.session_token property.
When creating a Catalog or an External Table, you can provide the temporary credentials like this:
sql
CREATE EXTERNAL TABLE my_table (
...
) ENGINE=FILE
PROPERTIES (
"path" = "<s3://my-bucket/data/>",
"format" = "parquet",
"aws.s3.access_key" = "ASIA...", -- Temporary Access Key
"aws.s3.secret_key" = "...", -- Temporary Secret Key
"aws.s3.session_token" = "...", -- Required for temporary access
"aws.s3.region" = "us-east-1"
);
*Note: Since temporary credentials expire, for long-running clusters, it is highly recommended to use IAM Role-based authentication (Assumed Role) or Instance Profiles, which StarRocks handles automatically without requiring manual token updates.*
Summary
* For User Login: Use OAuth 2.0 (v3.5+) integrated with AWS IAM Identity Center.
* For Data Access: Use aws.s3.session_token for manual temporary keys, or ideally, use IAM Roles to avoid manual credential management.
If "TEAM" refers to a specific internal wrapper or tool your company uses to provide these tokens, you would simply feed the generated access_key, secret_key, and session_token into the StarRocks configuration.
References
• administration/user_privs/authentication/oauth2_authentication.md
• administration/user_privs/authentication/security_integration.md
• integrations/authenticate_to_aws_resources.mdMarian
02/16/2026, 8:50 AMRocky
02/16/2026, 8:50 AMSECURITY INTEGRATION, you need to configure an OAuth 2.0 flow. This allows users to authenticate via their Entra ID identity when accessing the StarRocks Web UI or using supported JDBC clients.
Here is the step-by-step guide for your Helm/Kubernetes environment.
1. Register an Application in Microsoft Entra ID
First, you must create an App Registration in your Azure Portal:
1. Redirect URI: Set this to the public URL of your StarRocks FE, specifically the OAuth callback endpoint.
* Example: <https://starrocks.yourdomain.com/api/oauth2> (Ensure this URI is reachable from the user's browser).
2. Client Secret: Generate a new client secret and save the value.
3. Endpoints: Note your Tenant ID. You will use it to construct the URLs below.
2. Configure StarRocks via SQL
Since you are using Helm and K8s, the most flexible way is to run a SQL command after the cluster is up. This creates a global security integration.
Run the following SQL as an admin user:
sql
CREATE SECURITY INTEGRATION entra_id_integration
PROPERTIES (
"type" = "authentication_oauth2",
"auth_server_url" = "<https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/authorize>",
"token_server_url" = "<https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/token>",
"jwks_url" = "<https://login.microsoftonline.com/<TENANT_ID>/discovery/v2.0/keys>",
"client_id" = "<YOUR_CLIENT_ID>",
"client_secret" = "<YOUR_CLIENT_SECRET>",
"redirect_url" = "https://<YOUR_FE_DOMAIN>/api/oauth2",
"principal_field" = "preferred_username", -- Entra ID usually uses this or "email"
"required_issuer" = "<https://login.microsoftonline.com/<TENANT_ID>/v2.0>"
);
3. Kubernetes & Helm Considerations
Because StarRocks is running in Kubernetes, ensure the following:
* Ingress/LoadBalancer: Your FE must be exposed via an Ingress or LoadBalancer. The redirect_url in the SQL above must match the external domain you provide to your users.
* FE Configuration (Optional): If you want these settings to be the default for all OAuth2 users without repeating them in every CREATE USER statement, you can add them to your values.yaml for the Helm chart:
yaml
starrocksFeSpec:
config:
oauth2_auth_server_url: "<https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/authorize>"
oauth2_token_server_url: "<https://login.microsoftonline.com/<TENANT_ID>/oauth2/v2.0/token>"
oauth2_jwks_url: "<https://login.microsoftonline.com/<TENANT_ID>/discovery/v2.0/keys>"
# etc...
* Version Check: Ensure you are using StarRocks v3.5.0 or later for full SECURITY INTEGRATION and OAuth2 support.
4. Create Users for Entra ID
Once the integration is created, you can create users that authenticate via Entra ID:
sql
-- Create a user that maps to an Entra ID email/username
CREATE USER "<mailto:user@yourdomain.com|user@yourdomain.com>"
AUTHENTICATION entra_id_integration;
-- Or grant it to a role
GRANT ALL ON DATABASE your_db TO USER "<mailto:user@yourdomain.com|user@yourdomain.com>";
5. Client Requirements
* Web UI: Simply navigate to the FE HTTP port (default 8030) and select the OAuth2 login option.
* MySQL Client: To use OAuth2 via a CLI/JDBC, you must use MySQL Client 9.2 or later, as it supports the required authentication plugin (authentication_openid_connect).
Summary Checklist
* [ ] App Registration in Entra ID with correct Redirect URI.
* [ ] CREATE SECURITY INTEGRATION executed in StarRocks.
* [ ] FE is accessible via the redirect_url domain.
* [ ] User created in StarRocks matching the preferred_username claim from Entra ID.
References
• administration/management/FE_configuration.md
• administration/user_privs/authentication/oauth2_authentication.mdRocky
02/16/2026, 8:50 AMMarian
02/16/2026, 8:53 AMauthentication_chain to authenticate the user. After the authentication is successful and the user is allowed to log in, StarRocks creates a virtual user in the session for the user to perform subsequent operations.?Rocky
02/16/2026, 8:53 AMSHOW USERS.
2. Authorization (Permissions)
Because these users are not stored in StarRocks, you cannot use the standard GRANT statements to assign permissions to them directly (since the user doesn't "exist" to receive the grant). To handle permissions for these virtual users, you have two main options:
* External Authorization (Recommended): Use a plugin like Apache Ranger. StarRocks will check Ranger to see what permissions the external identity has.
* Group Provider: You can configure a Group Provider to map external groups (from LDAP/IDP) to StarRocks Roles. When the virtual user logs in, StarRocks identifies their groups and automatically assigns them the corresponding StarRocks roles for that session.
3. Comparison: Security Integration vs. Native User
If you want the user to be persistent in StarRocks but still use external password verification, you would use the "Native User" approach instead:
* Native User: You run CREATE USER 'username' IDENTIFIED WITH authentication_ldap_simple .... This creates a permanent record in StarRocks, allowing you to use native GRANT commands, while still offloading the password check to LDAP.
* Security Integration: You run CREATE SECURITY INTEGRATION ... and set the authentication_chain. This is a "hands-off" approach where you don't manage individual users in StarRocks at all, but it requires external authorization or group mapping.
In summary: Yes, your understanding is spot on—it avoids the manual overhead of creating users by using temporary session-based identities!
References
• administration/user_privs/authentication/security_integration.md
• administration/management/FE_configuration.md
• best_practices/authentication_authorization.mdMarian
02/16/2026, 8:55 AMRocky
02/16/2026, 8:55 AMMarian
02/16/2026, 8:58 AMRocky
02/16/2026, 8:58 AMStarRocks-SSO.
* Redirect URI: Select Web and enter http://<fe_host>:<fe_http_port>/api/oauth2.
2. Get Credentials:
* Copy the Application (client) ID and Directory (tenant) ID.
3. Create Client Secret:
* Go to Certificates & secrets > New client secret. Copy the Value.
4. Configure API Permissions:
* Ensure User.Read (delegated) is present.
* In Token configuration, you may want to add optional claims like email or preferred_username to use as the StarRocks username.
Step 2: Create Security Integration in StarRocks
Log in to StarRocks as a user with SYSTEM level privileges and execute the following SQL. Replace {tenant_id}, {client_id}, and {client_secret} with your Azure values.
sql
CREATE SECURITY INTEGRATION entra_id_integration
PROPERTIES (
"type" = "authentication_oauth2",
"auth_server_url" = "<https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/authorize>",
"token_server_url" = "<https://login.microsoftonline.com/{tenant_id}/oauth2/v2.0/token>",
"jwks_url" = "<https://login.microsoftonline.com/{tenant_id}/discovery/v2.0/keys>",
"client_id" = "{client_id}",
"client_secret" = "{client_secret}",
"redirect_url" = "http://<fe_host>:<fe_http_port>/api/oauth2",
"principal_field" = "preferred_username", -- The claim in the JWT to use as the StarRocks username
"required_issuer" = "<https://login.microsoftonline.com/{tenant_id}/v2.0>"
);
Step 3: Enable the Authentication Chain
You must tell StarRocks to use this integration. This is a global FE configuration.
sql
ADMIN SET FRONTEND CONFIG (
"authentication_chain" = "entra_id_integration"
);
Note: StarRocks prioritizes local `root`/`admin` users first. If a local user doesn't exist, it checks the security integration.
Step 4: External Authorization (Required)
Since Security Integration does not currently support native StarRocks authorization, you must integrate StarRocks with Apache Ranger to define what these Entra ID users are allowed to do.
──────────
Alternative: Manual User Creation (OAuth 2.0)
If you do not want to use Apache Ranger and prefer StarRocks' native RBAC, you can create users manually and link them to Entra ID:
1. Create the user:
sql
CREATE USER "<mailto:user@example.com|user@example.com>" IDENTIFIED WITH authentication_oauth2;
2. Configure FE fe.conf with the OAuth2 parameters (starts with oauth2_...) so that individual users don't need the properties defined every time.
How to Connect
After configuration, users can connect via:
* Web UI: Accessing the FE HTTP port will trigger the Entra ID login flow.
* JDBC: Use a connection string that supports OAuth 2.0, ensuring the driver can handle the redirect flow.
For more details on the connection parameters, you can refer to the OAuth 2.0 Authentication guide.
References
• administration/user_privs/authentication/oauth2_authentication.mdMarian
02/16/2026, 11:08 AMRocky
02/16/2026, 11:08 AMoauth2_* configurations in fe.conf defines the global provider settings, but you must still manually create the user in StarRocks and associate them with the OAuth 2.0 authentication method.
Run the following SQL command as an admin (e.g., using the root user) to create the user:
sql
-- Replace '<mailto:smolimarian@outlook.com|smolimarian@outlook.com>' with the exact username
-- that matches the 'preferred_username' claim in your Entra ID token.
CREATE USER '<mailto:smolimarian@outlook.com|smolimarian@outlook.com>' IDENTIFIED WITH authentication_oauth2;
If the user does not exist in StarRocks, the server will immediately return Access denied.
2. Verify StarRocks Version
OAuth 2.0 authentication is supported starting from StarRocks v3.5.0. Ensure your cluster is running at least this version.
3. Match the principal_field
You configured oauth2_principal_field=preferred_username.
* StarRocks will extract the value of the preferred_username claim from the JWT token provided by Microsoft Entra ID.
* The username you use in the -u flag of the MySQL client must exactly match this value.
* In Microsoft Entra ID, preferred_username is usually the user's email or UPN (e.g., <mailto:smolimarian@outlook.com|smolimarian@outlook.com>). If it is just smolimarian, you should create the user and log in as smolimarian instead.
4. Interactive Authentication Flow
When you run the mysql command, StarRocks (from v3.5+) will not ask for a password in the traditional way. Instead, it should return a URL to your terminal:
1. Copy the URL returned in the error message or console.
2. Open it in a browser to complete the Microsoft Entra ID login.
3. Once authenticated, the MySQL client session will proceed.
If the client is failing before showing the URL, it is likely because the MySQL 9.2 client doesn't know which authentication plugin to use for the handshake. Try explicitly specifying the plugin or enabling cleartext:
bash
docker run -it --rm mysql:9.2 mysql \
-h <http://k8s-starrock-starrock-531efebc63-94b9b34a44bfcb1f.elb.ap-southeast-1.amazonaws.com|k8s-starrock-starrock-531efebc63-94b9b34a44bfcb1f.elb.ap-southeast-1.amazonaws.com> \
-P 9030 \
-u '<mailto:smolimarian@outlook.com|smolimarian@outlook.com>' \
--enable-cleartext-plugin
5. Check fe.conf Configuration
Ensure the following are correctly set and you have restarted the FEs:
* `oauth2_redirect_url`: This must be https://<starrocks_fe_ip>:<fe_http_port>/api/oauth2. Ensure the port is the HTTP port (default 8030), not the MySQL port (9030).
* `oauth2_client_secret`: Ensure this is the actual secret string.
* `oauth2_jwks_url`: Double-check this is reachable by the StarRocks FE nodes.
Summary of why it asks for a password:
The MySQL client defaults to password-based authentication if it doesn't recognize the server's challenge or if the user isn't found. If StarRocks hasn't been told that '<mailto:smolimarian@outlook.com|smolimarian@outlook.com>' is an OAuth2 user (via CREATE USER), it defaults to checking its internal password store, finds no password/user, and denies access.
References
• administration/user_privs/authentication/oauth2_authentication.md
• administration/management/FE_configuration.mdMarian
02/16/2026, 11:10 AMRocky
02/16/2026, 11:11 AM<mailto:smolimarian@outlook.com|smolimarian@outlook.com>, contains special characters like <, >, and |. These are likely artifacts from copying a link from Slack or an email client. StarRocks does not allow these characters in a username.
2. Naming Restrictions: Even if you use <mailto:smolimarian@outlook.com|smolimarian@outlook.com>, StarRocks has strict naming conventions for usernames. According to the System Limits, a username:
* Can only consist of letters (a-z, A-Z), digits (0-9), and underscores (_).
* Cannot contain special characters like @ or ..
* In the StarRocks user identity format username@'host', the @ symbol is a reserved delimiter between the username and the host.
How to Fix This
To use OAuth 2.0 authentication, the StarRocks username must match the value returned by the identity provider in the field specified by principal_field (e.g., sub or preferred_username).
Option 1: Use a valid username
If your identity provider can provide a simple username (e.g., smolimarian), create the user like this:
sql
CREATE USER 'smolimarian' IDENTIFIED WITH authentication_oauth2;
Option 2: Map the email to a valid name (if possible)
If your identity provider's principal_field always returns an email address, you currently cannot use that exact email address as the StarRocks username because of the @ and . characters. You should configure your OAuth 2.0 provider to return a compatible string (letters, digits, underscores) in a specific claim and set that claim as the principal_field.
Example of a correct OAuth 2.0 user creation:
sql
CREATE USER smolimarian IDENTIFIED WITH authentication_oauth2 AS
'{
"auth_server_url": "<https://example.com/auth>",
"token_server_url": "<https://example.com/token>",
"client_id": "your_client_id",
"client_secret": "your_client_secret",
"redirect_url": "<http://your-fe-host:8030/api/oauth2>",
"jwks_url": "<https://example.com/certs>",
"principal_field": "preferred_username", -- Ensure this field in the JWT contains a valid StarRocks username
"required_issuer": "<https://example.com>",
"required_audience": "your_client_id"
}';
Summary of Username Rules:
* Characters allowed: a-z, A-Z, 0-9, _
* Max length: 128 characters.
* Characters NOT allowed: @, ., -, and any other special symbols.
References
• sql-reference/sql-statements/account-management/CREATE_USER.md
• administration/user_privs/authentication/native_authentication.md
• administration/user_privs/authorization/user_privs.mdMarian
02/16/2026, 11:29 AMRocky
02/16/2026, 11:30 AM_ instead of @ in your StarRocks usernames, you need to align the Claim sent by Entra ID with the Username defined in StarRocks.
StarRocks does not currently perform string transformations (like regex replace) on the incoming JWT claims. Therefore, the transformation must happen on the Identity Provider (Entra ID) side.
1. Configure Claims Transformation in Entra ID
You must create a custom claim in Entra ID that replaces the @ character with _ before the token is sent to StarRocks.
1. Log in to the Azure Portal.
2. Navigate to Microsoft Entra ID > Enterprise applications.
3. Select your StarRocks application.
4. Go to Single sign-on > Attributes & Claims.
5. Click Add new claim (or edit an existing one).
* Name: e.g., transformed_username
* Namespace: (leave blank or use your standard)
* Source: Transformation
6. In the Manage transformation blade:
* Transformation: Replace()
* Parameter 1 (Attribute): user.userprincipalname (or user.mail)
* Parameter 2 (Value to find): @
* Parameter 3 (Replacement value): _
7. Save the claim. Note the name of this claim (e.g., transformed_username).
2. Configure StarRocks to use the transformed claim
In StarRocks, you must tell the system to look at your new custom claim to determine the username. This is done using the principal_field property.
Option A: Global Configuration (fe.conf)
Add the following to your fe.conf on all Frontends and restart them:
properties
oauth2_client_id = <your_client_id>
oauth2_client_secret = <your_client_secret>
oauth2_auth_server_url = <https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/authorize>
oauth2_token_server_url = <https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token>
oauth2_jwks_url = <https://login.microsoftonline.com/<tenant_id>/discovery/v2.0/keys>
# Set this to the name of the claim you created in Step 1
oauth2_principal_field = transformed_username
Option B: Security Integration (SQL)
If you are using StarRocks v3.5.0+, you can use a Security Integration:
sql
CREATE SECURITY INTEGRATION entra_id_integration
PROPERTIES (
"type" = "authentication_oauth2",
"client_id" = "<your_client_id>",
"client_secret" = "<your_client_secret>",
"auth_server_url" = "<https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/authorize>",
"token_server_url" = "<https://login.microsoftonline.com/<tenant_id>/oauth2/v2.0/token>",
"jwks_url" = "<https://login.microsoftonline.com/<tenant_id>/discovery/v2.0/keys>",
"principal_field" = "transformed_username" -- Matches your Entra ID claim
);
3. Create the User in StarRocks
When you create the user in StarRocks, the username must match the result of the transformation (e.g., <http://user_example.com|user_example.com> instead of <mailto:user@example.com|user@example.com>).
sql
-- The username '<http://rocky_starrocks.com|rocky_starrocks.com>' must match exactly
-- what Entra ID sends in the 'transformed_username' claim.
CREATE USER '<http://rocky_starrocks.com|rocky_starrocks.com>' IDENTIFIED WITH authentication_oauth2;
Why is this necessary?
StarRocks' OAuth 2.0 implementation (introduced in v3.5.0) requires that the value found in the principal_field of the JWT is identical to the StarRocks username. Since StarRocks does not have a built-in "replace" function for these fields, Entra ID's "Claims Transformation" is the standard way to bridge this gap.
References
• administration/user_privs/authentication/oauth2_authentication.md
• administration/management/FE_configuration.mdRocky
02/16/2026, 11:30 AMMarian
02/16/2026, 11:58 AMRocky
02/16/2026, 11:59 AMprincipal_field property.
The "best" claim to use depends on how you want to identify your users within StarRocks. Here are the most common choices:
*1. upn (User Principal Name) — Recommended for Azure AD*
* Why: This is the standard, human-readable identifier in Azure (e.g., <mailto:john.doe@company.com|john.doe@company.com>).
* StarRocks Username: If you use this, you would create your user in StarRocks as:
CREATE USER '<mailto:john.doe@company.com|john.doe@company.com>' IDENTIFIED WITH authentication_oauth2 ...
*2. preferred_username — Most Compatible*
* Why: This is a standard OIDC claim. In Azure AD, it often defaults to the UPN or the email address. It is frequently used in StarRocks examples.
* Configuration: Set principal_field to "preferred_username".
*3. email — Use with Caution*
* Why: Easy to remember, but users might have multiple emails or their email might change.
* Configuration: Set principal_field to "email".
──────────
How to use it in StarRocks
You need to tell StarRocks which claim to look at. You can do this in two ways:
Option A: In the fe.conf (Global Default)
Add this to your FrontEnd configuration file so it applies to all OAuth/JWT users:
properties
# For OAuth 2.0
oauth2_principal_field = upn
# For JWT
jwt_principal_field = upn
Option B: When Creating a Specific User
You can specify it per user during the CREATE USER command:
sql
CREATE USER '<mailto:john.doe@company.com|john.doe@company.com>' IDENTIFIED WITH authentication_oauth2 AS
'{
"auth_server_url": "...",
"token_server_url": "...",
"client_id": "...",
"principal_field": "upn",
...
}';
Summary Recommendation
* Use upn if your organization relies heavily on Azure AD and you want the StarRocks username to match the user's login ID.
* Use preferred_username if you want to follow general OIDC standards.
Important: The value of the claim you choose must exactly match the username you create inside StarRocks. If the upn is <mailto:alice@example.com|alice@example.com>, the StarRocks user must be created as '<mailto:alice@example.com|alice@example.com>'.
References
• administration/management/FE_configuration.md
• administration/user_privs/authentication/oauth2_authentication.md
• administration/user_privs/authentication/jwt_authentication.md
• administration/user_privs/group_provider.mdMarian
02/16/2026, 11:59 AMRocky
02/16/2026, 12:00 PM@ character as a delimiter to separate the username from the host (the user_identity format is username@'host').
If you are experiencing issues, it is likely due to one of the following reasons:
1. Syntax Ambiguity (Host Delimiter)
If you try to create a user like CREATE USER <mailto:user@example.com|user@example.com> IDENTIFIED BY 'password';, StarRocks will interpret user as the username and <http://example.com|example.com> as the host. If the host part is not properly quoted or formatted, it will result in a syntax error.
Solution: Use single quotes to explicitly define the username and the host.
* If you want the username to be <mailto:user@example.com|user@example.com> and allow connection from any host:
sql
CREATE USER '<mailto:user@example.com|user@example.com>'@'%' IDENTIFIED BY 'your_password';
* If you just wanted to specify a user jack from a specific domain:
sql
CREATE USER 'jack'@'<http://example.com|example.com>' IDENTIFIED BY 'your_password';
2. Naming Convention Limits
According to the StarRocks System Limits, usernames are generally restricted to:
* Digits (0-9)
* Letters (a-z or A-Z)
* Underscores (_)
The documentation states that names for objects like usernames "can only consist of digits, letters, and underscores." Even with quotes, some versions of StarRocks may strictly enforce this alphanumeric rule for the username portion of the identity.
Workaround:
If the quoted version ('<mailto:user@email.com|user@email.com>'@'%') still returns a naming convention error, you may need to replace the @ and . characters with underscores:
sql
CREATE USER 'user_example_com'@'%' IDENTIFIED BY 'your_password';
3. External Authentication (LDAP/OAuth2)
If you are using external authentication (like LDAP or OAuth2) where the identity is an email address:
* The StarRocks username (the local handle) should still follow the alphanumeric/underscore naming convention.
* You can map this local user to the external identity in the IDENTIFIED WITH clause.
sql
-- Example mapping a local user 'tom' to an LDAP DN containing special characters
CREATE USER tom IDENTIFIED WITH authentication_ldap_simple AS 'uid=tom@example.com,ou=company,dc=example,dc=com';
Summary Checklist:
1. Enclose the username in single quotes: 'user@name'.
2. Enclose the host in single quotes: '%' or '192.168.1.1'.
3. If it still fails, check the error message. If it mentions "Invalid name," you must stick to letters, numbers, and underscores for the username.
References
• sql-reference/System_limit.md
• administration/user_privs/authorization/user_privs.md
• sql-reference/sql-statements/account-management/CREATE_USER.md
• administration/user_privs/authentication/native_authentication.md
• faq/Sql_faq.md
• sql-reference/sql-statements/keywords.md
• administration/management/FE_configuration.mdMarian
02/16/2026, 2:29 PMtest PROPERTIES (
"auth_server_url" = "https://login.microsoftonline.com/acede1ad-6571-4567-acdf-6ae254b5e647/oauth2/v2.0/authorize", "required_issuer" = "https://login.microsoftonline.com/acede1ad-6571-4567-acdf-6ae254b5e647/v2.0", "token_server_url" = "https://login.microsoftonline.com/acede1ad-6571-4567-acdf-6ae254b5e647/oauth2/v2.0/token", "client_secret" = "***", "type" = "authentication_oauth2", "required_audience" = "e608ddcc-6440-4a3c-9ebd-abbba137506b", "principal_field" = "preferred_username", "client_id" = "e608ddcc-6440-4a3c-9ebd-abbba137506b", "redirect_url" = "https://starrocks.dev.engagerocket.co/api/oauth2", "jwks_url" = "https://login.microsoftonline.com/acede1ad-6571-4567-acdf-6ae254b5e647/discovery/v2.0/keys"
) |
+----------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
1 row in set (0.19 sec)
mysql>
mysql> SELECT CURRENT_USER();
+----------------+
| CURRENT_USER() |
+----------------+
| 'root'@'%' |
+----------------+
1 row in set (0.20 sec)
mysql>
mysql> ADMIN SET FRONTEND CONFIG ("authentication_chain" = "test,native");
Query OK, 0 rows affected (0.19 sec)
mysql> ADMIN SET FRONTEND CONFIG ("authentication_chain" = "native,test");
Query OK, 0 rows affected (0.21 sec)
mysql> ADMIN SHOW FRONTEND CONFIG LIKE 'authentication_chain';
+----------------------+------------+----------------+----------+-----------+---------+
| Key | AliasNames | Value | Type | IsMutable | Comment |
+----------------------+------------+----------------+----------+-----------+---------+
| authentication_chain | [] | [native, test] | String[] | true | |
+----------------------+------------+----------------+----------+-----------+---------+
1 row in set (0.19 sec) docker run -it --rm mysql:9.2 mysql \
-h k8s-starrock-starrock-531efebc63-94b9b34a44bfcb1f.elb.ap-southeast-1.amazonaws.com \
-P 9030 \
-u marian.s@scoutbytes.com
ERROR 1045 (28000): Access denied for user 'marian.s@test.com' (using password: NO)Rocky
02/16/2026, 2:29 PMmysql command-line client does not support the OAuth 2.0 Authorization Code flow (which requires a browser redirect to log in and receive a code). StarRocks' OAuth2 implementation for the MySQL protocol typically requires a specialized plugin or client that can handle this interactive handshake.
Currently, StarRocks OAuth2 is primarily designed for:
* StarRocks Web UI (FE HTTP port).
* JDBC connections using the starrocks-jdbc-oauth2-plugin.
2. User Creation in StarRocks
Even with a Security Integration, the user must typically exist in StarRocks or be part of a mapped group. If you haven't created the user yet, you should create them and associate them with the OAuth2 authentication method:
sql
CREATE USER '<mailto:marian.s@scoutbytes.com|marian.s@scoutbytes.com>' IDENTIFIED WITH 'test';
(Note: Replace 'test' with your security integration name if you want to bind this specific user to that integration.)
3. Authentication Chain Logic
In your configuration, you set "authentication_chain" = "native, test".
* StarRocks first checks if <mailto:marian.s@scoutbytes.com|marian.s@scoutbytes.com> is a native user.
* If it doesn't find a native user with that name (or if the password fails), it moves to the test (OAuth2) integration.
* Since the mysql client doesn't send an OAuth2 token or handle the redirect, the authentication fails at this stage.
4. Important Constraint on OAuth2
According to StarRocks documentation, there are restrictions on combining OAuth2 with other methods in the `authentication_chain`:
"You cannot specify multiple OAuth 2.0 security integrations or one with other security integrations."While
native is usually the exception to allow root login, ensure your StarRocks version (3.3.x/3.4.x+) fully supports the specific chain you are using.
Troubleshooting Steps:
1. Verify User Existence: Run SHOW USERS; to see if the user exists and what their authentication host/method is.
2. Use Web UI: Try logging into the StarRocks Web UI (usually port 8030) using the OAuth2 button. If that works, your Security Integration properties (URLs, Client ID, etc.) are correct.
3. Check FE Logs: Look at fe.log and fe.warn.log. They often contain the specific reason for the "Access denied" (e.g., "JWT validation failed", "User not found", or "Unsupported authentication protocol").
4. Identity Mapping: Ensure the principal_field (which you set to preferred_username) in your Azure AD token exactly matches the username <mailto:marian.s@scoutbytes.com|marian.s@scoutbytes.com> you are using to log in.
If you specifically need CLI access with OAuth2, you may need to use a JDBC-based tool with the StarRocks OAuth2 plugin, as the native MySQL CLI cannot perform the browser-based login required by Azure AD.
References
• administration/user_privs/authentication/security_integration.md
• administration/user_privs/authentication/oauth2_authentication.mdRocky
02/16/2026, 2:31 PMauthentication_chain, but you're encountering an Access denied error.
The error ERROR 1045 (28000): Access denied for user '<mailto:marian.s@scoutbytes.com|marian.s@scoutbytes.com>' (using password: NO) indicates that the MySQL client is not sending a password, and StarRocks is rejecting the connection because the authentication method(s) in your chain require one.
Here are the steps to troubleshoot and fix this:
1. Verify the Security Integration
The name test in your authentication_chain must correspond to a Security Integration that you have already created. If you haven't created one, StarRocks won't know how to handle "test".
Run this command to check:
sql
SHOW SECURITY INTEGRATIONS;
If test is not in the list, you need to create it first (e.g., for LDAP, JWT, etc.). For example:
sql
CREATE SECURITY INTEGRATION test
PROPERTIES (
"type" = "authentication_ldap_simple",
... -- other ldap properties
);
2. Provide a Password in the Client
External authentication methods like LDAP or Native users (unless they have an empty password) require a password to be passed during login. Your docker run command is missing the -p flag:
Try adding the password prompt:
bash
docker run -it --rm mysql:9.2 mysql \
-h <http://k8s-starrock-starrock-531efebc63-94b9b34a44bfcb1f.elb.ap-southeast-1.amazonaws.com|k8s-starrock-starrock-531efebc63-94b9b34a44bfcb1f.elb.ap-southeast-1.amazonaws.com> \
-P 9030 \
-u "<mailto:marian.s@scoutbytes.com|marian.s@scoutbytes.com>" -p
3. Check for Native User Conflicts
StarRocks prioritizes Native authentication if a local user with that exact name exists.
• Run SHOW USERS; to see if <mailto:marian.s@scoutbytes.com|marian.s@scoutbytes.com> exists as a native user.
• If it exists natively, StarRocks will try to authenticate it using the native password/plugin first (regardless of the chain order in some versions, or as the first step in native,test).
• If you want to use the Security Integration (test), ensure the user is not created natively, OR ensure you are providing the correct password for the native user.
4. Check FE Logs for Details
If you still can't log in, the FE logs will provide the exact reason for the failure (e.g., "LDAP server unreachable", "Invalid credentials", or "Security integration test not found").
Check your fe/log/fe.warn.log or fe.log on the leader FE node.
Summary of authentication_chain behavior:
* native,test: StarRocks first checks if <mailto:marian.s@scoutbytes.com|marian.s@scoutbytes.com> is a native user. If yes, it authenticates natively. If the user doesn't exist natively, it tries the test security integration.
* test,native: StarRocks first tries to authenticate via the test security integration. If that fails (e.g., user not found in LDAP), it then checks if there is a native user.
Note: If you are using Security Integration (like LDAP) without pre-creating users in StarRocks, you generally also need an external authorization system (like Apache Ranger) because native StarRocks RBAC requires the user to exist in the system to hold privileges.
References
• administration/user_privs/authentication/security_integration.md
• best_practices/authentication_authorization.mdMarian
02/16/2026, 2:38 PMRocky
02/16/2026, 2:38 PMCREATE USER 'username' IDENTIFIED WITH....
* In this scenario, the user must be pre-created in the StarRocks cluster.
* StarRocks still uses the external system (like LDAP) to check the password, but the user account itself exists explicitly in StarRocks metadata.
How to enable the "No Manual User" flow:
To ensure StarRocks looks at your security integration instead of just checking the local user list, you need to configure the authentication_chain in your FE configuration:
sql
-- 1. Create the integration
CREATE SECURITY INTEGRATION my_ldap_integration
PROPERTIES (
"type" = "authentication_ldap_simple",
...
);
-- 2. Add it to the authentication chain
ADMIN SET FRONTEND CONFIG ("authentication_chain" = "native, my_ldap_integration");
By adding your integration to the authentication_chain, StarRocks will first check if a "native" user exists; if not, it will attempt to authenticate the user through the security integration and create that temporary session for them.
Is there a specific system (LDAP, Okta, etc.) you are looking to integrate? I'd be happy to help with the syntax!
References
• administration/user_privs/authentication/security_integration.md
• best_practices/authentication_authorization.mdMarian
02/25/2026, 11:42 AMRocky
02/25/2026, 11:42 AMinformation_schema.cluster_snapshots view. The created_time column indicates when each snapshot was generated.
sql
SELECT snapshot_name, created_time, storage_volume
FROM information_schema.cluster_snapshots;
* To check the status and timing of snapshot jobs:
Query the information_schema.cluster_snapshot_jobs view to see the history of jobs, including when they started and finished.
sql
SELECT snapshot_name, job_id, created_time, finished_time, state
FROM information_schema.cluster_snapshot_jobs;
* To check the scheduled interval:
The frequency is controlled by the FE configuration automated_cluster_snapshot_interval_seconds (default is 600 seconds/10 minutes). You can check its value using:
sql
ADMIN SHOW FRONTEND CONFIG LIKE 'automated_cluster_snapshot_interval_seconds';
2. Manual Backup Snapshots
For standard backup and restore operations where snapshots are created manually:
* To check the snapshot timestamp:
Use the SHOW SNAPSHOT command on your repository to see the exact timestamp associated with a backup.
sql
SHOW SNAPSHOT ON <your_repo_name>;
This will return a Timestamp column (e.g., 2023-10-27-10-15-00-000) which is used for restoration.
3. Internal BE Snapshot Expiration
If you are looking for how long temporary snapshots (like those used for cloning or rebalancing) are kept on the Backend (BE), you can check the BE configuration:
* `snapshot_expire_time_sec`: The expiration time for snapshot files (default is 48 hours).
sql
-- Check via the leader FE
SHOW BACKENDS\G
(You would look at the snapshot_expire_time_sec parameter in the BE configuration file or via the HTTP API).
Summary Recommendation:
* To see when the last one was made: Check information_schema.cluster_snapshots (Automated) or SHOW SNAPSHOT (Manual).
* To see how often they occur: Check the FE config automated_cluster_snapshot_interval_seconds.
References
• administration/cluster_snapshot.md
• administration/management/Backup_and_restore.md
• sql-reference/sql-statements/backup_restore/SHOW_SNAPSHOT.md
• administration/management/BE_configuration.mdMarian
02/27/2026, 1:21 PMRocky
02/27/2026, 1:22 PMsql
SHOW BACKUP FROM <database_name>;
The State column will show FINISHED once it's complete, or CANCELLED if it fails.
2. Automation Script (Recommended)
You can write a simple wrapper script (in Python or Bash) to automate the notification:
1. Execute the BACKUP SNAPSHOT command.
2. Periodically run SHOW BACKUP to check the status.
3. Once the status changes to FINISHED or ERROR, have the script send a notification to your preferred channel (Slack webhook, Email, etc.).
3. Monitoring & Alerting
StarRocks exports various metrics to Prometheus. While there isn't always a specific "backup finished" metric, you can monitor the state of the cluster or use external monitoring tools to track the completion of these operations and set up alerts through Prometheus Alertmanager or Grafana.
If you are looking for a more managed experience, StarRocks' ecosystem tools or cloud offerings might provide more integrated monitoring for these tasks.Marian
02/27/2026, 1:22 PMRocky
02/27/2026, 1:23 PMCOLUMNS clause to perform transformations, functions, and filtering during the load process. This acts as a "pre-commit hook" for your data.
3. Audit Logging: If you need "hooks" for monitoring, the Audit Loader can be configured to export query logs to a StarRocks table for analysis, allowing you to track every query executed.
4. External Orchestration: Many users use dbt (data build tool) with StarRocks, which supports pre-hook and post-hook configurations to run SQL before or after a model is built.
5. Routine Load / Pipe: For continuous data, the Pipe and Routine Load features allow for automated data movement without manual intervention.
Could you clarify what you're trying to achieve? For example, are you looking to trigger a script after a load finishes, or modify a SQL statement before it runs? I can give you a more specific solution!Marian
02/27/2026, 1:24 PMRocky
02/27/2026, 1:24 PMsql
SHOW BACKUP FROM <database_name>;
This will return the state of the task, such as PENDING, SNAPSHOTING, UPLOAD_SNAPSHOT, or FINISHED.
Similarly, for a restore:
sql
SHOW RESTORE FROM <database_name>;
2. Using REST API (via Query API)
Since you referenced the RESTful API standard, if you need to check this programmatically without a persistent SQL connection, you can use the StarRocks Query API to execute the SHOW BACKUP command:
* Endpoint: POST /api/query/default_cluster/<database_name>
* Body: {"sql": "SHOW BACKUP"}
3. Low-level BE Snapshots (For Advanced Use)
If you are referring to the internal snapshots generated by Backend (BE) nodes (often used for manual data migration), there are internal HTTP endpoints on the BE (usually port 8040), but these are typically for internal system use and not recommended for standard backup workflows.
Summary:
If you want to know if a snapshot is "done," use SHOW BACKUP. If the state is FINISHED, the snapshot is complete and stored in your defined repository.
If you have a different type of "snapshot" in mind (e.g., related to a specific feature like Primary Key table persistent indexes or external catalogs), please let me know!Marian
03/02/2026, 8:52 AMRocky
03/02/2026, 8:52 AMMemory of process exceed limit occurs when a Backend (BE) node surpasses its allocated memory.
* The Cause: A SELECT DISTINCT combined with a large IN clause (~2,500 IDs) and a join is memory-intensive. StarRocks needs to build hash tables for both the join and the duplicate removal.
* Observation: 902 MB is a very low memory footprint for a StarRocks BE. Typically, StarRocks expects much higher limits (the default mem_limit is usually 90% of total RAM).
* Recommendations:
* Check BE Config: Check be.conf for the mem_limit parameter. If the machine has more RAM, increase this value (e.g., mem_limit = 80%).
* Query Optimization: Instead of a massive IN clause, try loading those 2,500 IDs into a temporary table and joining against it. This allows the StarRocks cost-based optimizer (CBO) to handle the data more efficiently.
* Session Variable: You can try increasing the pipeline scan memory limit for the session:
sql
SET exec_mem_limit = 2147483648; -- Set to 2GB or higher
*2. DEMO - Arrow Flight auth failure in Jupyter*
The error FlightInternalError: Could not finish writing before closing during authenticate_basic_token() usually points to a communication timeout or a sudden disconnection between the Jupyter client and the StarRocks FE.
* Is it a concern? If it's intermittent, it might be due to transient network congestion or the FE being momentarily overloaded. If it recurs frequently, it indicates a handshake timeout.
* Recommendations:
* FE Logs: Check fe.warn.log on the leader FE at the exact timestamp of the failure. It will often show if the authentication was rejected or if the connection dropped.
* Connection Persistence: Ensure there are no load balancers or proxies between Jupyter and StarRocks that might be prematurely closing idle gRPC/Arrow Flight connections.
*3. DEMO - ETL data not flowing (Filtered Data)*
The error Insert has filtered data means the ingestion started but some rows were rejected because they didn't match the table schema.
* Troubleshooting: Since you have the job_id, you can run this query to see exactly why the rows were rejected (e.g., data type mismatch, NULL in a NOT NULL column, or string length exceeding the limit):
sql
SELECT * FROM information_schema.load_tracking_logs
WHERE job_id = 78047;
* Common Causes:
* A new column was added to the CSV but not the table (or vice versa).
* A column containing NULL values is being mapped to a NOT NULL column in StarRocks.
* Data contains special characters or delimiters that are causing column misalignment.
* Quick Fix: If you want to allow the load to proceed despite a few errors, you can set the max_filter_ratio (e.g., 0.1 for 10% tolerance), but it's better to fix the data/mapping first.
Let me know if you'd like me to dive deeper into any of these logs!Marian
03/02/2026, 8:59 AMRocky
03/02/2026, 8:59 AMFailed to connect to 10.2.91.130 port 8040: Couldn't connect to server indicates that the node where the query is being executed (likely an FE or another BE) cannot reach the Backend (BE) node at 10.2.91.130 on its HTTP port (8040).
When you query information_schema.load_tracking_logs, StarRocks attempts to fetch the specific error details directly from the BE that handled the load. If that BE is unreachable, the query fails with this error.
Troubleshooting Steps:
1. Check BE Status:
Verify if the BE at 10.2.91.130 is alive.
sql
SHOW BACKENDS;
Look for the row where IP is 10.2.91.130 and check if Alive is true. If it's false, the BE process might have crashed or stopped.
2. Verify Port Connectivity:
Ensure that port 8040 (the default be_http_port) is open and accessible from other nodes in the cluster. You can test this from another node using curl or `telnet`:
bash
curl -I <http://10.2.91.130:8040/api/health>
If this fails, check your firewall (e.g., iptables, firewalld, or security groups in cloud environments) to ensure traffic is allowed on port 8040.
3. Check BE Configuration:
Confirm that the BE is indeed using port 8040. Check the be.conf file on that node for the be_http_port setting. If it's set to a different value, StarRocks should usually know this via the FE metadata, but network issues remain the most likely culprit.
4. Check BE Logs:
If the BE is running but still unreachable, check the be.out or <http://be.INFO|be.INFO> logs on node 10.2.91.130 for any errors related to the HTTP server or network initialization.
If the BE is down, you'll need to restart it. If it's a network/firewall issue, you'll need to update your network rules to allow internal cluster communication on the required ports.Marian
03/03/2026, 1:08 PMRocky
03/03/2026, 1:09 PMsql
CREATE REPOSITORY `dr_repo`
WITH S3 (
"endpoint" = "<http://s3.amazonaws.com|s3.amazonaws.com>",
"region" = "us-east-1",
"bucket" = "your-new-dr-bucket-name", -- This can be a different bucket
"access_key" = "YOUR_ACCESS_KEY",
"secret_key" = "YOUR_SECRET_KEY"
);
2. Restore the data
Once the repository is created, StarRocks will look into that bucket for existing snapshots. You can then run the RESTORE command:
sql
RESTORE TABLE your_database.your_table
FROM `dr_repo`
AS "snapshot_name"
PROPERTIES ("backup_timestamp" = "2023-10-01-10-00-00");
Important Considerations:
* Data Migration: If the snapshot was originally created in Bucket A and you want to restore from Bucket B, you must ensure that the entire contents of the backup folder were copied correctly from Bucket A to Bucket B.
* Permissions: The StarRocks FE and BE nodes must have network access to the new S3 bucket and the credentials provided must have GetObject, ListBucket, etc., permissions.
* Shared-data Clusters: If you are using StarRocks' Shared-data mode (where data resides directly on S3 rather than being a snapshot), disaster recovery typically involves pointing a new FE/BE cluster to the existing S3 storage root. You can configure a new cluster to use an existing bucket by setting the storage_root_path (or similar object storage configurations) to the path of your existing data.
In summary: StarRocks is flexible with its repository definitions. You are not "locked" to the original bucket configuration for recovery purposes.Marian
03/03/2026, 1:09 PMRocky
03/03/2026, 1:10 PMBACKUP and RESTORE commands (which operate at the database or table level and copy data), Cluster Snapshots capture the state of the entire cluster by leveraging the underlying object storage.
Here is a quick breakdown of how to manage them and some things to keep in mind:
1. Basic Commands
To manage cluster snapshots, you use the following syntax:
* Create a snapshot:
sql
CREATE CLUSTER SNAPSHOT snapshot_name;
* View existing snapshots:
sql
SHOW CLUSTER SNAPSHOTS;
* Delete a snapshot:
sql
DROP CLUSTER SNAPSHOT snapshot_name;
2. Why use it over standard Backup?
* Efficiency: It doesn't physically move data. It creates a point-in-time reference to your metadata and the data files already stored in S3/OSS/GCS.
* Speed: It is nearly instantaneous regardless of data volume.
* Full Recovery: It allows you to restore the entire cluster state, including users, privileges, and all databases, to a specific point in time.
3. Common Considerations
* Shared-data Architecture: This feature is only available for clusters running in shared-data mode. If you are on a shared-nothing (local storage) cluster, you must use the standard BACKUP TO repository approach.
* Storage Cleanup: When you drop a snapshot, StarRocks will eventually clean up the data files that are no longer referenced by any snapshot or the current cluster state.
* Restoration: Restoring from a cluster snapshot typically involves setting specific configurations when starting a new cluster or performing a rollback operation.
If you are running into a specific error while using cluster snapshots, could you please provide the error message? I can help troubleshoot whether it's related to permissions, storage configuration, or version compatibility.Marian
03/03/2026, 1:25 PMRocky
03/03/2026, 1:25 PMADMIN SHOW FRONTEND CONFIG command. OAuth2 settings are typically managed at the Frontend (FE) level.
Here are the steps to check:
1. View Frontend Configurations
You can use the LIKE operator to filter for "oauth" related parameters:
sql
ADMIN SHOW FRONTEND CONFIG LIKE '%oauth%';
2. Check Authentication Type
OAuth2 is often part of the authentication configuration. You can check the general authentication settings to see if it's enabled:
sql
ADMIN SHOW FRONTEND CONFIG LIKE '%authentication%';
3. What to look for
In the output, you might see parameters such as:
* `authentication_type`: This defines the global authentication method (e.g., LDAP, OIDC, OAuth2).
* oauth2_client_id / oauth2_client_secret (if supported in your specific version/integration).
* oauth2_jwks_url.
Alternative: Checking Session Variables
While OAuth2 configurations are usually global FE configs, you can also check if there are any related session or global variables using:
sql
SHOW VARIABLES LIKE '%oauth%';
Note: If you find that the configuration you need is not set, you can modify FE configurations dynamically (if they are mutable) using:
sql
ADMIN SET FRONTEND CONFIG ("parameter_name" = "value");
Otherwise, you may need to edit the fe.conf file on your FE nodes and restart the service.Rocky
03/03/2026, 1:26 PMADMIN SHOW FRONTEND CONFIG command. OAuth2 configurations are primarily managed at the Frontend (FE) level.
You can run the following command to filter for any configuration keys containing "oauth":
sql
ADMIN SHOW FRONTEND CONFIG LIKE '%oauth%';
Explanation of the command:
* ADMIN SHOW FRONTEND CONFIG: This command displays the configuration parameters for the Frontend nodes.
* LIKE '%oauth%': This filters the output to show only the keys that contain the string "oauth" (case-insensitive in many versions, but typically lowercase in config keys).
Common OAuth2 Parameters:
If OAuth2 is configured, you might see parameters such as:
* oauth2_client_id
* oauth2_client_secret
* oauth2_issuer
* oauth2_jwks_url
Checking Global Variables:
If you are looking for session or global variables that might affect authentication behavior, you can also check:
sql
SHOW VARIABLES LIKE '%oauth%';
Note: If you are looking for configuration on the Backend (BE) nodes, you would use ADMIN SHOW BACKEND CONFIG;, though OAuth2 is typically handled by the FE.Marian
03/04/2026, 9:51 AMRocky
03/04/2026, 9:52 AMqe_max_connection)
By default, each StarRocks FE allows a maximum of 1024 concurrent connections. You can increase this by modifying the fe.conf file on your FE nodes.
* Modify fe.conf:
Add or update the following parameter:
properties
qe_max_connection = 2048
* Restart the FE for the changes to take effect.
* Dynamic Change (Optional): You can try to change it without a restart using the following command (if you can still get a connection in):
sql
ADMIN SET FRONTEND CONFIG ("qe_max_connection" = "2048");
2. Increase User-Level Connection Limit
If the global limit is high enough but the specific user is capped, you can update the user's property. For the root user:
sql
SET PROPERTY FOR 'root' 'max_user_connections' = '2048';
3. Troubleshooting Connection Leaks
If you hit this limit unexpectedly, it often points to a connection leak in the application layer (e.g., connection pools not being closed properly).
* Check current connections:
If you can manage to log in (perhaps by killing an idle process or connecting to a different FE node in the cluster), run:
sql
SHOW PROCESSLIST;
This will show you which hosts and users are occupying the connections.
* Kill idle connections:
You can terminate specific sessions using:
sql
KILL [CONNECTION] process_id;
Summary of the Error
* `currentUserMaxConn=1024`: The current limit enforced for the user.
* `connectionMap.size=1024`: The total number of active connections on this FE.
* `user.currConn=1024`: The number of connections currently held by root.
Since all these values are 1024, you have exactly hit the default bottleneck. Increasing qe_max_connection is the standard solution.Marian
03/04/2026, 10:09 AMRocky
03/04/2026, 10:10 AMroot user has hit the concurrent connection limit allowed by StarRocks. The error indicates that there are currently 1024 active connections for that user, which is the default or configured maximum.
To handle this properly without just continuously increasing the limit, here are the recommended steps:
1. Implement Connection Pooling
The most common cause for this error is an application that opens a new connection for every query but doesn't close them correctly or reuse them.
• Action: Use a connection pooler in your application (e.g., HikariCP, Druid, or Commons DBCP for Java; SQLAlchemy for Python).
• Benefit: This keeps a set number of connections open and reuses them, significantly reducing the connection overhead and preventing the "limit reached" error.
2. Check and Manage Active Connections
You should investigate where these 1024 connections are coming from.
• Run the following command (if you can get a connection, perhaps by closing an existing one or using a different user):
sql
SHOW PROCESSLIST;
• Look for connections that have been in the Sleep state for a long time. This usually indicates that the application is not closing connections properly.
3. Adjust Idle Connection Timeouts
If you have many idle connections, you can reduce the time StarRocks waits before closing them automatically.
• Check the current timeout: SHOW VARIABLES LIKE 'wait_timeout';
• Set a shorter timeout (e.g., 1 hour instead of the default 8 hours):
sql
SET GLOBAL wait_timeout = 3600;
4. Adjust the User Property
If your workload legitimately requires more than 1024 concurrent connections for the root user, you can increase the property specifically for that user:
sql
SET PROPERTY FOR 'root' 'max_user_connections' = '2048';
Note: It is generally a best practice to use a non-root user for application traffic and set limits appropriately for different service accounts.
5. Check FE Global Limits
If the issue is shared across all users, you might be hitting the FE global connection limit defined in the FE configuration (fe.conf).
• Parameter: qe_max_connection (Default is often 1024).
• If you need to change this, you must modify fe.conf and restart the FE, or use:
sql
ADMIN SET FRONTEND CONFIG ("qe_max_connection" = "2048");
Recommendation: Start by checking your application's connection logic and implementing a pooler. Increasing the limit to 1024 is already quite high for a single user, and usually, the root cause is "leaked" connections.Marian
03/04/2026, 10:13 AMRocky
03/04/2026, 10:13 AMfe.audit.log.
• Location: You can typically find it in the log/ directory of your StarRocks FE installation path (e.g., starrocks/fe/log/fe.audit.log).
• Content: This file contains detailed information for every query, such as:
• QueryId
• User
• ClientIP
• Database
• Sql (the actual statement executed)
• ExecutionTime (total time, CPU time, etc.)
• ReturnRows
2. Configuration in fe.conf
You can customize how audit logs are handled by modifying the fe.conf file:
• audit_log_dir: Specifies the directory where audit logs are saved.
• audit_log_roll_num: Specifies how many old log files to keep (log rotation).
• audit_log_modules: Defines which modules to log (default is usually slow_query and query).
3. Querying Audit Logs via SQL (StarRocks 2.x+)
StarRocks also provides a way to export audit logs into an internal table, making them queryable directly using SQL.
• Often, these are stored in a database called starrocks_monitor or similar, depending on your setup.
• You can enable the Audit Loader plugin to automatically sink these logs into a StarRocks table (e.g., starrocks_audit_tbl__). This allows you to run queries like:
sql
SELECT * FROM starrocks_monitor.starrocks_audit_db__ WHERE query_time > 1000;
4. Identifying "Slow Queries"
If you are looking specifically for slow queries, they are also recorded in fe.audit.log. You can identify them by checking the IsQuery and Time columns. StarRocks often marks queries exceeding a certain threshold (configured by qe_slow_log_ms) as slow logs.
If you need help with a specific configuration or parsing a log line, feel free to ask!Marian
03/04/2026, 2:41 PMRocky
03/04/2026, 2:41 PMfe.audit.log in StarRocks is designed to record all SQL queries and commands sent to the Frontend (FE) for auditing, troubleshooting, and monitoring purposes.
If you want to trigger an entry in the audit log with specific text (for example, to test if your log rotation is working or to verify that a log monitoring tool is picking up certain keywords), you can simply execute a SQL statement that includes that text.
The audit log typically records the full SQL string. You can "inject" your desired text in a few ways:
1. Using SQL Comments
You can add a comment to any valid SQL statement. This is a common practice for "tagging" queries so they can be easily identified in logs or query profile lists.
sql
-- This is my custom test tag
SELECT 1;
/* ID: 9999, Action: Fake_Verification_Test */
SELECT count(*) FROM my_table;
2. Using String Literals
You can include your "fake" or test text as a string in a SELECT statement.
sql
SELECT 'Testing_Audit_Log_Entry' AS test_field;
What appears in the fe.audit.log?
Each entry in the fe.audit.log usually contains:
* Timestamp: When the query was executed.
* Client IP: The IP address of the machine that sent the query.
* User: The StarRocks user account used for the connection.
* Db: The database context.
* Sql: The actual text of the query (this is where your "fake" or custom strings will appear).
* Execution Time: How long the query took.
Note on Security and Metadata
It is important to note that you cannot easily "fake" the metadata like the User or Client IP within the SQL command itself. These are captured by the FE based on the actual network connection and authentication session. To change those fields in the log, you would need to connect from a different IP or log in as a different user.
If you are trying to test log filtering or alerting rules, using comments as shown above is the standard and safest way to do it!Marian
03/06/2026, 10:46 AMRocky
03/06/2026, 10:47 AMERROR 5207 (42000) followed by a URL is actually an authentication challenge. When a user is configured to authenticate via OAuth 2.0, StarRocks returns a redirect URL that you are supposed to visit in your web browser to complete the login process.
Why the URL is "incorrect" (broken)
The reason you see empty parameters like client_id= and redirect_uri= in that URL is likely because the OAuth 2.0 configurations in the FE (Front End) are missing or incomplete.
If the administrator has enabled OAuth 2.0 but hasn't set the required parameters in fe.conf, StarRocks generates a "broken" URL string.
How to fix it
To resolve this, you need to ensure the following configurations are correctly set in your fe.conf file (and the FE is restarted):
1. oauth2_auth_server_url: The authorization URL of your Identity Provider (e.g., Okta, Keycloak).
2. oauth2_client_id: The public identifier for your StarRocks client.
3. oauth2_redirect_url: Usually configured as http://<starrocks_fe_url>:<fe_http_port>/api/oauth2.
4. oauth2_token_server_url: The endpoint to exchange the code for a token.
5. oauth2_jwks_url: The URL to the JSON Web Key Set.
Alternatively, if you created the user manually, check your CREATE USER statement. It should look something like this:
sql
CREATE USER 'your_user' IDENTIFIED WITH authentication_oauth2 AS
'{
"auth_server_url": "<https://auth.example.com/auth>",
"client_id": "your_client_id",
"redirect_url": "<http://your_fe_ip:8030/api/oauth2>",
...
}';
How to use it once fixed
Once the configuration is fixed, the process is:
1. Try to connect or run a query via the MySQL client.
2. StarRocks will return a valid URL.
3. Copy and paste that URL into your browser.
4. Log in through your Identity Provider.
5. After successful login, you can return to your MySQL terminal and continue your session.
Note: For the best experience with OAuth 2.0 and native MySQL clients, it is recommended to use MySQL Client version 9.2 or later, which provides better support for the OpenID pluggable authentication protocol.
References
• sql-reference/Error_code.md
• faq/Deploy_faq.md
• administration/Meta_recovery.mdMarian
03/06/2026, 10:48 AMoauth2_auth_server_url: The authorization URL of your Identity Provider (e.g., Okta, Keycloak).
2. oauth2_client_id: The public identifier for your StarRocks client.
3. oauth2_redirect_url: Usually configured as http://<starrocks_fe_url>:<fe_http_port>/api/oauth2.
4. oauth2_token_server_url: The endpoint to exchange the code for a token.
5. oauth2_jwks_url: The URL to the JSON Web Key Set. @Rocky how to check this parametrs trhogh cli?Rocky
03/06/2026, 10:48 AMADMIN SHOW FRONTEND CONFIG command.
Since these are FE (Frontend) configuration parameters typically defined in your fe.conf file, you can filter for them using the LIKE clause.
1. Check FE Configuration Parameters
Run the following command to see all OAuth2-related configurations currently active on the Frontend:
sql
ADMIN SHOW FRONTEND CONFIG LIKE '%oauth2%';
This will return a table showing the Key, Value, Type, and whether it is IsMutable (can be changed without a restart). Note that most OAuth2 parameters are not mutable and require an FE restart if changed in fe.conf.
──────────
2. Check Security Integrations (if applicable)
If you have configured OAuth2 using the Security Integration feature (introduced in v3.5), those parameters are stored within the integration object rather than just the global fe.conf.
* To list all security integrations:
sql
SHOW SECURITY INTEGRATIONS;
* To see the specific parameters of an integration:
sql
DESC SECURITY INTEGRATION <your_integration_name>;
3. Check Per-User OAuth2 Settings
If you have configured OAuth2 specifically for a single user using the CREATE USER ... IDENTIFIED WITH authentication_oauth2 AS '{"..."}' syntax, you can check those properties by inspecting the user definition:
sql
SHOW CREATE USER <username>;
Summary of parameters you are looking for:
Parameter | Command to check
oauth2_auth_server_url | ADMIN SHOW FRONTEND CONFIG LIKE 'oauth2_auth_server_url';
oauth2_client_id | ADMIN SHOW FRONTEND CONFIG LIKE 'oauth2_client_id';
oauth2_redirect_url | ADMIN SHOW FRONTEND CONFIG LIKE 'oauth2_redirect_url';
oauth2_token_server_url | ADMIN SHOW FRONTEND CONFIG LIKE 'oauth2_token_server_url';
oauth2_jwks_url | ADMIN SHOW FRONTEND CONFIG LIKE 'oauth2_jwks_url';
Note: If the values appear empty, it means they have not been set in the fe.conf or passed via the CLI yet. These features were introduced in v3.5.0.
References
• administration/management/FE_configuration.md
• administration/user_privs/authentication/oauth2_authentication.md
• administration/user_privs/authentication/security_integration.mdMarian
03/16/2026, 2:30 PMRocky
03/16/2026, 2:30 PMERROR 1064 (HY000): starlet err grpc.GetShard(shardId=...) error: DeadlineExceeded (assuming "De" stands for DeadlineExceeded) is specific to StarRocks shared-data (cloud-native) architecture.
What this error means:
This error indicates that a Compute Node (CN) or Backend (BE) attempted to fetch metadata for a specific data shard (tablet) from the Frontend (FE) using the Starlet (StarRocks' storage management agent) via a gRPC call, but the request timed out before receiving a response.
Common Causes:
1. FE is Overloaded: The Leader FE might be under heavy load (high CPU or JVM GC), causing it to respond slowly to metadata requests from the compute nodes.
2. Network Latency/Connectivity: There may be network congestion or instability between the CN/BE nodes and the FE nodes.
3. Metadata Service Latency: In shared-data mode, the FE manages shard information. If the FE is struggling to access its internal metadata or if there is a massive number of concurrent metadata requests, it can trigger this timeout.
4. Configuration Timeout: The default timeout for StarMgr gRPC requests might be too short for the current cluster load.
Recommended Troubleshooting Steps:
1. Check FE Health:
* Check the Leader FE's fe.log and fe.warn.log for any signs of long GC pauses or "StarMgr" related errors.
* Monitor FE CPU and memory usage.
2. Increase gRPC Timeout:
You can try increasing the timeout for metadata requests on the FE side. The parameter is starmgr_grpc_timeout_seconds (default is usually 5 seconds).
sql
ADMIN SET FRONTEND CONFIG ("starmgr_grpc_timeout_seconds" = "10");
3. Check CN/BE Logs:
Look into the <http://be.INFO|be.INFO> or be.WARNING logs on the compute nodes for the timestamp of the error. Search for "GetShard" to see if there are additional details about the RPC failure.
4. Verify Node Connectivity:
Ensure that all CN/BE nodes can communicate with the FE's Starlet port (default is 9030 for MySQL protocol, but Starlet uses the internal RPC ports, typically 9020 or 9030 depending on your config).
5. Object Storage Status:
While this is a metadata error, ensure your underlying object storage (S3/OSS/HDFS) is healthy, as the FE might be waiting on storage-related metadata operations.
Note: If you are seeing INVALID_ARGUMENT: shard info cannot be empty instead, this often happens if you try to query/create tables when no CN/BE nodes are currently alive in the cluster. Check your node status using SHOW BACKENDS or SHOW COMPUTE NODES.
References
• faq/shared_data_faq.md
• knowledge/usage/best-practice.md
• faq/Deploy_faq.md
• faq/Sql_faq.md
• sql-reference/Error_code.mdMarian
03/18/2026, 12:01 PMRocky
03/18/2026, 12:01 PMQuorum = (Number of Followers / 2) + 1
* For 3 Followers: You need at least 2 nodes to be healthy to maintain a quorum.
If you remove two nodes, leaving only one, the remaining node cannot form a majority. As a result:
* The cluster will not be able to elect a Leader.
* Metadata cannot be updated (you cannot create tables, load data, or change configurations).
* In most cases, the cluster will stop providing services entirely.
2. "Removing" vs. "Dropping"
The outcome depends on how you remove them:
* Scenario A: Sudden Removal (Stopping the process/VM)
If you just turn off 2 nodes, the cluster loses quorum immediately and fails.
* Scenario B: Formal Removal (SQL Command)
If you use ALTER SYSTEM DROP FOLLOWER "IP:PORT", you can technically scale down. If you drop them one by one correctly, the cluster "re-calculates" the quorum. If you eventually scale down to a single FE, the cluster will function, but you lose all High Availability (HA). If that one remaining FE fails, your entire cluster goes down.
Recommendations
* For Production: Always maintain at least 3 Follower FEs. This allows the cluster to remain fully functional even if one node fails.
* Adding Observers: If you need more query performance but don't want to complicate the quorum, you can add Observer FE nodes. Observers do not participate in voting for quorum, so they don't affect the math mentioned above.
* Recovery: If you have already lost quorum and the cluster is stuck, you would need to perform a metadata recovery by setting bdbje_reset_election_group = true in the fe.conf of the remaining node to force it to become a Leader.
Summary: To keep the cluster "fully functional" and highly available, you must keep at least 2 out of 3 FEs running. If you go down to 1, you are running in a non-HA mode that is not recommended for production.
References
• faq/operation_maintenance_faq.md
• deployment/deploy_manually.md
• administration/Meta_recovery.md
• administration/management/FE_configuration.md