You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Database configuration needed even when it's not used #999
Or to create the default location for the database:
./storage/tracker/lib/database/
Otherwise, you get this error:
TORRUST_TRACKER_CONFIG_TOML_PATH=./share/default/config/tracker.udp.benchmarking.toml torrust-tracker
Loading extra configuration from file: `./share/default/config/tracker.udp.benchmarking.toml` ...
2024-08-07T14:37:42.754632Z ERROR r2d2: unable to open database file: ./storage/tracker/lib/database/sqlite3.db
Besides, the database is created and tables too.
I think the app should not:
Require any DB configuration or storage folder.
Or create any DB file or tables.
If none of the features requiring persistency is enabled.
I think the problem is we create the tables when we instantiate the DB driver:
pubfnbuild(driver:&Driver,db_path:&str) -> Result<Box<dynDatabase>,Error>{let database = match driver {Driver::Sqlite3 => Builder::<Sqlite>::build(db_path),Driver::MySQL => Builder::<Mysql>::build(db_path),}?;
database.create_database_tables().expect("Could not create database tables.");Ok(database)}
I think we should move that logic out of the driver constructor and use an internal flag to call create_database_tables only once (the first time the driver is used).
This PR deliberately does not close this issue. It adds the v3 Option<Database> representation, optional composition seam, temporary v2 compatibility bridge, reusable bootstrap persistence-requirement matrix, and ADR while preserving the current persistence-initializing runtime.
The persistence-free runtime activation follow-up then replaces that bridge with the actual v3 core.database value, invokes the requirement validation, implements the no-driver/no-migration branch, updates the container entrypoint, and records M1–M6.
The activation follow-up has intentionally not been created as a GitHub issue yet. Its approved planning draft is docs/issues/open/999-1978-optional-database-configuration/persistence-free-runtime-activation-draft.md; it must be refined against merged #999 and #1980 implementation evidence before opening it.
Activate persistence-free v3 runtime composition #2107, merged by PR feat(tracker-core): activate persistence-free v3 runtime composition #2112, replaced the bridge with the actual v3 core.database value and delivered the persistence-free runtime: no driver, migration, database file, or database connection when no configured capability requires persistence. It also completed the validation matrix, configured SQLite/MySQL/PostgreSQL lifecycle coverage, REST disabled-capability 409 Conflict responses, container startup support, transition protection, and M1-M6 evidence.
The original outcome is therefore complete: a public tracker with persistence-backed capabilities disabled no longer requires database configuration or storage and does not create database artifacts. The remaining API provenance work is separately tracked under #144 and is not a blocker for this issue.
Activity
josecelano commentedon Aug 7, 2024
I think the problem is we create the tables when we instantiate the DB driver:
I think we should move that logic out of the driver constructor and use an internal flag to call
create_database_tablesonly once (the first time the driver is used).Merge #2094: docs(issues): specify optional v3 database configuration
Merge #2098: docs(configuration): define optional persistence activat…
josecelano commentedon Aug 26, 2026
Phase 3 is implemented in PR #2099: #2099
This PR deliberately does not close this issue. It adds the v3
Option<Database>representation, optional composition seam, temporary v2 compatibility bridge, reusable bootstrap persistence-requirement matrix, and ADR while preserving the current persistence-initializing runtime.Remaining delivery is staged:
core.databasevalue, invokes the requirement validation, implements the no-driver/no-migration branch, updates the container entrypoint, and records M1–M6.The activation follow-up has intentionally not been created as a GitHub issue yet. Its approved planning draft is
docs/issues/open/999-1978-optional-database-configuration/persistence-free-runtime-activation-draft.md; it must be refined against merged #999 and #1980 implementation evidence before opening it.Merge #2099: feat(configuration): make v3 persistence optional
josecelano commentedon Aug 31, 2026
Closing this issue now that the staged delivery described above is complete.
Option<Database>configuration representation, composition seam, validation matrix, and temporary compatibility bridge.core.databasevalue and delivered the persistence-free runtime: no driver, migration, database file, or database connection when no configured capability requires persistence. It also completed the validation matrix, configured SQLite/MySQL/PostgreSQL lifecycle coverage, REST disabled-capability409 Conflictresponses, container startup support, transition protection, and M1-M6 evidence.The original outcome is therefore complete: a public tracker with persistence-backed capabilities disabled no longer requires database configuration or storage and does not create database artifacts. The remaining API provenance work is separately tracked under #144 and is not a blocker for this issue.
Closes #999 as completed.