Skip to content

Multi team: keycloak returns 400 error on /dags screen when teams are not defined in the keycloak client #68943

Closed

Description

@stephen-bracken

Under which category would you file this issue?

Providers

Apache Airflow version

3.2.1

What happened and how to reproduce it?

When dag bundles are assigned to teams that are not defined in the keycloak client resources keycloak returns a 400 response like the following:
{"error":"invalid_resource", "error_description": "Resource with id [Dag:team-a] does not exist."}
on the /dags and / (home) screens. This is because the auth manager sends a request to keycloak to verify access to each dag by checking the resources.

edit: corrected error response as detailled in #69028

What you think should happen instead?

The KeycloakAuthManager or BaseAuthManager should gracefully handle 400 errors from keycloak due to missing resources for teams, and log them. This is important because if a team is added to airflow but not keycloak, all other teams will lose access to the /dags screen due to the 500 error response.

Operating System

Debian GNU/Linux 12 (bookworm)

Deployment

Other Docker-based deployment

Apache Airflow Provider(s)

keycloak

Versions of Apache Airflow Providers

apache-airflow-providers-keycloak==0.7.1

Official Helm Chart version

Not Applicable

Kubernetes Version

1.33.5

Helm Chart configuration

No response

Docker Image customizations

Some additional pip / apt packages

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

  1. eladkal commented on Jun 25, 2026

    @eladkal
    Contributor
  2. onlyarnav commented on Jun 26, 2026

    @onlyarnav
    Member

    Hi, I have submitted a PR regarding the issue. Could you please verify if that fixes the issue and its good or it still required attention.

  3. eladkal commented on Jun 26, 2026

    @eladkal
    Contributor

    Solved in #68951

  4. stephen-bracken commented on Jun 26, 2026

    @stephen-bracken
    ContributorAuthor

    @onlyarnav thanks for working on this. I've raised #69028 to update the error message from keycloak

  5. changed the title [-]Multi team: keycloak returns 500 error on /dags screen when teams are not defined in the keycloak client[/-] [+]Multi team: keycloak returns 400 error on /dags screen when teams are not defined in the keycloak client[/+] on Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions