{"record":{"id":"8648163cbd90ec60","repo":"actualbudget/actual","slug":"table-table-does-not-exist","errorCode":null,"errorMessage":"Table \"${table}\" does not exist","messagePattern":"Table \"(.+?)\" does not exist","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"packages/loot-core/src/server/aql/schema-helpers.ts","lineNumber":97,"sourceCode":"      } catch {\n        return type === 'json/fallback' ? value : null;\n      }\n    default:\n  }\n\n  return value;\n}\n\nexport function conform(\n  schema,\n  schemaConfig,\n  table,\n  obj,\n  { skipNull = false } = {},\n) {\n  const tableSchema = schema[table];\n  if (tableSchema == null) {\n    throw new Error(`Table \"${table}\" does not exist`);\n  }\n\n  const views = schemaConfig.views || {};\n\n  // Rename fields if necessary\n  const fieldRef = field => {\n    if (views[table] && views[table].fields) {\n      return views[table].fields[field] || field;\n    }\n    return field;\n  };\n\n  return Object.fromEntries(\n    Object.keys(obj)\n      .map(field => {\n        // Fields that start with an underscore are ignored\n        if (field[0] === '_') {\n          return null;","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/actualbudget/actual/blob/d4334cb6e6123f4d3bcea1ad6166608884c7e658/packages/loot-core/src/server/aql/schema-helpers.ts#L79-L115","documentation":"conform validates that the table name passed to an insert/update/query exists in the aql schema map before touching fields. An unknown table name means a typo or an attempt to query a table this schema version does not know about, so it throws 'Table \"X\" does not exist'.","triggerScenarios":"Calling convertForInsert/convertForUpdate (or anything using conform, like `obj`) with a table name that is misspelled, deprecated, or simply not present in the schema registry passed in.","commonSituations":"Custom scripts/plugins referencing internal tables renamed between Actual versions, typos like 'transactions ' (trailing space) or 'transcations', and code written against a fork whose schema diverged.","solutions":["Check the spelling of the table name against the schema in packages/loot-core/src/server/aql/schema (e.g. 'transactions', 'accounts', 'payees').","Update the code to the current table name if the schema was renamed in a newer Actual version.","If adding a new table, register it in the aql schema map before using conform.","Validate the table name comes from a trusted constant, not user input."],"exampleFix":"// before\nconvertForInsert(schema, schemaConfig, 'transcations', obj);\n// after\nconvertForInsert(schema, schemaConfig, 'transactions', obj);","handlingStrategy":"validation","validationCode":"const KNOWN_TABLES = new Set(['transactions','accounts','payees','category_groups','categories']);\nif (!KNOWN_TABLES.has(table)) throw new Error(`Unknown table: ${table}`);","typeGuard":null,"tryCatchPattern":"try {\n  return convertForInsert(schema, schemaConfig, table, obj);\n} catch (e) {\n  if (e.message.includes('does not exist')) {\n    logger.error('Unknown table in insert', { table });\n    throw new Error(`Internal error: invalid table ${table}`);\n  }\n  throw e;\n}","preventionTips":["Reference table names via exported constants, never raw strings","Grep the aql schema file when unsure of a table name","Check schema renames when upgrading Actual versions"],"tags":["schema","table","aql","typo"],"backgroundTag":"unknown-table-schema","analyzedSha":"d4334cb6e6123f4d3bcea1ad6166608884c7e658","analyzedAt":"2026-08-29T01:02:11.213Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}