Skip to content

endpoints: fix MultipleObjectsReturned - #26971

Merged
BeryJu merged 1 commit into
mainfrom
endpoints/re-fix-multipleobjectsreturned
Oct 16, 2026
Merged

BeryJu merged 1 commit into
mainfrom
endpoints/re-fix-multipleobjectsreturned

Conversation

@BeryJu

@BeryJu BeryJu commented Oct 16, 2026

Copy link
Copy Markdown
Member

No description provided.

@BeryJu BeryJu added the backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 label Oct 16, 2026
@BeryJu
BeryJu requested a review from a team as a code owner October 16, 2026 11:49
@netlify

netlify Bot commented Oct 16, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 939f7ae
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6ad20f477e30da6f8cfdda03
😎 Deploy Preview https://deploy-preview-26971--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
4722 1 4721 14
View the top 1 failed test(s) by shortest run time
tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic::test_oidcc_basic_certification_test
Stack Traces | 160s run time
self = <unittest.case._Outcome object at 0x7b6a46086f90>
test_case = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>
subTest = False

    @contextlib.contextmanager
    def testPartExecutor(self, test_case, subTest=False):
        old_success = self.success
        self.success = True
        try:
>           yield

.../hostedtoolcache/Python/3.14.8........./x64/lib/python3.14/unittest/case.py:58: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>
result = <TestCaseFunction test_oidcc_basic_certification_test>

    def run(self, result=None):
        if result is None:
            result = self.defaultTestResult()
            startTestRun = getattr(result, 'startTestRun', None)
            stopTestRun = getattr(result, 'stopTestRun', None)
            if startTestRun is not None:
                startTestRun()
        else:
            stopTestRun = None
    
        result.startTest(self)
        try:
            testMethod = getattr(self, self._testMethodName)
            if (getattr(self.__class__, "__unittest_skip__", False) or
                getattr(testMethod, "__unittest_skip__", False)):
                # If the class or method was skipped.
                skip_why = (getattr(self.__class__, '__unittest_skip_why__', '')
                            or getattr(testMethod, '__unittest_skip_why__', ''))
                _addSkip(result, self, skip_why)
                return result
    
            expecting_failure = (
                getattr(self, "__unittest_expecting_failure__", False) or
                getattr(testMethod, "__unittest_expecting_failure__", False)
            )
            outcome = _Outcome(result)
            start_time = time.perf_counter()
            try:
                self._outcome = outcome
    
                with outcome.testPartExecutor(self):
                    self._callSetUp()
                if outcome.success:
                    outcome.expecting_failure = expecting_failure
                    with outcome.testPartExecutor(self):
>                       self._callTestMethod(testMethod)

.../hostedtoolcache/Python/3.14.8........./x64/lib/python3.14/unittest/case.py:669: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>
method = <bound method TestOpenIDConformanceBasic.test_oidcc_basic_certification_test of <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>>

    def _callTestMethod(self, method):
>       result = method()
                 ^^^^^^^^

.../hostedtoolcache/Python/3.14.8........./x64/lib/python3.14/unittest/case.py:615: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>
args = (), kwargs = {}

    @wraps(func)
    def wrapper(self: TransactionTestCase, *args, **kwargs):
        """Run test again if we're below max_retries, including tearDown and
        setUp. Otherwise raise the error"""
        nonlocal count
        try:
>           return func(self, *args, **kwargs)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/decorators.py:60: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>

    @retry()
    def test_oidcc_basic_certification_test(self):
>       self.run_test(
            "oidcc-basic-certification-test-plan",
            self.test_plan_config,
            {
                "server_metadata": "discovery",
                "client_registration": "static_client",
            },
        )

tests/openid_conformance/test_oidc_basic.py:9: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>
test_name = 'oidcc-basic-certification-test-plan'
test_plan_config = {'alias': 'authentik', 'description': 'authentik', 'server': {'discoveryUrl': 'https://10.1.0.243:.../application/o/...86b5389d15b173109a0555dc47e0cc0949104f1925bcc6565351cb1dffd7e6818cf074f5bd50c210b565121a7328ee8bd40107fc4bbd867'}, ...}
test_variant = {'server_metadata': 'discovery', 'client_registration': 'static_client'}

    def run_test(
        self,
        test_name: str,
        test_plan_config: dict[str, Any],
        test_variant: dict[str, Any] | None = None,
    ):
        self.conformance = Conformance(f"https://{self.host}:8443", None, verify_ssl=False)
    
        test_plan = self.conformance.create_test_plan(
            test_name,
            test_plan_config,
            test_variant,
        )
        plan_id = test_plan["id"]
        for test in test_plan["modules"]:
            # Fetch name and variant of the next test to run
            module_name = test["testModule"]
            variant = test["variant"]
            module_instance = self.conformance.create_test_from_plan_with_variant(
                plan_id, module_name, variant
            )
            module_id = module_instance["id"]
>           self.run_single_test(module_id)

tests/openid_conformance/base.py:87: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>
module_id = 'WQ2Ygf3S194mkFN'

    def run_single_test(self, module_id: str):
        """Process instructions for a single test, navigate to browser URLs and take screenshots"""
        tested_browser_url = 0
        uploaded_image = 0
        cleared_cookies = False
        while True:
            # Fetch all info
            test_status = self.conformance.get_test_status(module_id)
            test_log = self.conformance.get_test_log(module_id)
            test_info = self.conformance.get_module_info(module_id)
            # Check status early, if we're finished already we don't want to do anything extra
            if test_info["status"] in ["INTERRUPTED", "FINISHED"]:
                return
            # Check if we need to clear cookies - tests only indicates this in their written summary
            # so this check is a bit brittle
            if "cookies" in test_info["summary"] and not cleared_cookies:
                # Navigate to our origin to delete cookies in the right context
                self.driver.get(self.url("authentik_api:user-me") + "?format=json")
                self.driver.delete_all_cookies()
                cleared_cookies = True
            # Check if we need deal with any browser URLs
            browser_urls = test_status.get("browser", {}).get("urls", [])
            if len(browser_urls) > tested_browser_url:
>               self.do_browser(browser_urls[tested_browser_url])

tests/openid_conformance/base.py:122: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>
url = 'https://10.1.0.243:.../application/o/authorize/?client_id=4054d882aff59755f2f279968b97ce8806a926e1&nonce=Otomsx3kqb...t=login&redirect_uri=https://localhost:.../a/authentik/callback&response_type=code&scope=openid&state=xi6eZgBk2U'

    def do_browser(self, url):
        """For any specific OpenID Conformance test, execute the operations required"""
        self.driver.get(url)
        should_expect_completion = False
        if "if/flow/default-authentication-flow" in self.driver.current_url:
            self.logger.debug("Logging in")
            skipped = []
            if "login_hint" in self.driver.current_url:
                skipped.append("ak-stage-identification")
>           self.login(skip_stages=skipped)

tests/openid_conformance/base.py:153: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>
shadow_dom = True, skip_stages = []

    def login(self, shadow_dom=True, skip_stages: list[str] | None = None):
        """Perform the entire authentik login flow."""
        skip_stages = skip_stages or []
    
        if "ak-stage-identification" not in skip_stages:
            if shadow_dom:
>               flow_executor = self.get_shadow_root("ak-flow-executor")
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

tests/selenium.py:293: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tests.openid_conformance.test_oidc_basic.TestOpenIDConformanceBasic testMethod=test_oidcc_basic_certification_test>
selector = 'ak-flow-executor'
container = <selenium.webdriver.remote.webdriver.WebDriver (session="bf119e5f0c9a3d2d7dfb9c0945ca8510")>
timeout = 10

    def get_shadow_root(
        self, selector: str, container: WebElement | WebDriver | None = None, timeout: float = 10
    ) -> WebElement:
        """Get the shadow root of a web component specified by `selector`."""
        if not container:
            container = self.driver
        wait = WebDriverWait(container, timeout)
        host: WebElement | None = None
    
        try:
            host = wait.until(lambda c: c.find_element(By.CSS_SELECTOR, selector))
        except TimeoutException:
            self.fail(f"Timed out waiting for shadow host {selector} to appear")
    
        attempts = 0
    
        while attempts < SHADOW_ROOT_RETRIES:
            try:
                host = container.find_element(By.CSS_SELECTOR, selector)
                return host.shadow_root
            except (
                NoSuchElementException,
                NoSuchShadowRootException,
                DetachedShadowRootException,
                StaleElementReferenceException,
            ):
                attempts += 1
                sleep(0.2)
    
        inner_html = "<no host>"
        if host is not None:
            try:
                inner_html = host.get_attribute("innerHTML") or "<no host>"
            except DetachedShadowRootException, StaleElementReferenceException:
                inner_html = "<stale host>"
    
>       raise RuntimeError(
            f"Failed to obtain shadow root for {selector} after {attempts} attempts. "
            f"Host innerHTML: {inner_html}"
        )
E       RuntimeError: Failed to obtain shadow root for ak-flow-executor after 5 attempts. Host innerHTML: 
E               
E       
E       <div class="ak-c-placeholder" id="ak-placeholder" slot="placeholder">
E           <span class="pf-c-spinner" role="progressbar" aria-valuetext="Loading...">
E               <span class="pf-c-spinner__clipper"></span>
E               <span class="pf-c-spinner__lead-ball"></span>
E               <span class="pf-c-spinner__tail-ball"></span>
E           </span>
E       </div>
E       
E               
E               <ak-brand-links name="flow-links" slot="footer"></ak-brand-links>

tests/selenium.py:270: RuntimeError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Playwright e2e

Download this run's HTML report and traces, then open the report:

gh run download 38896330989 -D playwright-artifacts
npx playwright show-report playwright-artifacts/playwright-report

Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-939f7ae59474649a38d1434d95ef8cada8394d56
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-939f7ae59474649a38d1434d95ef8cada8394d56

Afterwards, run the upgrade commands from the latest release notes.

@BeryJu
BeryJu merged commit bdf63e1 into main Oct 16, 2026
145 of 147 checks passed
@BeryJu
BeryJu deleted the endpoints/re-fix-multipleobjectsreturned branch October 16, 2026 12:58
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

🍒 Cherry-pick to version-2026.8 created: #26972

BeryJu added a commit that referenced this pull request Oct 16, 2026
…-2026.8) (#26972)

endpoints: fix MultipleObjectsReturned (#26971)

Signed-off-by: Jens Langhammer <[email protected]>
Co-authored-by: Jens L. <[email protected]>
kensternberg-authentik added a commit that referenced this pull request Oct 19, 2026
* main: (101 commits)
  ci: exclude node_modules from Go lint (#26961)
  website/integrations: ch-ui: document the email_verified requirement (#26978)
  website/docs: add expression policy for case-insensitive unique usernames (#26974)
  core: prefetch token owners and memberships (#25803)
  website/integrations: add detailed explanation for setting GH Org limit (#8604)
  website/integrations: add opensearch (#26938)
  endpoints: fix MultipleObjectsReturned (#26971)
  core, web: update translations (#26963)
  website/docs: single-logout: add information around proxy providers for single logout (#26563)
  common/saml: move exceptions and logout request parser to common (#26533)
  stages/authenticator_webauthn: accept ML-DSA credentials (#26381)
  crypto: add ML-DSA certificate generation (#26380)
  website/integrations: add ch-ui (#26935)
  website/integrations: add kibana (#26936)
  core: bump pydantic from 2.13.5 to 2.14.0 (#26969)
  core: bump rust-toolchain from 1.99.0 to 1.99.1 (#26967)
  core: bump aws-cdk-lib from 2.272.0 to 2.273.0 (#26968)
  core: bump github.com/prometheus/client_golang from 1.24.1 to 1.25.0 (#26965)
  core: bump github.com/getsentry/sentry-go from 0.49.0 to 0.50.0 (#26966)
  web/admin: version banner (#26948)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant