Skip to content

Bug: SQL run status definition does not include "QUEUED" #940

Description

@Drenderer

Description

The status column enum in sacred.observers.sql_bases.py does not include "QUEUED". This leads to an LookupError from sqlalchemy when starting a run after previously queuing a run.

Steps to Reproduce

Dummy main.py script:

from sacred import Experiment
from sacred.observers import SqlObserver

ex = Experiment("sql_queue_test", save_git_info=False)
ex.observers.append(SqlObserver("sqlite:///my_runs.db"))

@ex.config
def config():
    a = 1  # noqa: F841


@ex.automain
def main():
    pass

Then run the following twice:

python main.py -q

The second run results in the error:

LookupError: 'QUEUED' is not among the defined enum values. Enum name: status_enum. Possible values: RUNNING, COMPLETED, INTERRUPTED, ..., FAILED

Environment

  • Sacred version: 0.8.7
  • Python version: 3.11.9
  • OS: Windows 10

Activity

  1. thequilo commented on Aug 25, 2025

    @thequilo
    Collaborator

    Hi @Drenderer, thanks for reporting!

    I sometimes ask myself how this kind of issue stayed unnoticed for that long. I guess that the queue feature is not used much. I fixed it in #941.

  2. Drenderer commented on Sep 5, 2025

    @Drenderer
    Author

    Hi @thequilo, thank you for fixing the issue!
    The bug probably also went under the radar since it is only the second queued run that caused any problems. However, the niche nature of the queue feature is probably the main culprit. Are there any plans to further develop this feature in the near future, for example by enabling parallel execution of queued runs?

  3. added a commit that references this issue on Sep 5, 2025
    decffbc
  4. thequilo commented on Sep 5, 2025

    @thequilo
    Collaborator

    You currently have to retrieve the queued runs from the DB and execute them yourself. There are no plans to develop anything in that direction. While I think that this would be useful, there's a lot that would have to happen before this could be implemented, and the number of maintainers / collaborators on this project is unfortunately small.

  5. Drenderer commented on Sep 5, 2025

    @Drenderer
    Author

    Alright, I'll see what I can come up with. Thank you!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions