Skip to content

Airflow Stable REST API /api/v1/pools returns 500 when pool has infinite slots (open_slots = inf) #65377

@shan-zeeshan786

Description

@shan-zeeshan786

Under which category would you file this issue?

Airflow Core

Apache Airflow version

2.11.0

What happened and how to reproduce it?

When calling the Airflow Stable REST API endpoint /api/v1/pools, the API returns a 500 Internal Server Error if any pool has infinite slots configured (represented internally as inf).

Steps to Reproduce:

  1. Create or configure an Airflow pool with infinite slots / unlimited slots.
  2. Call the Stable REST API endpoint:
    Request:
    curl -X GET "http://< -airflow-webserver- >/api/v1/pools?offset=0&limit=100"
    -H "accept: application/json"
    -H "Authorization: Basic "

Response:
{
"detail": "inf is not of type 'integer'\n\nFailed validating 'type' in schema['allof'][0]['properties']['pools']['items']['properties']['open_slots']:\n{'type':'integer', \n 'readonly' :True, \n 'description':'The number of free slots at the moment.')\n\nOn instance['pool'][0]['open_slot']:\n inf",
"status": 500,
"title": "Response body does not conform to specification",
"type": "https://airflow.apache.org/docs/apache-airflow/2.11.0/stable-rest-api-ref.html#section/Errors/Unknown"
}

What you think should happen instead?

The /api/v1/pools endpoint should return a valid successful response even when a pool has infinite/unlimited slots configured.
Currently, the API breaks because the serialized response does not conform to its own schema definition.

Operating System

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)" NAME="Debian GNU/Linux" VERSION_ID="12" VERSION="12 (bookworm)" VERSION_CODENAME=bookworm ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

Deployment

Official Apache Airflow Helm Chart

Apache Airflow Provider(s)

No response

Versions of Apache Airflow Providers

No response

Official Helm Chart version

Not Applicable

Kubernetes Version

Not Applicable

Helm Chart configuration

Not Applicable

Docker Image customizations

Not Applicable

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:APIAirflow's REST/HTTP APIarea:corekind:bugThis is a clearly a bugpriority:lowBug with a simple workaround that would not block a release

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions