[BUG] Template database /app/build/.template-migrated.db is read-only — test setup fails with sqlite3.OperationalError: attempt to write a readonly database #10092

Open
opened 2026-04-16 23:04:09 +00:00 by HAL9000 · 0 comments
Owner

Metadata

  • Commit Message: fix(test): ensure template database has write permissions before test setup
  • Branch: bugfix/m3-template-db-readonly

Background and Context

During UAT testing of the v3.3.0 subplan spawning features, the test infrastructure fails when attempting to create indexes in the template database. The file /app/build/.template-migrated.db is read-only, causing sqlite3.OperationalError during test setup.

Expected Behavior

The template database at /app/build/.template-migrated.db should be writable during test setup so that:

  • CREATE INDEX ix_resources_type and other DDL operations succeed
  • Tests can initialize their database state correctly
  • multi_project_subplan.feature and related tests can run

Current Behavior

sqlite3.OperationalError: attempt to write a readonly database
Location: /app/build/.template-migrated.db
Error during: CREATE INDEX ix_resources_type

This error occurs during test setup (before any test scenarios run), blocking all tests that depend on the template database.

Steps to Reproduce

  1. Clone the repository
  2. Run nox -s unit_tests -- features/multi_project_subplan.feature
  3. Observe sqlite3.OperationalError: attempt to write a readonly database

Impact

  • Blocks all tests that use the template database for setup
  • Affects: multi_project_subplan.feature, phase_reversion.feature, and other tests that require database initialization
  • Related to: Issue #9826 (behave-parallel multiprocessing deadlock on btrfs/overlayfs)

Acceptance Criteria

  • Template database file permissions are set correctly (writable) before test setup
  • nox -s unit_tests -- features/multi_project_subplan.feature runs without sqlite3.OperationalError
  • Test setup creates required indexes successfully
  • nox passes with coverage >= 97%

Subtasks

  • Identify where template DB is created and set permissions
  • Add chmod or equivalent to ensure write access before test setup
  • Verify fix works in CI environment (Docker/overlayfs)
  • Run nox -s unit_tests to confirm no regressions

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Metadata - **Commit Message**: `fix(test): ensure template database has write permissions before test setup` - **Branch**: `bugfix/m3-template-db-readonly` ## Background and Context During UAT testing of the v3.3.0 subplan spawning features, the test infrastructure fails when attempting to create indexes in the template database. The file `/app/build/.template-migrated.db` is read-only, causing `sqlite3.OperationalError` during test setup. ## Expected Behavior The template database at `/app/build/.template-migrated.db` should be writable during test setup so that: - `CREATE INDEX ix_resources_type` and other DDL operations succeed - Tests can initialize their database state correctly - `multi_project_subplan.feature` and related tests can run ## Current Behavior ``` sqlite3.OperationalError: attempt to write a readonly database Location: /app/build/.template-migrated.db Error during: CREATE INDEX ix_resources_type ``` This error occurs during test setup (before any test scenarios run), blocking all tests that depend on the template database. ## Steps to Reproduce 1. Clone the repository 2. Run `nox -s unit_tests -- features/multi_project_subplan.feature` 3. Observe `sqlite3.OperationalError: attempt to write a readonly database` ## Impact - Blocks all tests that use the template database for setup - Affects: `multi_project_subplan.feature`, `phase_reversion.feature`, and other tests that require database initialization - Related to: Issue #9826 (behave-parallel multiprocessing deadlock on btrfs/overlayfs) ## Acceptance Criteria - [ ] Template database file permissions are set correctly (writable) before test setup - [ ] `nox -s unit_tests -- features/multi_project_subplan.feature` runs without `sqlite3.OperationalError` - [ ] Test setup creates required indexes successfully - [ ] `nox` passes with coverage >= 97% ## Subtasks - [ ] Identify where template DB is created and set permissions - [ ] Add `chmod` or equivalent to ensure write access before test setup - [ ] Verify fix works in CI environment (Docker/overlayfs) - [ ] Run `nox -s unit_tests` to confirm no regressions ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#10092
No description provided.