[GH-ISSUE #5616] [Bug]: SqliteError: no such column: categories2.group #44073

Open
opened 2026-04-26 04:58:15 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @Phil89a on GitHub (Aug 23, 2025).
Original GitHub issue: https://github.com/actualbudget/actual/issues/5616

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

Trying to pull all transactions and the account, category and category group name using ActualQL using

    const query = api.q('transactions')
      .filter({ date: { $transform: '$month', $eq: month } })
      .select(['*',
        'category.group.name',
        'category.name',
        'account.name',
      ]);

Fails on the category.group.name - remove category.group.name and it works

When it fails I get the below error returned. I assume this a bug ?

**Error Summary:**
Node script failed with return code 1
SqliteError: no such column: categories2.group
Node.js v20.19.0
**Context / Stack Trace:**
at Database.prepare (.../node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
at Module.runQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:11042:52)
at runQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:13756:127)
at Module.all (.../node_modules/@actual-app/api/dist/app/bundle.api.js:13763:54)
at execQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12034:261)
at execTransactionsBasic (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12179:361)
at Object.transactions (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12184:173)
at runCompiledAqlQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12039:300)
at compileAndRunAqlQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12046:236)
at aqlQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12052:214)
**Stdout / Info:**
Loaded spreadsheet from cache (16,511 items)
Syncing since 2025-08-23T12:43:04.551Z
Attempt: 0
Got messages from server: 0
**Problematic SQL Query (truncated for readability):**
SELECT 
    v_transactions_internal_alive.id AS id,
    v_transactions_internal_alive.is_parent AS is_parent,
    categories2.name AS "category.name",
    category_groups5.name AS "category.group.name",
    accounts1.name AS "account.name",
    ...
FROM v_transactions_internal_alive
LEFT JOIN accounts accounts1 ON ...
LEFT JOIN categories categories2 ON ...
LEFT JOIN category_groups category_groups5 ON category_groups5.id = categories2."group" AND category_groups5.tombstone = 0
WHERE ...
ORDER BY v_transactions_internal_alive.date DESC, ...

How can we reproduce the issue?

Try executing the above query using aqlQuery.

Where are you hosting Actual?

Docker

What browsers are you seeing the problem on?

Safari

Operating System

Mac OSX

Originally created by @Phil89a on GitHub (Aug 23, 2025). Original GitHub issue: https://github.com/actualbudget/actual/issues/5616 ### Verified issue does not already exist? - [x] I have searched and found no existing issue ### What happened? Trying to pull all transactions and the account, category and category group name using ActualQL using ``` const query = api.q('transactions') .filter({ date: { $transform: '$month', $eq: month } }) .select(['*', 'category.group.name', 'category.name', 'account.name', ]); ``` Fails on the category.group.name - remove category.group.name and it works When it fails I get the below error returned. I assume this a bug ? ``` **Error Summary:** Node script failed with return code 1 SqliteError: no such column: categories2.group Node.js v20.19.0 **Context / Stack Trace:** at Database.prepare (.../node_modules/better-sqlite3/lib/methods/wrappers.js:5:21) at Module.runQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:11042:52) at runQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:13756:127) at Module.all (.../node_modules/@actual-app/api/dist/app/bundle.api.js:13763:54) at execQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12034:261) at execTransactionsBasic (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12179:361) at Object.transactions (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12184:173) at runCompiledAqlQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12039:300) at compileAndRunAqlQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12046:236) at aqlQuery (.../node_modules/@actual-app/api/dist/app/bundle.api.js:12052:214) **Stdout / Info:** Loaded spreadsheet from cache (16,511 items) Syncing since 2025-08-23T12:43:04.551Z Attempt: 0 Got messages from server: 0 **Problematic SQL Query (truncated for readability):** SELECT v_transactions_internal_alive.id AS id, v_transactions_internal_alive.is_parent AS is_parent, categories2.name AS "category.name", category_groups5.name AS "category.group.name", accounts1.name AS "account.name", ... FROM v_transactions_internal_alive LEFT JOIN accounts accounts1 ON ... LEFT JOIN categories categories2 ON ... LEFT JOIN category_groups category_groups5 ON category_groups5.id = categories2."group" AND category_groups5.tombstone = 0 WHERE ... ORDER BY v_transactions_internal_alive.date DESC, ... ``` ### How can we reproduce the issue? Try executing the above query using aqlQuery. ### Where are you hosting Actual? Docker ### What browsers are you seeing the problem on? Safari ### Operating System Mac OSX
GiteaMirror added the APIbug labels 2026-04-26 04:58:16 -05:00
Author
Owner

@MatissJanis commented on GitHub (Sep 27, 2025):

Easier reproduction:

  1. open edge
  2. open devtools console
  3. paste the following snippet
window.$query(window.$q('transactions')
      .filter({ date: { $transform: '$month', $eq: "2025-01" } })
      .select(['*',
        'category.group.name',
        'category.name',
        'account.name',
      ]));
<!-- gh-comment-id:3341864120 --> @MatissJanis commented on GitHub (Sep 27, 2025): Easier reproduction: 1. open edge 2. open devtools console 3. paste the following snippet ``` window.$query(window.$q('transactions') .filter({ date: { $transform: '$month', $eq: "2025-01" } }) .select(['*', 'category.group.name', 'category.name', 'account.name', ])); ```
Author
Owner

@Phil89a commented on GitHub (Nov 8, 2025):

Hi - is this suppose to be fixed now ?

Running against latest release and I am still getting the error with category.group.name - "error": "no such column: categories2.group"

`error
SELECT v_transactions_internal_alive.id AS id, v_transactions_internal_alive.is_parent AS is_parent, v_transactions_internal_alive.is_child AS is_child, v_transactions_internal_alive.parent_id AS parent_id, accounts1.id AS account, categories2.id AS category, v_transactions_internal_alive.amount AS amount, payees3.id AS payee, v_transactions_internal_alive.notes AS notes, v_transactions_internal_alive.date AS date, v_transactions_internal_alive.imported_id AS imported_id, v_transactions_internal_alive.error AS error, v_transactions_internal_alive.imported_payee AS imported_payee, v_transactions_internal_alive.starting_balance_flag AS starting_balance_flag, v_transactions_internal_alive.transfer_id AS transfer_id, v_transactions_internal_alive.sort_order AS sort_order, v_transactions_internal_alive.cleared AS cleared, v_transactions_internal_alive.reconciled AS reconciled, v_transactions_internal_alive.tombstone AS tombstone, schedules4.id AS schedule, v_transactions_internal_alive.raw_synced_data AS raw_synced_data, v_transactions_internal_alive.id AS id, accounts1.name AS "account.name", categories2.name AS "category.name", category_groups5.name AS "category.group.name", v_transactions_internal_alive.amount AS amount, payees3.name AS "payee.name", v_transactions_internal_alive.notes AS notes, v_transactions_internal_alive.date AS date, v_transactions_internal_alive.cleared AS cleared, v_transactions_internal_alive.reconciled AS reconciled, schedules4.id AS schedule, v_transactions_internal_alive.transfer_id AS transfer_id, v_transactions_internal_alive.raw_synced_data AS raw_synced_data FROM v_transactions_internal_alive
LEFT JOIN accounts accounts1 ON accounts1.id = v_transactions_internal_alive.account AND accounts1.tombstone = 0
LEFT JOIN categories categories2 ON categories2.id = v_transactions_internal_alive.category AND categories2.tombstone = 0
LEFT JOIN payees payees3 ON payees3.id = v_transactions_internal_alive.payee AND payees3.tombstone = 0
LEFT JOIN schedules schedules4 ON schedules4.id = v_transactions_internal_alive.schedule AND schedules4.tombstone = 0
LEFT JOIN category_groups category_groups5 ON category_groups5.id = categories2."group" AND category_groups5.tombstone = 0
WHERE ((accounts1.offbudget = 0
AND categories2.is_income = 1)) AND v_transactions_internal_alive.is_parent = 0 AND v_transactions_internal_alive.tombstone = 0

ORDER BY v_transactions_internal_alive.date desc, v_transactions_internal_alive.starting_balance_flag, v_transactions_internal_alive.sort_order desc, v_transactions_internal_alive.id

`

<!-- gh-comment-id:3506686597 --> @Phil89a commented on GitHub (Nov 8, 2025): Hi - is this suppose to be fixed now ? Running against latest release and I am still getting the error with category.group.name - "error": "no such column: categories2.group" `error SELECT v_transactions_internal_alive.id AS id, v_transactions_internal_alive.is_parent AS is_parent, v_transactions_internal_alive.is_child AS is_child, v_transactions_internal_alive.parent_id AS parent_id, accounts1.id AS account, categories2.id AS category, v_transactions_internal_alive.amount AS amount, payees3.id AS payee, v_transactions_internal_alive.notes AS notes, v_transactions_internal_alive.date AS date, v_transactions_internal_alive.imported_id AS imported_id, v_transactions_internal_alive.error AS error, v_transactions_internal_alive.imported_payee AS imported_payee, v_transactions_internal_alive.starting_balance_flag AS starting_balance_flag, v_transactions_internal_alive.transfer_id AS transfer_id, v_transactions_internal_alive.sort_order AS sort_order, v_transactions_internal_alive.cleared AS cleared, v_transactions_internal_alive.reconciled AS reconciled, v_transactions_internal_alive.tombstone AS tombstone, schedules4.id AS schedule, v_transactions_internal_alive.raw_synced_data AS raw_synced_data, v_transactions_internal_alive.id AS id, accounts1.name AS "account.name", categories2.name AS "category.name", category_groups5.name AS "category.group.name", v_transactions_internal_alive.amount AS amount, payees3.name AS "payee.name", v_transactions_internal_alive.notes AS notes, v_transactions_internal_alive.date AS date, v_transactions_internal_alive.cleared AS cleared, v_transactions_internal_alive.reconciled AS reconciled, schedules4.id AS schedule, v_transactions_internal_alive.transfer_id AS transfer_id, v_transactions_internal_alive.raw_synced_data AS raw_synced_data FROM v_transactions_internal_alive LEFT JOIN accounts accounts1 ON accounts1.id = v_transactions_internal_alive.account AND accounts1.tombstone = 0 LEFT JOIN categories categories2 ON categories2.id = v_transactions_internal_alive.category AND categories2.tombstone = 0 LEFT JOIN payees payees3 ON payees3.id = v_transactions_internal_alive.payee AND payees3.tombstone = 0 LEFT JOIN schedules schedules4 ON schedules4.id = v_transactions_internal_alive.schedule AND schedules4.tombstone = 0 LEFT JOIN category_groups category_groups5 ON category_groups5.id = categories2."group" AND category_groups5.tombstone = 0 WHERE ((accounts1.offbudget = 0 AND categories2.is_income = 1)) AND v_transactions_internal_alive.is_parent = 0 AND v_transactions_internal_alive.tombstone = 0 ORDER BY v_transactions_internal_alive.date desc, v_transactions_internal_alive.starting_balance_flag, v_transactions_internal_alive.sort_order desc, v_transactions_internal_alive.id `
Author
Owner

@MatissJanis commented on GitHub (Nov 8, 2025):

No, this has not been fixed. The issue will be closed once it is patched.

<!-- gh-comment-id:3506722829 --> @MatissJanis commented on GitHub (Nov 8, 2025): No, this has not been fixed. The issue will be closed once it is patched.
Author
Owner

@Phil89a commented on GitHub (Nov 8, 2025):

Thanks still learning how this ticket system works :-)

<!-- gh-comment-id:3506723857 --> @Phil89a commented on GitHub (Nov 8, 2025): Thanks still learning how this ticket system works :-)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#44073