Skip to content

[Bug]: Creating a custom exercise fails with "Database operation failed" #418

Closed

Description

@thwbh

Version

26.39.0

Operating System

Android

Installation Method

APK (Direct Download)

Impact

Major (Feature completely broken)

Category

Other

Expected Behavior

Creating a custom exercise from the exercise library maintenance page saves it to the library, so it is available when logging workouts.

Actual Behavior

Saving a custom exercise fails with the error toast "Database operation failed" and the exercise is not created. The log shows repeated foreign key violations:

[2026-09-27][10:32:31][ERROR][librefit_lib::util::error_handler] Database operation failed: DatabaseError(ForeignKeyViolation, "FOREIGN KEY constraint failed")
[2026-09-27][10:32:31][ERROR][librefit_lib::util::error_handler] Database operation failed: DatabaseError(ForeignKeyViolation, "FOREIGN KEY constraint failed")
[2026-09-27][10:32:31][ERROR][librefit_lib::util::error_handler] Database error kind: ForeignKeyViolation, info: "FOREIGN KEY constraint failed"
[2026-09-27][10:32:31][ERROR][librefit_lib::util::error_handler] Database error kind: ForeignKeyViolation, info: "FOREIGN KEY constraint failed"

Steps to Reproduce

  1. Open the exercise library maintenance page
  2. Create a new custom exercise (name, category, muscles, ...)
  3. Save
  4. Error toast "Database operation failed"; the exercise does not appear in the library

Frequency

Always (100% of the time)

Additional Context (Optional)

  • The ForeignKeyViolation indicates the INSERT references a row that does not exist in a related table — likely exercise_category (or a muscle mapping via exercise_muscle). Possibly the create flow submits a category/muscle value that does not resolve to an existing id (wrong id, name-vs-id mismatch, or a stale/default id).
  • The exercise library maintenance page shipped with 26.39.0 (274 feature exercise library #284); this is the first release carrying the feature.

Activity

  1. added
    bug
    review required
    target:common
    on Sep 27, 2026
  2. added
    target:android
    on Sep 27, 2026
  3. linked a pull request that will close this issue26.39.1 #419on Sep 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreview requiredtarget:androidtarget:common

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions