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

   ### Apache Airflow version
   
   main (development)
   
   ### If "Other Airflow 3 version" selected, which one?
   
   _No response_
   
   ### What happened?
   
   Getting Internal server error when trying to access existing connections 
after migration from 2.11.1
   
   ```
   INFO:     192.168.97.1:49716 - "GET 
/api/v2/connections?limit=50&offset=0&order_by=connection_id HTTP/1.1" 500 
Internal Server Error
   ERROR:    Exception in ASGI application
   Traceback (most recent call last):
     File 
"/usr/python/lib/python3.10/site-packages/uvicorn/protocols/http/httptools_impl.py",
 line 416, in run_asgi
       result = await app(  # type: ignore[func-returns-value]
     File "/usr/python/lib/python3.10/site-packages/fastapi/applications.py", 
line 1160, in __call__
       await super().__call__(scope, receive, send)
     File "/usr/python/lib/python3.10/site-packages/starlette/applications.py", 
line 107, in __call__
       await self.middleware_stack(scope, receive, send)
     File 
"/usr/python/lib/python3.10/site-packages/starlette/middleware/errors.py", line 
186, in __call__
       raise exc
     File 
"/usr/python/lib/python3.10/site-packages/starlette/middleware/errors.py", line 
164, in __call__
       await self.app(scope, receive, _send)
     File 
"/usr/python/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 
29, in __call__
       await responder(scope, receive, send)
     File 
"/usr/python/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 
130, in __call__
       await super().__call__(scope, receive, send)
     File 
"/usr/python/lib/python3.10/site-packages/starlette/middleware/gzip.py", line 
46, in __call__
       await self.app(scope, receive, self.send_with_compression)
     File 
"/usr/python/lib/python3.10/site-packages/starlette/middleware/base.py", line 
191, in __call__
       with recv_stream, send_stream, collapse_excgroups():
     File "/usr/python/lib/python3.10/contextlib.py", line 153, in __exit__
       self.gen.throw(typ, value, traceback)
     File "/usr/python/lib/python3.10/site-packages/starlette/_utils.py", line 
87, in collapse_excgroups
       raise exc
     File 
"/usr/python/lib/python3.10/site-packages/starlette/middleware/base.py", line 
193, 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 61, in dispatch
       response = await call_next(request)
     File 
"/usr/python/lib/python3.10/site-packages/starlette/middleware/base.py", line 
168, in call_next
       raise app_exc from app_exc.__cause__ or app_exc.__context__
     File 
"/usr/python/lib/python3.10/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.10/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.10/site-packages/starlette/_exception_handler.py", 
line 53, in wrapped_app
       raise exc
     File 
"/usr/python/lib/python3.10/site-packages/starlette/_exception_handler.py", 
line 42, in wrapped_app
       await app(scope, receive, sender)
     File 
"/usr/python/lib/python3.10/site-packages/fastapi/middleware/asyncexitstack.py",
 line 18, in __call__
       await self.app(scope, receive, send)
     File "/usr/python/lib/python3.10/site-packages/starlette/routing.py", line 
716, in __call__
       await self.middleware_stack(scope, receive, send)
     File "/usr/python/lib/python3.10/site-packages/starlette/routing.py", line 
736, in app
       await route.handle(scope, receive, send)
     File "/usr/python/lib/python3.10/site-packages/starlette/routing.py", line 
290, in handle
       await self.app(scope, receive, send)
     File "/usr/python/lib/python3.10/site-packages/fastapi/routing.py", line 
130, in app
       await wrap_app_handling_exceptions(app, request)(scope, receive, send)
     File 
"/usr/python/lib/python3.10/site-packages/starlette/_exception_handler.py", 
line 53, in wrapped_app
       raise exc
     File 
"/usr/python/lib/python3.10/site-packages/starlette/_exception_handler.py", 
line 42, in wrapped_app
       await app(scope, receive, sender)
     File "/usr/python/lib/python3.10/site-packages/fastapi/routing.py", line 
116, in app
       response = await f(request)
     File "/usr/python/lib/python3.10/site-packages/fastapi/routing.py", line 
691, in app
       content = await serialize_response(
     File "/usr/python/lib/python3.10/site-packages/fastapi/routing.py", line 
302, in serialize_response
       return serializer(
     File "/usr/python/lib/python3.10/site-packages/fastapi/_compat/v2.py", 
line 218, in serialize_json
       return self._type_adapter.dump_json(
     File "/usr/python/lib/python3.10/site-packages/pydantic/type_adapter.py", 
line 672, in dump_json
       return self.serializer.to_json(
   pydantic_core._pydantic_core.PydanticSerializationError: Error serializing 
to JSON: InvalidToken:
   ^B[g
   ```
   
   
   ### What you think should happen instead?
   
   _No response_
   
   ### How to reproduce
   
   1. Run airflow 2 instance with command `breeze start-airflow --executor 
CeleryExecutor --backend postgres --load-example-dags --use-airflow-version 
2.11.1`
   2. Create some connections from airflow UI
   3. perform stop_airflow in one of tmux session
   4. `breeze start-airflow --executor CeleryExecutor --backend postgres 
--load-example-dags `
   5. Try to access connections from airflow UI
   
   ### Operating System
   
   OS
   
   ### Versions of Apache Airflow Providers
   
   _No response_
   
   ### Deployment
   
   Official Apache Airflow Helm Chart
   
   ### Deployment details
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### 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