Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CompositeError: failed to initialize these services: database #258

Closed
3 tasks done
liusanp opened this issue Apr 10, 2024 · 2 comments
Closed
3 tasks done

CompositeError: failed to initialize these services: database #258

liusanp opened this issue Apr 10, 2024 · 2 comments

Comments

@liusanp
Copy link

liusanp commented Apr 10, 2024

Issue Description

The first time I started, there was a table creation error.

Steps to Reproduce

Expected & Actual Behavior

Addition Information or Screenshots (if applicable)

{
    "error": "CompositeError: failed to initialize these services: database\n    at Container.init (/data/git/puter/packages/backend/src/services/Container.js:81:19)\n    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at async Kernel._install_modules (/data/git/puter/packages/backend/src/Kernel.js:114:13)\n    at async /data/git/puter/packages/backend/src/Kernel.js:97:13\n    at async /data/git/puter/packages/backend/src/util/context.js:115:20\n    at async Context.arun (/data/git/puter/packages/backend/src/util/context.js:113:16)\n--- Inner error: SqliteError: table `user_to_user_permissions` already exists\n    at Database.exec (/data/git/puter/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14)\n    at SqliteDatabaseAccessService._init (/data/git/puter/packages/backend/src/services/database/SqliteDatabaseAccessService.js:85:25)\n    at async SqliteDatabaseAccessService.init (/data/git/puter/packages/backend/src/services/BaseService.js:48:9)\n    at async Container.init (/data/git/puter/packages/backend/src/services/Container.js:73:17)\n    at async Kernel._install_modules (/data/git/puter/packages/backend/src/Kernel.js:114:13)\n    at async /data/git/puter/packages/backend/src/Kernel.js:97:13\n    at async /data/git/puter/packages/backend/src/util/context.js:115:20\n    at async Context.arun (/data/git/puter/packages/backend/src/util/context.js:113:16)\n--- End of inner error {\n  innerErrors: [\n    SqliteError: table `user_to_user_permissions` already exists\n        at Database.exec (/data/git/puter/node_modules/better-sqlite3/lib/methods/wrappers.js:9:14)\n        at SqliteDatabaseAccessService._init (/data/git/puter/packages/backend/src/services/database/SqliteDatabaseAccessService.js:85:25)\n        at async SqliteDatabaseAccessService.init (/data/git/puter/packages/backend/src/services/BaseService.js:48:9)\n        at async Container.init (/data/git/puter/packages/backend/src/services/Container.js:73:17)\n        at async Kernel._install_modules (/data/git/puter/packages/backend/src/Kernel.js:114:13)\n        at async /data/git/puter/packages/backend/src/Kernel.js:97:13\n        at async /data/git/puter/packages/backend/src/util/context.js:115:20\n        at async Context.arun (/data/git/puter/packages/backend/src/util/context.js:113:16) {\n      code: 'SQLITE_ERROR'\n    }\n  ],\n  originalStackDescriptor: {\n    get: [Function (anonymous)],\n    set: [Function (anonymous)],\n    enumerable: false,\n    configurable: true\n  }\n}"
}

Tooling

  • Development (npm run start)
  • Docker (via docker run)
  • Docker (via docker-compose)

Puter version (if accessible)

Click the profile button on the top-right, then "Settings". The version number will be printed at the bottom

@KernelDeimos
Copy link
Contributor

Hi, thanks for the report. I believe I finally understand what's going on - this will be fixed shortly

@KernelDeimos
Copy link
Contributor

This issue should be fixed now: eb66848

Since this was a database initialization issue, you'll need to manually get your database version to be consistent. Here are a few ways to do that:

  • clear the data (or volatile/runtime) directory (note: files on Puter will be lost if you do this!)
  • use sqlitebrowser (or another tool) and manually execute the query PRAGMA user_version=1;
  • manually remove the tables added by this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants