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

   ### Apache Airflow version
   
   3.0.2
   
   ### If "Other Airflow 2 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   I'm trying to view connections by navigating to the Connections page on the 
Airflow 3 UI, and I saw the following errors from the API server. It is a 
Pydantic error trying to validate the ConnectionCollectionResponse object.
   
   However I can't figure out where the "Invalid Token" attribute comes from. 
   
   For reference here's the backend config. 
   
   ```
   backend = 
airflow.providers.amazon.aws.secrets.secrets_manager.SecretsManagerBackend      
                                                                                
                                        
   backend_kwargs = {"connections_prefix": "<redacted>", "variables_prefix": 
"<redacted>", "config_prefix": "<redacted>"}
   ```
   
   ```
   ERROR:    Exception in ASGI application                                      
                                                                                
                                                     │
   │   + Exception Group Traceback (most recent call last):                     
                                                                                
                                                       │
   │   |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/_utils.py", line 
76, in collapse_excgroups                                                       
                                         │
   │   |     yield                                                              
                                                                                
                                                       │
   │   |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/base.py",
 line 177, in __call__                                                          
                                      │
   │   |     async with anyio.create_task_group() as task_group:                
                                                                                
                                                       │
   │   |                ^^^^^^^^^^^^^^^^^^^^^^^^^                               
                                                                                
                                                       │
   │   |   File 
"/home/airflow/.local/lib/python3.12/site-packages/anyio/_backends/_asyncio.py",
 line 772, in __aexit__                                                         
                                       │
   │   |     raise BaseExceptionGroup(                                          
                                                                                
                                                       │
   │   | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)      
                                                                                
                                                       │
   │   +-+---------------- 1 ----------------                                   
                                                                                
                                                       │
   │     | Traceback (most recent call last):                                   
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/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 
"/home/airflow/.local/lib/python3.12/site-packages/fastapi/applications.py", 
line 1054, in __call__                                                          
                                        │
   │     |     await super().__call__(scope, receive, send)                     
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/applications.py", 
line 112, in __call__                                                           
                                      │
   │     |     await self.middleware_stack(scope, receive, send)                
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/errors.py",
 line 187, in __call__                                                          
                                  │
   │     |     raise exc                                                        
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/errors.py",
 line 165, in __call__                                                          
                                  │
   │     |     await self.app(scope, receive, _send)                            
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/gzip.py",
 line 29, in __call__                                                           
                                    │
   │     |     await responder(scope, receive, send)                            
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/gzip.py",
 line 126, in __call__                                                          
                                    │
   │     |     await super().__call__(scope, receive, send)                     
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/gzip.py",
 line 46, in __call__                                                           
                                    │
   │     |     await self.app(scope, receive, self.send_with_compression)       
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/cors.py",
 line 85, in __call__                                                           
                                    │
   │     |     await self.app(scope, receive, send)                             
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/base.py",
 line 176, in __call__                                                          
                                    │
   │     |     with recv_stream, send_stream, collapse_excgroups():             
                                                                                
                                                       │
   │     |                                    ^^^^^^^^^^^^^^^^^^^^              
                                                                                
                                                       │
   │     |   File "/usr/local/lib/python3.12/contextlib.py", line 158, in 
__exit__                                                                        
                                                             │
   │     |     self.gen.throw(value)                                            
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/_utils.py", line 
82, in collapse_excgroups                                                       
                                       │
   │     |     raise exc                                                        
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/base.py",
 line 178, in __call__                                                          
                                    │
   │     |     response = await self.dispatch_func(request, call_next)          
                                                                                
                                                       │
   │     |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^          
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/api_fastapi/core_api/middleware.py",
 line 28, in dispatch                                                           
                      │
   │     |     response = await call_next(request)                              
                                                                                
                                                       │
   │     |                ^^^^^^^^^^^^^^^^^^^^^^^^                              
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/base.py",
 line 156, in call_next                                                         
                                    │
   │     |     raise app_exc                                                    
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/starlette/middleware/base.py",
 line 141, in coro                                                              
                                    │
   │     |     await self.app(scope, receive_or_disconnect, send_no_error)      
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/airflow/api_fastapi/core_api/routes/public/connections.py",
 line 135, in get_connections                                                   
       │
   │     |     return ConnectionCollectionResponse(                             
                                                                                
                                                       │
   │     |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                             
                                                                                
                                                       │
   │     |   File 
"/home/airflow/.local/lib/python3.12/site-packages/pydantic/main.py", line 253, 
in __init__                                                                     
                                     │
   │     |     validated_self = 
self.__pydantic_validator__.validate_python(data, self_instance=self)           
                                                                                
                       │
   │     |                      
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^           
                                                                                
                       │
   │     | pydantic_core._pydantic_core.ValidationError: 1 validation error for 
ConnectionCollectionResponse                                                    
                                                       │
   │     | connections.0.extra                                                  
                                                                                
                                                       │
   │     |   Error extracting attribute: InvalidToken 
[type=get_attribute_error, input_value=<unprintable Connection object>, 
input_type=Connection]                                                          
         │
   │     |     For further information visit 
https://errors.pydantic.dev/2.11/v/get_attribute_error                          
                                                                                
          │
   │     +------------------------------------
   ```
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   In our environment all you need to do to reproduce is to visit the 
Connections page. However I suspect this is related to the secret backends 
and/or the connections we have. So it is hard to know how to reproduce outside 
of this environment.
   
   ### Operating System
   
   Debian GNU/Linux 12 (bookworm)
   
   ### Versions of Apache Airflow Providers
   
   ```
   Apache Airflow
   version                | 3.0.1
   executor               | KubernetesExecutor
   task_logging_handler   | airflow.utils.log.file_task_handler.FileTaskHandler
   sql_alchemy_conn       | postgresql+psycopg2://<redacted>
   dags_folder            | /opt/airflow/dags/repo/<redacted>
   plugins_folder         | /opt/airflow/plugins
   base_log_folder        | /opt/airflow/logs
   remote_base_log_folder |
   
   
   System info
   OS              | Linux
   architecture    | x86_64
   uname           | uname_result(system='Linux', 
node='airflow-api-server-54758d696d-7vtp5', 
release='5.10.234-225.921.amzn2.x86_64', version='#1 SMP Tue Mar 25 21:34:29 
UTC 2025', machine='x86_64')
   locale          | ('C', 'UTF-8')
   python_version  | 3.12.10 (main, May  9 2025, 23:48:54) [GCC 12.2.0]
   python_location | /home/airflow/.local/bin/python
   
   
   Tools info
   git             | NOT AVAILABLE
   ssh             | OpenSSH_9.2p1 Debian-2+deb12u5, OpenSSL 3.0.15 3 Sep 2024
   kubectl         | NOT AVAILABLE
   gcloud          | NOT AVAILABLE
   cloud_sql_proxy | NOT AVAILABLE
   mysql           | mysql  Ver 15.1 Distrib 10.11.11-MariaDB, for 
debian-linux-gnu (x86_64) using  EditLine wrapper
   sqlite3         | 3.40.1 2022-12-28 14:03:47 
df5c253c0b3dd24916e4ec7cf77d3db5294cc9fd45ae7b9c5e82ad8197f3alt1
   psql            | psql (PostgreSQL) 17.5 (Debian 17.5-1.pgdg120+1)
   
   
   Paths info
   airflow_home    | /opt/airflow
   system_path     | <redacted>
   python_path     | <redacted>
   airflow_on_path | True
   
   
   Providers info
   apache-airflow-providers-amazon           | 9.7.0
   apache-airflow-providers-celery           | 3.10.6
   apache-airflow-providers-cncf-kubernetes  | 10.4.3
   apache-airflow-providers-common-compat    | 1.6.1
   apache-airflow-providers-common-io        | 1.5.4
   apache-airflow-providers-common-messaging | 1.0.1
   apache-airflow-providers-common-sql       | 1.27.0
   apache-airflow-providers-docker           | 4.3.1
   apache-airflow-providers-elasticsearch    | 6.2.2
   apache-airflow-providers-fab              | 2.0.2
   apache-airflow-providers-ftp              | 3.12.3
   apache-airflow-providers-git              | 0.0.2
   apache-airflow-providers-google           | 15.1.0
   apache-airflow-providers-grpc             | 3.7.3
   apache-airflow-providers-hashicorp        | 4.1.1
   apache-airflow-providers-http             | 5.2.2
   apache-airflow-providers-microsoft-azure  | 12.3.1
   apache-airflow-providers-mysql            | 6.2.2
   apache-airflow-providers-noetica          | 0.2.0
   apache-airflow-providers-odbc             | 4.9.2
   apache-airflow-providers-openlineage      | 2.2.0
   apache-airflow-providers-postgres         | 6.1.3
   apache-airflow-providers-redis            | 4.0.2
   apache-airflow-providers-sendgrid         | 4.0.1
   apache-airflow-providers-sftp             | 5.2.1
   apache-airflow-providers-slack            | 9.0.5
   apache-airflow-providers-smtp             | 2.0.3
   apache-airflow-providers-snowflake        | 6.3.0
   apache-airflow-providers-ssh              | 4.0.1
   apache-airflow-providers-standard         | 1.1.0
   ```
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [x] 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