Skip to content

Bug: Undefined variable 's' in start_tasks.py causes NameError #3606

@atheendre130505

Description

@atheendre130505

Description: The tasks retry_errored_repos and create_collection_status_records in augur/tasks/start_tasks.py
use a variable s to create SQL text (e.g., s.sql.text), but the variable s (alias for sqlalchemy) is never imported or defined in the file. This results in a NameError crash every time these tasks are invoked.

How to reproduce:

  1. Clone the repository and install dependencies.
  2. Attempt to run or import augur.tasks.start_tasks.
  3. Invoke the retry_errored_repos function.
  4. The task will crash immediately with NameError.
  5. Expected behavior: The functions should successfully create SQLAlchemy
    text
  6. objects using the s.sql.text syntax and execute the updates/queries against the database.

Screenshots N/A (Internal Logic Bug)

Log files

text
Traceback (most recent call last):
...
File "/.../augur/tasks/start_tasks.py", line 342, in retry_errored_repos
query = s.sql.text(f"""UPDATE collection_status ...""")
NameError: name 's' is not defined
Software versions:

Augur: 0.91.0
OS: Ubuntu 24.04.3 LTS
Browser: N/A

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