chainlit
chainlit copied to clipboard
BUG : `UndefinedColumnError` when inserting into `steps` table: column "defaultOpen" does not exist
trafficstars
Problem description
While running my Chainlit app, I encountered the following error when trying to insert data into the steps table:
(sqlalchemy.dialects.postgresql.asyncpg.ProgrammingError) <class 'asyncpg.exceptions.UndefinedColumnError'>: column "defaultOpen" of relation "steps" does not exist
This happens during an INSERT or ON CONFLICT DO UPDATE operation on the steps table, referencing a column that doesn't seem to exist.
🔁 Steps to reproduce
- Set up Chainlit using the official Data Layer with a PostgreSQL backend.
- Run an app that uses the
@cl.stepdecorator or createsStepentries. - Observe the error when Chainlit attempts to store step data in the database.
✅ Expected behavior
The insert or update should complete without errors, and the step data should be correctly saved in the steps table.
ℹ️ Additional information
- Chainlit version: 2.4.400
- Database: PostgreSQL
- Using official Data Layer: ✅
💡 Possible solutions
- Make sure the
defaultOpencolumn exists in thestepstable schema. - If the column is optional or deprecated, consider removing it from the insert/update logic.
- Run database migrations if a recent update added this field but it hasn’t been applied.
🔍 Related issues
- #1394: Similar issue involving a missing
userIdcolumn inthreads. - #1179: Issue involving
disableFeedbackcolumn onsteps, resolved via schema adjustment.
Please let me know if this is a known issue, if a migration step is missing or the SQL schema should be updated in the docs @willydouhard . Happy to provide more logs or testing details if needed.