Hi Manish,
This is the output of the function.
---------------------------------------------------------------------------
InternalError_Traceback (most recent call last)
File ~/www/echis/releases/2024-03-18_20.04/python_env/lib/python3.9/site-packages/django/db/backends/utils.py:84, in CursorWrapper._execute(self, sql, params, *ignored_wrapper_args)
83 else:
---> 84 return self.cursor.execute(sql, params)
InternalError_: PL/Proxy function public.delete_blob_meta(1): [commcarehq_p1] PQconnectPoll: connection to server at "172.19.3.36", port 6432 failed: Connection timed out
Is the server running on that host and accepting TCP/IP connections?
The above exception was the direct cause of the following exception:
InternalError Traceback (most recent call last)
Cell In[4], line 1
----> 1 check_blobdb()
Cell In[3], line 13, in check_blobdb()
11 with db.get(meta=meta) as fh:
12 res = fh.read()
---> 13 db.delete(key=meta.key)
14 if res == contents:
15 return ServiceStatus(True, "Successfully saved a file to the blobdb")
File ~/www/echis/releases/2024-03-18_20.04/corehq/blobs/s3db.py:134, in S3BlobDB.delete(self, key)
132 obj.delete()
133 success = True
--> 134 self.metadb.delete(key, deleted_bytes)
135 return success
File ~/www/echis/releases/2024-03-18_20.04/corehq/blobs/metadata.py:82, in MetaDB.delete(self, key, content_length)
73 """Delete blob metadata
74
75 Metadata for temporary blobs is deleted. Non-temporary metadata
(...)
79 :returns: The number of metadata rows deleted.
80 """
81 with BlobMeta.get_plproxy_cursor() as cursor:
---> 82 cursor.execute('SELECT 1 FROM delete_blob_meta(%s)', [key])
83 metrics_counter('commcare.blobs.deleted.count')
84 metrics_counter('commcare.blobs.deleted.bytes', value=content_length)
File ~/www/echis/releases/2024-03-18_20.04/python_env/lib/python3.9/site-packages/sentry_sdk/integrations/django/__init__.py:582, in install_sql_hook.<locals>.execute(self, sql, params)
577 return real_execute(self, sql, params)
579 with record_sql_queries(
580 hub, self.cursor, sql, params, paramstyle="format", executemany=False
581 ):
--> 582 return real_execute(self, sql, params)
File ~/www/echis/releases/2024-03-18_20.04/python_env/lib/python3.9/site-packages/django/db/backends/utils.py:66, in CursorWrapper.execute(self, sql, params)
65 def execute(self, sql, params=None):
---> 66 return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
File ~/www/echis/releases/2024-03-18_20.04/python_env/lib/python3.9/site-packages/django/db/backends/utils.py:75, in CursorWrapper._execute_with_wrappers(self, sql, params, many, executor)
73 for wrapper in reversed(self.db.execute_wrappers):
74 executor = functools.partial(wrapper, executor)
---> 75 return executor(sql, params, many, context)
File ~/www/echis/releases/2024-03-18_20.04/python_env/lib/python3.9/site-packages/django/db/backends/utils.py:84, in CursorWrapper._execute(self, sql, params, *ignored_wrapper_args)
82 return self.cursor.execute(sql)
83 else:
---> 84 return self.cursor.execute(sql, params)
File ~/www/echis/releases/2024-03-18_20.04/python_env/lib/python3.9/site-packages/django/db/utils.py:90, in DatabaseErrorWrapper.__exit__(self, exc_type, exc_value, traceback)
88 if dj_exc_type not in (DataError, IntegrityError):
89 self.wrapper.errors_occurred = True
---> 90 raise dj_exc_value.with_traceback(traceback) from exc_value
File ~/www/echis/releases/2024-03-18_20.04/python_env/lib/python3.9/site-packages/django/db/backends/utils.py:84, in CursorWrapper._execute(self, sql, params, *ignored_wrapper_args)
82 return self.cursor.execute(sql)
83 else:
---> 84 return self.cursor.execute(sql, params)
InternalError: PL/Proxy function public.delete_blob_meta(1): [commcarehq_p1] PQconnectPoll: connection to server at "172.19.3.36", port 6432 failed: Connection timed out
Is the server running on that host and accepting TCP/IP connections?