Skip to content

'GenericRelatedObjectManager' object is not iterable #19051

@krejcar25

Description

@krejcar25

Describe the bug

LDAP sync tasks fail with the above exception. Everything actually synchronises correctly, because Outgoing sync trigger mode is set to Deferred, and then the outgoing tasks fails last.

How to reproduce

  1. Trigger a source sync (LDAP in my case, but afaik this should impact all)
  2. Wait - user, group, and membership tasks succeed
  3. Outgoing fails, attempts retry

Expected behavior

Outgoing tasks start syncing.

Screenshots

No response

Additional context

I believe this could be a regression in #17669, specifically authentik/lib/sync/outgoing/models.py#L87. The ObjectManager is missing an all() call.

Deployment Method

Docker

Version

2025.12.0-rc2

Relevant log output

{
    "exception": [
        {
            "frames": [
                {
                    "name": "process_message",
                    "lineno": 487,
                    "filename": "/ak-root/.venv/lib/python3.13/site-packages/dramatiq/worker.py"
                },
                {
                    "name": "__call__",
                    "lineno": 185,
                    "filename": "/ak-root/.venv/lib/python3.13/site-packages/dramatiq/actor.py"
                },
                {
                    "name": "ldap_sync",
                    "lineno": 111,
                    "filename": "/authentik/sources/ldap/tasks.py"
                },
                {
                    "name": "sync_dispatch",
                    "lineno": 87,
                    "filename": "/authentik/lib/sync/outgoing/models.py"
                }
            ],
            "exc_type": "TypeError",
            "is_cause": false,
            "is_group": false,
            "exc_notes": [],
            "exc_value": "'GenericRelatedObjectManager' object is not iterable",
            "exceptions": [],
            "syntax_error": null
        }
    ]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAdd this label to issues that need to be triaged

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions