gudata opened a new issue, #54836:
URL: https://github.com/apache/airflow/issues/54836

   ### Apache Airflow version
   
   3.0.5
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I have upgraded airflow from 3.0.4 to 3.0.5 and the dags are gone with:
   
   ```
   "Objects of type {type(obj)} are not supported"
   
   Traceback (most recent call last):
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/comms.py",
 line 145, in as_bytes
       self.req_encoder.encode_into(self, buffer, 4)
     File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/comms.py",
 line 122, in _msgpack_enc_hook
       raise NotImplementedError(f"Objects of type {type(obj)} are not 
supported")
   NotImplementedError: Objects of type <class 
'pydantic_core._pydantic_core.SerializationIterator'> are not supported
   ```
   
   The airflow dag-processor  said more:
   
   ```
   {"timestamp":"2025-08-22T16:05:49.980648","level":"error","event":"Failed to 
import: 
/opt/airflow/dags/services/generate_dags_dag.py","logger":"airflow.models.dagbag.DagBag","error_detail":[{"exc_type":"NotImplementedError","exc_value":"Objects
 of type <class 'pydantic_core._pydantic_core.SerializationIterator'> are not 
supported","exc_notes":[],"syntax_error":null,"is_cause":false,"frames":[{"filename":"/home/airflow/.local/lib/python3.12/site-packages/airflow/models/dagbag.py","lineno":394,"name":"parse"},{"filename":"<frozen
 
importlib._bootstrap_external>","lineno":999,"name":"exec_module"},{"filename":"<frozen
 
importlib._bootstrap>","lineno":488,"name":"_call_with_frames_removed"},{"filename":"/opt/airflow/dags/services/generate_dags_dag.py","lineno":57,"name":"<module>"},{"filename":"/opt/airflow/dags/include/my_company/insights/dag_particles.py","lineno":287,"name":"generate_dags_task"},{"filename":"/opt/airflow/dags/include/my_company/insights/client_config/base.py","lineno
 
":446,"name":"generate_dags_environment_variables"},{"filename":"/opt/airflow/dags/include/my_company/insights/client_config/base.py","lineno":215,"name":"database_migration_snowflake_connection"},{"filename":"/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/definitions/connection.py","lineno":162,"name":"extra_dejson"},{"filename":"/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/secrets_masker.py","lineno":130,"name":"mask_secret"},{"filename":"/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/comms.py","lineno":187,"name":"send"},{"filename":"/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/comms.py","lineno":145,"name":"as_bytes"},{"filename":"/home/airflow/.local/lib/python3.12/site-packages/airflow/sdk/execution_time/comms.py","lineno":122,"name":"_msgpack_enc_hook"}],"is_group":false,"exceptions":[]}]}
   ```
   
   
   ### What you think should happen instead?
   
   Dags running on 3.0.4 should work on 3.0.5
   
   ### How to reproduce
   
   
   
   Here is the problematic line
   ```
   role=self.airflow_database_migration_snowflake_connection.extra_dejson[  
                   "role"   <<<<< line 216
               ]
   ```
   
   ### Operating System
   
   PRETTY_NAME="Amazon Linux 2023.7.20250623"
   
   ### Versions of Apache Airflow Providers
   
   the one which came withe airflow in docker
   
   ### Deployment
   
   Docker-Compose
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   Chat GPT explain the error 
   
   ```
   Why this error appeared after those fixes
   
   Before, Airflow was passing around “simple” Python types when masking 
secrets (strings, dicts).
   
   After #54574 / #54612, Airflow started running Pydantic 
validation/serialization when building masked connection objects.
   
   That introduced SerializationIterator objects into the data path.
   
   But the comms layer (msgpack encoding in comms.py) doesn’t know how to 
serialize that object type → hence:
   
   NotImplementedError: Objects of type <class 
'pydantic_core._pydantic_core.SerializationIterator'> are not supported
   
   
   So the regression is that secrets masking now returns Pydantic internals, 
which comms can’t encode.
   
   ```
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to