Skip to content

ValueError: not enough values to unpack (expected 2, got 1) #697

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Stephane-Ag opened this issue Apr 4, 2025 · 1 comment · May be fixed by #700
Open

ValueError: not enough values to unpack (expected 2, got 1) #697

Stephane-Ag opened this issue Apr 4, 2025 · 1 comment · May be fixed by #700

Comments

@Stephane-Ag
Copy link

Stephane-Ag commented Apr 4, 2025

I keep getting this error when trying to view active jobs when there's at least 1 active job.

It's being caused by this function:

def get_executions(queue, composite_keys: List[str]) -> List[Execution]:
    """Fetch executions in bulk from Redis.
    1. If execution data is not present in Redis, discard the result
    """
    executions = []
    for key in composite_keys:
        job_id, id = key.split(':')
        try:
            executions.append(Execution.fetch(id=id, job_id=job_id, connection=queue.connection))
        except ValueError:
            pass
    return executions

Why is a colon expected to be in the job_id?

I tried adding one to bypass this error but rq explicitly doesn't allow this either and errors out with: ValueError: id must not contain ":"

get_executions seems to have been added in django-rq v3.0 for rq v2.0 but rq v2.0.1 added the no-colon requirement.

How can I solve this?

@Stephane-Ag
Copy link
Author

It looks like rq changed how the job_ids are parsed for the StartedJobRegistry in v2.2.
Downgrading rq to v2.1.0 currently fixes this issue for me.

terencehonles added a commit to terencehonles/django-rq that referenced this issue Apr 19, 2025
This change uses the new ``registry.get_job_and_execution_ids`` instead
of the updated ``registry.get_job_id`` which no longer returns the
execution id.

fixes: rq#697
terencehonles added a commit to terencehonles/django-rq that referenced this issue Apr 19, 2025
This change uses the new ``registry.get_job_and_execution_ids`` instead
of the updated ``registry.get_job_id`` which no longer returns the
execution id.

fixes: rq#697
terencehonles added a commit to terencehonles/django-rq that referenced this issue Apr 19, 2025
This change uses the new ``registry.get_job_and_execution_ids`` instead
of the updated ``registry.get_job_id`` which no longer returns the
execution id.

fixes: rq#697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant