geobeyond / Arpav-PPCV-backend

Backend di Piattaforma Proiezioni Climatiche per il Nord-Est.
Creative Commons Attribution 4.0 International
0 stars 1 forks source link

system hangs #202

Closed ricardogsilva closed 2 months ago

ricardogsilva commented 2 months ago

Sometimes the system becomes unresponsive when visiting either:

Logs show something like this:

File "/home/appuser/app/arpav_ppcv/webapp/api_v2/routers/coverages.py", line 254, in wms_endpoint                                                                                                                  
    db_coverage_configuration = db.get_coverage_configuration_by_coverage_identifier(                                                                                                                                
  File "/home/appuser/app/arpav_ppcv/database.py", line 922, in get_coverage_configuration_by_coverage_identifier                                                                                                    
    return get_coverage_configuration_by_name(session, coverage_configuration_name)                                                                                                                                  
  File "/home/appuser/app/arpav_ppcv/database.py", line 908, in get_coverage_configuration_by_name                                                                                                                   
    return session.exec(                                                                                                                                                                                             
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlmodel/orm/session.py", line 68, in exec                                                         
    results = super().execute(                                                                                                                                                                                       
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2351, in execute                                                  
    return self._execute_internal(                                                                                                                                                                                   
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2226, in _execute_internal                                        
    conn = self._connection_for_bind(bind)                                                                                                                                                                           
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 2095, in _connection_for_bind                                     
    return trans._connection_for_bind(engine, execution_options)                                                                                                                                                     
  File "<string>", line 2, in _connection_for_bind                                                                                                                                                                   
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/state_changes.py", line 139, in _go                                                 
    ret_value = fn(self, *arg, **kw)                                                                                                                                                                                 
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/orm/session.py", line 1189, in _connection_for_bind                                     
    conn = bind.connect()                                                                                                                                                                                            
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3276, in connect                                                  
    return self._connection_cls(self)                                                                                                                                                                                
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 146, in __init__                                                  
    self._dbapi_connection = engine.raw_connection()                                                                                                                                                                 
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/engine/base.py", line 3300, in raw_connection                                           
    return self.pool.connect()                                                                                                                                                                                       
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 449, in connect                                                     
    return _ConnectionFairy._checkout(self)                                                                                                                                                                          
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 1263, in _checkout                                                  
    fairy = _ConnectionRecord.checkout(pool)                                                                                                                                                                         
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/pool/base.py", line 712, in checkout                                                    
    rec = pool._do_get()                                                                                                                                                                                             
  File "/home/appuser/.cache/pypoetry/virtualenvs/arpav-ppcv-backend-f8CPI8sp-py3.10/lib/python3.10/site-packages/sqlalchemy/pool/impl.py", line 168, in _do_get                                                     
    raise exc.TimeoutError(                                                                                                                                                                                          
sqlalchemy.exc.TimeoutError: QueuePool limit of size 5 overflow 10 reached, connection timed out, timeout 30.00 (Background on this error at: https://sqlalche.me/e/20/3o7r)