Are you using our SaaS platform (Baserow.io) or self-hosting Baserow?
Self-hosted
If you are self-hosting, what version of Baserow are you running?
Self hosting 1.30.1
What are the exact steps to reproduce this issue?
When it happens it seems the base is lock: I can’t add a delete row, webhook are not emitted, I can’t publish the app.
I don’t know exactly how to reproduce it, it seems to happen when a row or several rows are created.
Some context
- I have a docker for baserow (8gb) and a separate cloud database hosted on OVH.
- The BASEROW_AMOUNT_OF_GUNICORN_WORKERS environment variable is set to 9
- Some tables have webhook for “all event”. These webhooks are linked to automations that run when rows are created or udated.
It’s verry problematic because baserow is almost unusable when it happend.
Does anyone have an idea about how to solve that ?
Thanks,
Here is the main error
[BACKEND][2025-03-11 08:35:49] ERROR 2025-03-11 08:35:49,095 django.request.log_response:241- Internal Server Error: /api/database/rows/table/38/
[BACKEND][2025-03-11 08:35:49] Traceback (most recent call last):
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 105, in _execute
[BACKEND][2025-03-11 08:35:49] return self.cursor.execute(sql, params)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] psycopg2.errors.DeadlockDetected: deadlock detected
[BACKEND][2025-03-11 08:35:49] DETAIL: Process 2539809 waits for ShareLock on transaction 34144581; blocked by process 2530919.
[BACKEND][2025-03-11 08:35:49] Process 2530919 waits for ShareLock on transaction 34144557; blocked by process 2539809.
[BACKEND][2025-03-11 08:35:49] HINT: See server log for query details.
[BACKEND][2025-03-11 08:35:49] CONTEXT: while updating tuple (697,2) in relation "database_table_38"
[BACKEND][2025-03-11 08:35:49]
[BACKEND][2025-03-11 08:35:49]
[BACKEND][2025-03-11 08:35:49] The above exception was the direct cause of the following exception:
[BACKEND][2025-03-11 08:35:49]
[BACKEND][2025-03-11 08:35:49] Traceback (most recent call last):
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/asgiref/sync.py", line 518, in thread_handler
[BACKEND][2025-03-11 08:35:49] raise exc_info[1]
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/core/handlers/exception.py", line 42, in inner
[BACKEND][2025-03-11 08:35:49] response = await get_response(request)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/asgiref/sync.py", line 518, in thread_handler
[BACKEND][2025-03-11 08:35:49] raise exc_info[1]
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/core/handlers/base.py", line 253, in _get_response_async
[BACKEND][2025-03-11 08:35:49] response = await wrapped_callback(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/asgiref/sync.py", line 468, in __call__
[BACKEND][2025-03-11 08:35:49] ret = await asyncio.shield(exec_coro)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/asgiref/current_thread_executor.py", line 40, in run
[BACKEND][2025-03-11 08:35:49] result = self.fn(*self.args, **self.kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/asgiref/sync.py", line 522, in thread_handler
[BACKEND][2025-03-11 08:35:49] return func(*args, **kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/views/decorators/csrf.py", line 65, in _view_wrapper
[BACKEND][2025-03-11 08:35:49] return view_func(request, *args, **kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/views/generic/base.py", line 104, in view
[BACKEND][2025-03-11 08:35:49] return self.dispatch(request, *args, **kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/rest_framework/views.py", line 509, in dispatch
[BACKEND][2025-03-11 08:35:49] response = self.handle_exception(exc)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/rest_framework/views.py", line 469, in handle_exception
[BACKEND][2025-03-11 08:35:49] self.raise_uncaught_exception(exc)
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
[BACKEND][2025-03-11 08:35:49] raise exc
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/rest_framework/views.py", line 506, in dispatch
[BACKEND][2025-03-11 08:35:49] response = handler(request, *args, **kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/usr/lib/python3.11/contextlib.py", line 81, in inner
[BACKEND][2025-03-11 08:35:49] return func(*args, **kwds)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/api/decorators.py", line 113, in func_wrapper
[BACKEND][2025-03-11 08:35:49] return func(*args, **kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/api/decorators.py", line 178, in func_wrapper
[BACKEND][2025-03-11 08:35:49] return func(*args, **kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/api/rows/views.py", line 545, in post
[BACKEND][2025-03-11 08:35:49] row = action_type_registry.get_by_type(CreateRowActionType).do(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/rows/actions.py", line 90, in do
[BACKEND][2025-03-11 08:35:49] row = RowHandler().create_row(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/core/telemetry/utils.py", line 72, in _wrapper
[BACKEND][2025-03-11 08:35:49] raise ex
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/core/telemetry/utils.py", line 68, in _wrapper
[BACKEND][2025-03-11 08:35:49] result = wrapped_func(*args, **kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/rows/handler.py", line 704, in create_row
[BACKEND][2025-03-11 08:35:49] return self.force_create_row(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/core/telemetry/utils.py", line 72, in _wrapper
[BACKEND][2025-03-11 08:35:49] raise ex
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/core/telemetry/utils.py", line 68, in _wrapper
[BACKEND][2025-03-11 08:35:49] result = wrapped_func(*args, **kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/rows/handler.py", line 794, in force_create_row
[BACKEND][2025-03-11 08:35:49] fields, dependant_fields = self.update_dependencies_of_rows_created(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/core/telemetry/utils.py", line 72, in _wrapper
[BACKEND][2025-03-11 08:35:49] raise ex
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/core/telemetry/utils.py", line 68, in _wrapper
[BACKEND][2025-03-11 08:35:49] result = wrapped_func(*args, **kwargs)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/rows/handler.py", line 1340, in update_dependencies_of_rows_created
[BACKEND][2025-03-11 08:35:49] update_collector.apply_updates_and_get_updated_fields(field_cache)
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/fields/dependencies/update_collector.py", line 415, in apply_updates_and_get_updated_fields
[BACKEND][2025-03-11 08:35:49] updated_rows_count = self.apply_updates(field_cache)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/fields/dependencies/update_collector.py", line 399, in apply_updates
[BACKEND][2025-03-11 08:35:49] updated_rows_count = self._update_statement_collector.execute_all(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/fields/dependencies/update_collector.py", line 147, in execute_all
[BACKEND][2025-03-11 08:35:49] updated_rows += sub_path.execute_all(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/fields/dependencies/update_collector.py", line 147, in execute_all
[BACKEND][2025-03-11 08:35:49] updated_rows += sub_path.execute_all(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/fields/dependencies/update_collector.py", line 139, in execute_all
[BACKEND][2025-03-11 08:35:49] updated_rows += self._execute_pending_update_statements(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/backend/src/baserow/contrib/database/fields/dependencies/update_collector.py", line 217, in _execute_pending_update_statements
[BACKEND][2025-03-11 08:35:49] qs.annotate(**annotations)
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/db/models/query.py", line 1253, in update
[BACKEND][2025-03-11 08:35:49] rows = query.get_compiler(self.db).execute_sql(CURSOR)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1990, in execute_sql
[BACKEND][2025-03-11 08:35:49] cursor = super().execute_sql(result_type)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/db/models/sql/compiler.py", line 1562, in execute_sql
[BACKEND][2025-03-11 08:35:49] cursor.execute(sql, params)
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 79, in execute
[BACKEND][2025-03-11 08:35:49] return self._execute_with_wrappers(
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 92, in _execute_with_wrappers
[BACKEND][2025-03-11 08:35:49] return executor(sql, params, many, context)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 100, in _execute
[BACKEND][2025-03-11 08:35:49] with self.db.wrap_database_errors:
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/db/utils.py", line 91, in __exit__
[BACKEND][2025-03-11 08:35:49] raise dj_exc_value.with_traceback(traceback) from exc_value
[BACKEND][2025-03-11 08:35:49] File "/baserow/venv/lib/python3.11/site-packages/django/db/backends/utils.py", line 105, in _execute
[BACKEND][2025-03-11 08:35:49] return self.cursor.execute(sql, params)
[BACKEND][2025-03-11 08:35:49] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[BACKEND][2025-03-11 08:35:49] django.db.utils.OperationalError: deadlock detected
[BACKEND][2025-03-11 08:35:49] DETAIL: Process 2539809 waits for ShareLock on transaction 34144581; blocked by process 2530919.
[BACKEND][2025-03-11 08:35:49] Process 2530919 waits for ShareLock on transaction 34144557; blocked by process 2539809.
[BACKEND][2025-03-11 08:35:49] HINT: See server log for query details.
[BACKEND][2025-03-11 08:35:49] CONTEXT: while updating tuple (697,2) in relation "database_table_38"
[BACKEND][2025-03-11 08:35:49]
[BACKEND][2025-03-11 08:35:51] 34.96.44.77:0 - "POST /api/database/rows/table/38/?user_field_names=true HTTP/1.1" 500
[BACKEND][2025-03-11 08:35:54] 92.169.248.58:0 - "GET /api/jobs/542/ HTTP/1.1" 200
[BACKEND][2025-03-11 08:35:56] 92.169.248.58:0 - "GET /api/jobs/542/ HTTP/1.1" 200