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

   ### Apache Airflow version
   
   Other Airflow 2 version (please specify below)
   
   ### If "Other Airflow 2 version" selected, which one?
   
   2.8.1
   
   ### What happened?
   
   I am encountering a problem when sometime on clicking the variable 
search/edit button it open a critical Error page "Ooops" and the error i can 
get in webserver logs "sqlalchemy.exc.PendingRollbackError: Can't reconnect 
until invalid transaction is rolled back. (Background on this error at: 
https://sqlalche.me/e/14/8s2b)" complete logs are mentioned below
   
   I am not able to see any lock transaction in database and unable to find the 
reason for this behaviour.
   
   `[2024-05-13T03:45:48.832+0000] {app.py:1744} ERROR - Exception on 
/variable/edit/57 [GET]
   Traceback (most recent call last):
     File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 2529, in 
wsgi_app
       response = self.full_dispatch_request()
     File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1825, in 
full_dispatch_request
       rv = self.handle_user_exception(e)
     File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1823, in 
full_dispatch_request
       rv = self.dispatch_request()
     File "/usr/local/lib/python3.9/site-packages/flask/app.py", line 1799, in 
dispatch_request
       return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
     File "/usr/local/lib/python3.9/site-packages/airflow/www/decorators.py", 
line 132, in wrapper
       return f(*args, **kwargs)
     File "/usr/local/lib/python3.9/site-packages/airflow/www/auth.py", line 
110, in wraps
       if permission_str in self.base_permissions and 
self.appbuilder.sm.has_access(
     File 
"/usr/local/lib/python3.9/site-packages/astronomer/flask_appbuilder/security.py",
 line 301, in has_access
       return super().has_access(action_name, resource_name,  *args, **kwargs)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/www/security_manager.py", line 
140, in has_access
       return is_authorized_method(action_name, resource_pk, user)
     File 
"/usr/local/lib/python3.9/site-packages/airflow/www/security_manager.py", line 
316, in <lambda>
       details=VariableDetails(key=get_variable_key(resource_pk)),
     File 
"/usr/local/lib/python3.9/site-packages/airflow/www/security_manager.py", line 
225, in get_variable_key
       variable = session.scalar(select(Variable).where(Variable.id == 
resource_pk).limit(1))
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", 
line 1747, in scalar
       return self.execute(
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/orm/session.py", 
line 1717, in execute
       result = conn._execute_20(statement, params or {}, execution_options)
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 1710, in _execute_20
       return meth(self, args_10style, kwargs_10style, execution_options)
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/sql/elements.py", 
line 334, in _execute_on_connection
       return connection._execute_clauseelement(
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 1577, in _execute_clauseelement
       ret = self._execute_context(
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 1808, in _execute_context
       conn = self._revalidate_connection()
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 650, in _revalidate_connection
       self._invalid_transaction()
     File "/usr/local/lib/python3.9/site-packages/sqlalchemy/engine/base.py", 
line 622, in _invalid_transaction
       raise exc.PendingRollbackError(
   sqlalchemy.exc.PendingRollbackError: Can't reconnect until invalid 
transaction is rolled back. (Background on this error at: 
https://sqlalche.me/e/14/8s2b)
   `
   
   ### What you think should happen instead?
   
   it should allow to either view and edit the variable
   
   ### How to reproduce
   
   I am not sure as this happen sometime but not very frequent
   
   ### Operating System
   
   PRETTY_NAME="Debian GNU/Linux 11 (bullseye)" NAME="Debian GNU/Linux" 
VERSION_ID="11" VERSION="11 (bullseye)" VERSION_CODENAME=bullseye ID=debian
   
   ### Versions of Apache Airflow Providers
   
   apache-airflow-providers-apache-hdfs==3.2.1
   apache-airflow-providers-apache-hive
   apache-airflow-providers-apache-spark
   apache-airflow-providers-jdbc
   apache-airflow-providers-sftp
   apache-airflow-providers-ssh
   apache-airflow-providers-hashicorp
   
   ### Deployment
   
   Docker-Compose
   
   ### 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: commits-unsubscr...@airflow.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to