Skip to content

Conversation

@dheerajturaga
Copy link
Member

@dheerajturaga dheerajturaga commented Oct 18, 2025

The API endpoint for DAG details was returning only resolved parameter
values instead of the full parameter schema, causing a "Cannot read
properties of undefined (reading section)" error in the UI when
triggering DAGs with parameters.

This was a regression introduced in commit #55111 which changed
v.dump() to v.resolve() in the params serialization.

Changes:

  • Add serialize() method to SerializedParam to return the full parameter structure (value, description, schema)
  • Update API field validator to use serialize() instead of resolve()
  • Update tests to expect the correct parameter format

The API now returns params in the format expected by the frontend:
{"param_name": {"value": , "description": , "schema": {...}}}

Error when you hit trigger on dag run page:

image

cc: @kaxil

@dheerajturaga
Copy link
Member Author

the simple auth manager change is from prek hook generate-openapi-spec

  The API endpoint for DAG details was returning only resolved parameter
  values instead of the full parameter schema, causing a "Cannot read
  properties of undefined (reading section)" error in the UI when
  triggering DAGs with parameters.

  This was a regression introduced in commit 5d58c04 which changed
  `v.dump()` to `v.resolve()` in the params serialization.

  Changes:
  - Add `serialize()` method to `SerializedParam` to return the full
    parameter structure (value, description, schema)
  - Update API field validator to use `serialize()` instead of `resolve()`
  - Update tests to expect the correct parameter format

  The API now returns params in the format expected by the frontend:
  {"param_name": {"value": <val>, "description": <desc>, "schema": {...}}}
@dheerajturaga dheerajturaga force-pushed the bugfix/fix-trigger-params-api-schema branch from 6a5c568 to 173f4a4 Compare October 19, 2025 00:15
@rawwar
Copy link
Contributor

rawwar commented Oct 19, 2025

PR to fix this was already raised - #56831

@jscheffl
Copy link
Contributor

I'd also favor #56831 over this one because it is a bit more complete (includes task and not only dag) and was earlier.

Nevertheless still both do not full fix the problem. The Dag "Params Trigger UI" is repaired but still Dag "Params UI tutorial" raises an error and form is empty:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/python/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 409, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/python/lib/python3.12/site-packages/fastapi/applications.py", line 1082, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 29, in __call__
    await responder(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 130, in __call__
    await super().__call__(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/gzip.py", line 46, in __call__
    await self.app(scope, receive, self.send_with_compression)
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
    await self.app(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/base.py", line 182, in __call__
    with recv_stream, send_stream, collapse_excgroups():
                                   ^^^^^^^^^^^^^^^^^^^^
  File "/usr/python/lib/python3.12/contextlib.py", line 158, in __exit__
    self.gen.throw(value)
  File "/usr/python/lib/python3.12/site-packages/starlette/_utils.py", line 85, in collapse_excgroups
    raise exc
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/base.py", line 184, in __call__
    response = await self.dispatch_func(request, call_next)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/airflow/airflow-core/src/airflow/api_fastapi/auth/middlewares/refresh_token.py", line 49, in dispatch
    response = await call_next(request)
               ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/base.py", line 159, in call_next
    raise app_exc
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/base.py", line 144, in coro
    await self.app(scope, receive_or_disconnect, send_no_error)
  File "/usr/python/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 63, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/usr/python/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/python/lib/python3.12/site-packages/starlette/routing.py", line 716, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/routing.py", line 736, in app
    await route.handle(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/routing.py", line 290, in handle
    await self.app(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/routing.py", line 78, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/usr/python/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    raise exc
  File "/usr/python/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/usr/python/lib/python3.12/site-packages/starlette/routing.py", line 75, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/usr/python/lib/python3.12/site-packages/fastapi/routing.py", line 334, in app
    content = await serialize_response(
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/python/lib/python3.12/site-packages/fastapi/routing.py", line 188, in serialize_response
    return field.serialize(
           ^^^^^^^^^^^^^^^^
  File "/usr/python/lib/python3.12/site-packages/fastapi/_compat.py", line 152, in serialize
    return self._type_adapter.dump_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/python/lib/python3.12/site-packages/pydantic/type_adapter.py", line 605, in dump_python
    return self.serializer.to_python(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
pydantic_core._pydantic_core.PydanticSerializationError: Unable to serialize unknown type: <class 'airflow.sdk.definitions._internal.types.ArgNotSet'>

@jscheffl jscheffl added this to the Airflow 3.1.1 milestone Oct 19, 2025
@kaxil kaxil modified the milestones: Airflow 3.1.1, Airflow 3.2.0 Oct 19, 2025
@dheerajturaga
Copy link
Member Author

Closing this in favor of #56831

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:API Airflow's REST/HTTP API area:dev-tools area:serialization backport-to-v3-1-test Mark PR with this label to backport to v3-1-test branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants