Closed AtkinsSJ closed 13 hours ago
@KernelDeimos
Just noticed this does actually show up in the server console:
THIS WAS CALLED (SET) { key: 'user_preferences.show_hidden_files', value: true }
[ERRO::error-service] (7.621s) Error @ kvstore:sqlite_error: Broken database version - please contact maintainers; SqliteError: ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint
at Database.prepare (/home/sam/Projects/HeyPuter/puter/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
at SqliteDatabaseAccessService._write (/home/sam/Projects/HeyPuter/puter/packages/backend/src/services/database/SqliteDatabaseAccessService.js:201:30)
at SqliteDatabaseAccessService.write (/home/sam/Projects/HeyPuter/puter/packages/backend/src/services/database/BaseDatabaseAccessService.js:52:21)
at Object.set (/home/sam/Projects/HeyPuter/puter/packages/backend/src/drivers/DBKVStore.js:97:26)
at cls._run (/home/sam/Projects/HeyPuter/puter/packages/backend/src/codex/CodeUtil.js:37:37)
at /home/sam/Projects/HeyPuter/puter/packages/backend/src/services/OperationTraceService.js:259:40
at /home/sam/Projects/HeyPuter/puter/packages/backend/src/util/context.js:115:26
at AsyncLocalStorage.run (node:async_hooks:346:14)
at Context.arun (/home/sam/Projects/HeyPuter/puter/packages/backend/src/util/context.js:113:26)
at cls.run (/home/sam/Projects/HeyPuter/puter/packages/backend/src/services/OperationTraceService.js:250:28)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /home/sam/Projects/HeyPuter/puter/packages/backend/src/traits/OtelTrait.js:38:30
at async instance.<computed> (/home/sam/Projects/HeyPuter/puter/packages/backend/src/traits/OtelTrait.js:37:17)
at async /home/sam/Projects/HeyPuter/puter/packages/backend/src/traits/OtelTrait.js:38:30
at async instance.<computed> [as run] (/home/sam/Projects/HeyPuter/puter/packages/backend/src/traits/OtelTrait.js:37:17)
at async Object.<anonymous> (/home/sam/Projects/HeyPuter/puter/packages/backend/src/codex/CodeUtil.js:46:20)
at async DBKVStore.call (/home/sam/Projects/HeyPuter/puter/packages/backend/src/definitions/Driver.js:58:16)
at async DriverService._call (/home/sam/Projects/HeyPuter/puter/packages/backend/src/services/drivers/DriverService.js:86:26)
at async DriverService.call (/home/sam/Projects/HeyPuter/puter/packages/backend/src/services/drivers/DriverService.js:53:20)
at async /home/sam/Projects/HeyPuter/puter/packages/backend/src/routers/drivers/call.js:69:16
at async /home/sam/Projects/HeyPuter/puter/packages/backend/src/util/context.js:115:20
at async Context.arun (/home/sam/Projects/HeyPuter/puter/packages/backend/src/util/context.js:113:16)
at async /home/sam/Projects/HeyPuter/puter/packages/backend/src/routers/drivers/call.js:68:20
at async errorHandledHandler (/home/sam/Projects/HeyPuter/puter/packages/backend/src/api/eggspress.js:183:14)
Will see if I can figure it out now.
Looks like this is caused by #280: the ON CONFLICT()
clause is running, but the UNIQUE (user_id, app, kkey_hash)
clause hasn't applied to the kv table, I guess because it already existed? Just tried creating a fresh DB and that clause does appear in the kv table's schema, and that fixes the bug. Though, I get a different error on startup:
green-pen-2032 (process:unhandledRej...) :: no such column: public_uuid (2)
started: 2024-06-28T13:41:40.255Z
short id: green-pen-2032
original id: process:unhandledRejection:no such column: public_uuid
SqliteError: no such column: public_uuid
at Database.prepare (/home/sam/Projects/HeyPuter/puter/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
at SqliteDatabaseAccessService._write (/home/sam/Projects/HeyPuter/puter/packages/backend/src/services/database/SqliteDatabaseAccessService.js:201:30)
at SqliteDatabaseAccessService.write (/home/sam/Projects/HeyPuter/puter/packages/backend/src/services/database/BaseDatabaseAccessService.js:52:21)
at generate_system_fsentries (/home/sam/Projects/HeyPuter/puter/packages/backend/src/helpers.js:1482:8)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /home/sam/Projects/HeyPuter/puter/packages/backend/src/routers/signup.js:287:5
at async errorHandledHandler (/home/sam/Projects/HeyPuter/puter/packages/backend/src/api/eggspress.js:183:14)
- error: SqliteError: no such column: public_uuid
at Database.prepare (/home/sam/Projects/HeyPuter/puter/node_modules/better-sqlite3/lib/methods/wrappers.js:5:21)
at SqliteDatabaseAccessService._write (/home/sam/Projects/HeyPuter/puter/packages/backend/src/services/database/SqliteDatabaseAccessService.js:201:30)
at SqliteDatabaseAccessService.write (/home/sam/Projects/HeyPuter/puter/packages/backend/src/services/database/BaseDatabaseAccessService.js:52:21)
at generate_system_fsentries (/home/sam/Projects/HeyPuter/puter/packages/backend/src/helpers.js:1482:8)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /home/sam/Projects/HeyPuter/puter/packages/backend/src/routers/signup.js:287:5
at async errorHandledHandler (/home/sam/Projects/HeyPuter/puter/packages/backend/src/api/eggspress.js:183:14) {
code: 'SQLITE_ERROR'
}
This is two issues it turns out.
gui
is seeing that "false"
is true
because dynamic typing is hilarious.ON CONFLICT
and the table schema isn't correct; I see duplicate rows whenever I update a value.I'm working on a migration that will fix both of these.
I confused myself there because I had multiple users in different windows - ON CONFLICT
actually is working fine, but maybe I updated that improperly earlier on so some local installs don't have the right value; migrating the table should fix that anyway I'm hoping.
I believe this is now fixed
Issue Description I've previously noticed the file explorer's "Show hidden" setting not persisting, but today realised this also applies to changing the language, or the menubar style. All of these make use of
puter.kv
, so I suspect the self-host version of that is not saving data correctly. The color theme on the other hand does persist, and that uses a different mechanism to save and load.Steps to Reproduce
Expected & Actual Behavior These settings should persist, but they do not.
Addition Information or Screenshots (if applicable)
Deployment
npm run start
)docker run
)docker-compose
)Puter version (if accessible)