Goose: This command is not supported in the prepared statement protocol yet (starrocks)
Author: ayushpahariaCreated Jul 18, 2025Updated Sep 22, 2026
When running a Goose migration with StarRocks as the database driver, the migration fails with the following error:
2025/07/18 14:08:23 goose run: ERROR 20250716121536_volume_database_test.sql: failed to run SQL migration: failed to insert new goose version: Error 1295 (HY000): This command is not supported in the prepared statement protocol yetThe migration script is intended to create a storage volume and a database with the specified storage volume in StarRocks. The issue appears to be related to the use of prepared statements, which are not supported for certain commands in StarRocks.
Steps to Reproduce:
- Set up the environment with the following variables:
GOOSE_DRIVER=starrocks GOOSE_DBSTRING="root@tcp(127.0.0.1:9030)/public_release?enable_prepare_stmt=false" GOOSE_MIGRATION_DIR=/starrocks/migrations/test GOOSE_TABLE=public_release.goose_migrations - Run the Goose migration command:
goose up - Use the following migration script (
20250716121536_volume_database_test.sql):-- +goose Up -- +goose ENVSUB ON -- +goose NO TRANSACTION -- Create storage volume for the customer -- +goose StatementBegin CREATE STORAGE VOLUME IF NOT EXISTS public_volume TYPE = S3 LOCATIONS = ('s3://starrocks') PROPERTIES ( 'enabled' = 'true', 'aws.s3.region' = 'us-west-2', 'aws.s3.endpoint' = 'http://minio:9000', 'aws.s3.access_key' = 'AAAAAAAAAAAAAAAAAAAA', 'aws.s3.secret_key' = 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB', 'aws.s3.use_aws_sdk_default_behavior' = 'false', 'aws.s3.use_instance_profile' = 'false', 'aws.s3.enable_partitioned_prefix' = 'true', 'aws.s3.num_partitioned_prefix' = '8' ); -- +goose StatementEnd -- Create database with the storage volume -- +goose StatementBegin CREATE DATABASE IF NOT EXISTS public_release PROPERTIES ( "storage_volume" = "public_volume" ); -- +goose StatementEnd -- +goose Down -- +goose ENVSUB ON -- +goose NO TRANSACTION -- Drop database (uncomment if needed for rollback) -- +goose StatementBegin DROP DATABASE IF EXISTS public_release; -- +goose StatementEnd -- Drop storage volume (uncomment if needed for rollback) -- +goose StatementBegin DROP STORAGE VOLUME IF EXISTS public_volume; -- +goose StatementEnd
Expected Behavior:
- The migration should successfully create the
public_volumestorage volume and thepublic_releasedatabase with the specified storage volume. - The Goose migration version should be recorded in the
public_release.goose_migrationstable.
Actual Behavior:
- The migration fails with the error:
ERROR 20250716121536_volume_database_test.sql: failed to run SQL migration: failed to insert new goose version: Error 1295 (HY000): This command is not supported in the prepared statement protocol yet
Environment:
- Goose Configuration:
GOOSE_DRIVER=starrocks GOOSE_DBSTRING="root@tcp(127.0.0.1:9030)/public_release?useServerPrepStmts=false" GOOSE_MIGRATION_DIR=/script/starrocks/migrations/ GOOSE_TABLE=public_release.goose_migrations - Database: StarRocks
- Connection:
root@tcp(127.0.0.1:9030)/public_release
Additional Context:
- The
enable_prepare_stmt=falseparameter was initially used in theGOOSE_DBSTRING, but I also trieduseServerPrepStmts=falsewith no success. - The migration script uses
NO TRANSACTIONandENVSUB ONto accommodate StarRocks-specific requirements. - I'm unsure how to properly handle storage volumes in StarRocks with Goose migrations, and whether this error is related to the storage volume commands or the Goose versioning mechanism.
- The error suggests an issue with prepared statements, which may indicate a compatibility issue between Goose and StarRocks for certain SQL commands.
Questions:
- Is there a specific configuration or workaround to disable prepared statements entirely for StarRocks in Goose?
- Are there known limitations with StarRocks' support for
CREATE STORAGE VOLUMEor similar commands in the context of Goose migrations? - Could the issue be related to the Goose versioning table (
public_release.goose_migrations) and how it interacts with StarRocks?
Possible Workarounds Attempted:
- Changed
enable_prepare_stmt=falsetouseServerPrepStmts=falsein theGOOSE_DBSTRING. - Ensured
NO TRANSACTIONis used in the migration script to avoid transaction-related issues.
Request:
- Guidance on resolving the
Error 1295 (HY000): This command is not supported in the prepared statement protocol yetissue. - Recommendations for managing storage volumes in StarRocks with Goose migrations.
- Any known compatibility issues or best practices for using Goose with StarRocks.
Source: pressly/goose