Santosh Kumar Katkam
07/13/2026, 2:01 PMRocky
07/13/2026, 2:03 PMiceberg.catalog.oauth2.scope parameter or sends a malformed request to the OAuth2 token endpoint. This is particularly common when connecting to catalogs like Apache Polaris.
* Status: This was reported in 2025 and is addressed in newer versions of the StarRocks Iceberg connector.
3. Configuration Inconsistencies
In some StarRocks versions, there were inconsistencies between the documented property names and the actual implementation for REST catalogs.
* Recommendation: Verify your catalog properties. For example, some versions required oauth2.server-uri instead of iceberg.catalog.oauth2.server-uri. Check your version-specific documentation or try both formats if you see persistent "Not authorized" errors during setup.
Recommended Troubleshooting
1. Check StarRocks Version: If you are on a version older than 3.3.0 or 4.0, consider upgrading. Major improvements to Iceberg REST Catalog security and token handling were introduced in StarRocks 4.0 (including JWT passthrough and better vended credentials support).
2. Enable Token Exchange: Verify with your security/identity team that the "Token Exchange" flow is permitted for your credentials.
3. Check FE Logs: Look for OAuth2Client or RESTCatalog errors in your fe.log around the time the error occurs. It will often reveal if a refresh attempt failed.
4. Try `token-refresh-enabled`: Although enabled by default in recent Iceberg libraries, you can explicitly ensure it is set (if supported by your version's properties).
If the issue persists despite these changes, it is recommended to capture the specific error from the fe.log and share it on the StarRocks Slack or open a GitHub issue, as it may be a specific regression in your current version.
References
• data_source/catalog/iceberg/iceberg_rest_security.md
• data_source/catalog/iceberg/iceberg_catalog.mdSantosh Kumar Katkam
07/13/2026, 2:24 PMRocky
07/13/2026, 2:24 PMscope parameter and token refresh cycles with REST catalogs like Polaris.
1. The "Malformed Scope" Bug (Issue #61253)
There is a documented bug where StarRocks sends a malformed or incompatible scope parameter during the OAuth2 token request/refresh process.
* The Symptom: Initial connection works because the first token is obtained (or sometimes the catalog allows a blank scope initially). However, when StarRocks attempts to refresh the token (typically every 1 hour), Polaris rejects the refresh request because the scope parameter is improperly formatted.
* The "No Log" Mystery: If the refresh logic fails internally or receives a response it doesn't handle gracefully, it may not log a clear "Token Refresh Failed" message. Instead, the next query simply sends an expired token, causing Polaris to return a 401 Unauthorized error.
* Why a restart fixes it: A restart forces StarRocks to drop the old session and perform a fresh POST /v1/oauth/tokens call with initial credentials, which works until that new token expires.
2. Version-Specific Behavior in 4.1
StarRocks 4.1 introduced deeper integration for Vended Credentials and JWT Passthrough. If you are using Polaris, ensure you aren't inadvertently hitting a mismatch between these new features and your catalog configuration.
* Recommendation: If you are on 4.1.0, try upgrading to 4.1.1 or later. Several stability fixes for the Iceberg REST connector and JNI-based credential handling were bundled into the 4.1.1+ releases.
3. Recommended Workaround/Configuration
To stabilize the connection with Polaris in StarRocks 4.1, verify the following properties in your CREATE EXTERNAL CATALOG statement:
1. Explicitly Disable Scope (if applicable): If Polaris is picky about the scope, you can try setting an empty scope or ensuring the scope matches exactly what Polaris expects.
2. Verify Credential Format: Ensure you are using the property:
"iceberg.catalog.oauth2.credential" = "<client_id>:<client_secret>"
3. Check for "Vended Credentials": If you have "iceberg.catalog.vended-credentials-enabled" = "true", StarRocks relies on Polaris to provide temporary S3/GCS tokens. If the REST token (the OAuth2 one) expires, the vending stops.
How to verify the bug
Before restarting next time the error occurs, try to run a simple CURL command from the StarRocks FE node to the Polaris token endpoint using the same credentials. If the CURL works but StarRocks does not, it confirms StarRocks is holding onto an expired/stale token state.
Summary: This is a known issue related to token lifecycle management in the REST connector. Upgrading to the latest patch of 4.1 (e.g., 4.1.3 or higher) is the most direct fix, as these versions contain refinements for the Iceberg REST OAuth flow.
References
• data_source/catalog/iceberg/iceberg_rest_security.md
• data_source/catalog/iceberg/iceberg_rest_s3.md
• data_source/catalog/iceberg/iceberg_catalog.mdPhước Hồ
08/09/2026, 3:49 AMSantosh Kumar Katkam
08/27/2026, 6:43 PM