Dbt Core Starrocks error. Database Error 5305 (25P01): Explicit transaction only support insert statement

I created a new dbt project with starrocks at the target and the dbt test –debug gives me below error

Encountered an error:
Database Error
5305 (25P01): Explicit transaction only support insert statement

This is my dbt core version

Core:

  • installed: 1.10.7
  • latest: 1.10.7 - Up to date!

Plugins:

  • starrocks: 1.10.0 - Up to date!
  • postgres: 1.9.0 - Up to date!

Any help is appreciated.

1 Like

had the same issue with starrocks-dbt

Here is the workaround,

This the error message:
00:06:07 Encountered an error:
Database Error
5305 (25P01): Explicit transaction only support insert statement

Here is the solution:

in Venv: dbt-1.10.7-env

Starrocks adapter files located at
~/dbt-1.10.7-env/lib/python3.10/site-packages/dbt/adapters/starrocks

Edit: connections.py file and add below contents inside your StarRocksConnectionManager class in connections.py — with proper indentation:

def begin(self):
    """
    Override BEGIN for StarRocks — skip explicit transactions entirely.
    """
    # Do NOT call super().begin() — we don't want to send 'BEGIN' to StarRocks
    self.transaction_open = False
    return

def commit(self):
    """
    Override COMMIT for StarRocks — skip committing since no transaction was opened.
    """
    # Do nothing — prevents dbt-core from raising 'no transaction open'
    self.transaction_open = False
    return

def rollback(self):
    """
    Override ROLLBACK for StarRocks — skip rollback since no transaction was opened.
    """
    self.transaction_open = False
    return