Skip to content
Source
Sign inSign up
pingdotgg/t3code

SQLite projector fails with `no such savepoint: effect_sql_1` #5035

Closedahammednibras8(GitHub profile, opens in a new tab) opened this issue 2 comments

Summary

T3 Code (Alpha) fails while starting a thread turn because the event projector cannot execute its SQLite statement.

Error

effect/sql/SqlError: Failed to execute statement
    at runProjectorForEvent (file:///Applications/T3%20Code%20(Alpha).app/Contents/Resources/app.asar/apps/server/dist/bin.mjs:24154:76)
    at runProjectorForEvent (definition) (Alpha)
    at orchestration.command.thread.turn.start (file:///Applications/T3%20Code%20(Alpha).app/Contents/Resources/app.asar/apps/server/dist/bin.mjs:21774:18) {
  [cause]: effect/sql/SqlError/UnknownError: Failed to execute statement
      at classifySqliteError (file:///Applications/T3%20Code%20(Alpha).app/Contents/Resources/app.asar/node_modules/effect/dist/unstable/sql/SqlError.js:446:10) {
    [cause]: Error: no such savepoint: effect_sql_1
  }
}

Expected behavior

Starting a thread turn should complete without a SQLite savepoint error.

Actual behavior

The turn fails before it can start, with SQLite reporting that savepoint effect_sql_1 does not exist.

Environment

  • T3 Code (Alpha)
  • macOS (application path: /Applications/T3 Code (Alpha).app)

I don’t yet have reliable reproduction steps beyond encountering the failure when a thread turn starts.

  1. Additional occurrence that appears related: dispatching an orchestration command fails during rollback because SQLite says there is no active transaction.

    OrchestrationDispatchCommandError: Failed to execute statement
        at toDispatchCommandError (file:///Applications/T3%20Code%20(Alpha).app/Contents/Resources/app.asar/apps/server/dist/bin.mjs:43776:114)
        at file:///Applications/T3%20Code%20(Alpha).app/Contents/Resources/app.asar/apps/server/dist/bin.mjs:44032:234
        at file:///Applications/T3%20Code%20(Alpha).app/Contents/Resources/app.asar/node_modules/effect/dist/internal/effect.js:1378:96
        at ~effect/Utils/internal (file:///Applications/T3%20Code%20(Alpha).app/Contents/Resources/app.asar/node_modules/effect/dist/Utils.js:83:14)
        at ws.rpc.orchestration.dispatchCommand (file:///Applications/T3%20Code%20(Alpha).app/Contents/Resources/app.asar/apps/server/dist/bin.mjs:32777:111) {
      [cause]: effect/sql/SqlError: Failed to execute statement {
        [cause]: effect/sql/SqlError/UnknownError: Failed to execute statement
            at classifySqliteError (file:///Applications/T3%20Code%20(Alpha).app/Contents/Resources/app.asar/node_modules/effect/dist/unstable/sql/SqlError.js:446:10) {
          [cause]: Error: cannot rollback - no transaction is active
        }
      }
    }

    This looks like the same underlying SQLite transaction/savepoint lifecycle issue as the original report.

  2. this error used to clear after reopening the app, but that workaround isn't working anymore. I'll need to look at other options in the meantime, but I'd genuinely rather stay. Ping me once it's resolved and I'll come back

  3. juliusmarminge closed this

Sign in to join this conversation.