chainlit icon indicating copy to clipboard operation
chainlit copied to clipboard

BUG : `UndefinedColumnError` when inserting into `steps` table: column "defaultOpen" does not exist

Open dominpm opened this issue 7 months ago • 1 comments
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

  1. Set up Chainlit using the official Data Layer with a PostgreSQL backend.
  2. Run an app that uses the @cl.step decorator or creates Step entries.
  3. 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 defaultOpen column exists in the steps table 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 userId column in threads.
  • #1179: Issue involving disableFeedback column on steps, 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.

dominpm avatar Apr 21 '25 10:04 dominpm