Skip to content

create_session bug聽#4419

Closed as duplicate
Closed as duplicate

Description

@zzzengzhe

馃敶 Required Information

Please ensure all items in this section are completed to allow for efficient
triaging. Requests without complete information may be rejected / deprioritized.
If an item is not applicable to you - please mark it as N/A

Describe the Bug:
when i executed :
test_session = await db_session_service.create_session(
app_name="test_app",
user_id="test_user",
session_id="test_session_001"
)

i got the error:
DBAPIError: (sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.DataError'>: invalid input for query argument $5: datetime.datetime(2026, 2, 9, 3, 16, 48,... (can't subtract offset-naive and offset-aware datetimes)
[SQL: INSERT INTO sessions (app_name, user_id, id, state, create_time, update_time) VALUES ($1::VARCHAR, $2::VARCHAR, $3::VARCHAR, $4::JSONB, $5::TIMESTAMP WITHOUT TIME ZONE, $6::TIMESTAMP WITHOUT TIME ZONE)]
[parameters: ('test_app', 'test_user', 'test_session_001', '{}', datetime.datetime(2026, 2, 9, 3, 16, 48, 817695, tzinfo=datetime.timezone.utc), datetime.datetime(2026, 2, 9, 3, 16, 48, 817695, tzinfo=datetime.timezone.utc))]
(Background on this error at: https://sqlalche.me/e/20/dbapi)

Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:

  1. Install '...'
  2. Run '....'
  3. Open '....'
  4. Provide error or stacktrace

Expected Behavior:
A clear and concise description of what you expected to happen.

Observed Behavior:
What actually happened? Include error messages or crash stack traces here.

Environment Details:

  • ADK Library Version (pip show google-adk):1.24.1
  • Desktop OS:** [e.g., macOS, Linux, Windows]:windows
  • Python Version (python -V):12.0

Model Information:

  • Are you using LiteLLM: Yes
  • Which model is being used: (e.g., gemini-2.5-pro)

馃煛 Optional Information

Providing this information greatly speeds up the resolution process.

Regression:
Did this work in a previous version of ADK? If so, which one?

Logs:
Please attach relevant logs. Wrap them in code blocks (```) or attach a
text file.

// Paste logs here

Screenshots / Video:
If applicable, add screenshots or screen recordings to help explain
your problem.

Additional Context:
Add any other context about the problem here.

Minimal Reproduction Code:
Please provide a code snippet or a link to a Gist/repo that isolates the issue.

// Code snippet here

How often has this issue occurred?:

  • Always (100%)
  • Often (50%+)
  • Intermittently (<50%)
  • Once / Rare

Activity

  1. added
    services[Component] This issue is related to runtime services, e.g. sessions, memory, artifacts, etc
    on Feb 9, 2026
  2. added theissue type on Feb 9, 2026
  3. Jacksunwei commented on Feb 9, 2026

    @Jacksunwei
    Collaborator

    Duplicate of #4366

    Sorry for the trouble you ran into with this!

    Root Cause: Timezone-aware datetime passed to PostgreSQL TIMESTAMP WITHOUT TIME ZONE column in DatabaseSessionService.

  4. self-assigned this
    on Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

services[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