Repository navigation
create_session bug聽#4419
Description
馃敶 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:
- Install '...'
- Run '....'
- Open '....'
- 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 hereHow often has this issue occurred?:
- Always (100%)
- Often (50%+)
- Intermittently (<50%)
- Once / Rare
Activity
Jacksunwei commentedon Feb 9, 2026
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.