#967·goose

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 yet

The 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:

  1. 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
  2. Run the Goose migration command:
    goose up
  3. Use the following migration script (20250716121536_volume_database_test.sql):
    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_volume storage volume and the public_release database with the specified storage volume.
  • The Goose migration version should be recorded in the public_release.goose_migrations table.

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=false parameter was initially used in the GOOSE_DBSTRING, but I also tried useServerPrepStmts=false with no success.
  • The migration script uses NO TRANSACTION and ENVSUB ON to 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:

  1. Is there a specific configuration or workaround to disable prepared statements entirely for StarRocks in Goose?
  2. Are there known limitations with StarRocks' support for CREATE STORAGE VOLUME or similar commands in the context of Goose migrations?
  3. 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=false to useServerPrepStmts=false in the GOOSE_DBSTRING.
  • Ensured NO TRANSACTION is 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 yet issue.
  • Recommendations for managing storage volumes in StarRocks with Goose migrations.
  • Any known compatibility issues or best practices for using Goose with StarRocks.