Skip to content

MySQL engine connection fails in ADK ≥1.21.0 when using EventsCompactionConfig #3998

@Priangshu-45

Description

@Priangshu-45

Main Issue

In ADK version 1.21.0, MySQL database engine creation fails when EventsCompactionConfig is enabled. The same MySQL configuration works correctly in ADK 1.13.0, but event compaction is not available in that version. This appears to be a regression or an undocumented compatibility change related to database engine initialization.


To Reproduce

Minimal reproduction steps

  1. Install ADK 1.21.0:

    pip install google-adk==1.21.0
  2. Use the following minimal code:

    from google.adk.runtime import Runner
    from google.adk.runtime.config import EventsCompactionConfig
    
    runner = Runner(
        database_url="mysql+mysqlconnector://user:password@host:3306/db",
        events_compaction_config=EventsCompactionConfig()
    )
  3. Start the application.

  4. Observe the error:

    ValueError: Failed to create database engine for URL
    'mysql+mysqlconnector://user:password@host:3306/db'
    

Comparison

  • ADK 1.13.0: MySQL connection works (EventsCompactionConfig not available)
  • ADK 1.21.0: MySQL connection fails when EventsCompactionConfig is enabled

Expected behavior

MySQL connectivity that works in earlier ADK versions should continue to work when upgrading to newer versions, or the supported MySQL drivers for EventsCompactionConfig should be clearly documented with a clear and descriptive error message.


Screenshots

Code:
Image


Desktop (please complete the following information)

  • OS: Windows
  • Python version (python -V): 3.10.x
  • ADK version (pip show google-adk): 1.21.0

Model Information

  • Model: gemini-2.5-flash

Metadata

Metadata

Assignees

Labels

planned[Status] This issue is planned to be work on by ADK eng teamservices[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions