Exception raised when null value in column "created" of relation "history_safecontract"
tolbrino opened this issue · 3 comments
Describe the bug
Service raises an exception when trying to process a transaction with a missing field.
safe-transaction-indexer-6465f4db7d-2m88k indexer 2024-09-13 06:51:41,601 [ERROR] [cb1ebd15/process_decoded_internal_txs_for_safe_task] Task safe_transaction_service.history.tasks.process_decoded_internal_txs_for_safe_task[cb1ebd15-b543-4165-845a-aed48081a489] raised unexpected: IntegrityError('null value in column "created" of relation "history_safecontract" violates not-null constraint\nDETAIL: Failing row contains (\\xc0850a98fa32cfc4c2892793aebc1158cf5443aa, \\x5ddcf671507d6b3a0a43e461f4e821c36536203c80ba67e14fc917fe85dcb3..., f, null).\n')
safe-transaction-indexer-6465f4db7d-2m88k indexer Traceback (most recent call last):
safe-transaction-indexer-6465f4db7d-2m88k indexer File "/app/safe_transaction_service/history/indexers/tx_processor.py", line 391, in __process_decoded_transaction
safe-transaction-indexer-6465f4db7d-2m88k indexer safe_contract: SafeContract = SafeContract.objects.get(
safe-transaction-indexer-6465f4db7d-2m88k indexer ^^^^^^^^^^^^^^^^^^^^^^^^^
safe-transaction-indexer-6465f4db7d-2m88k indexer File "/usr/local/lib/python3.12/site-packages/django/db/models/manager.py", line 87, in manager_method
safe-transaction-indexer-6465f4db7d-2m88k indexer return getattr(self.get_queryset(), name)(*args, **kwargs)
safe-transaction-indexer-6465f4db7d-2m88k indexer ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
safe-transaction-indexer-6465f4db7d-2m88k indexer File "/usr/local/lib/python3.12/site-packages/django/db/models/query.py", line 649, in get
safe-transaction-indexer-6465f4db7d-2m88k indexer raise self.model.DoesNotExist(
safe-transaction-indexer-6465f4db7d-2m88k indexer safe_transaction_service.history.models.SafeContract.DoesNotExist: SafeContract matching query does not exist.
safe-transaction-indexer-6465f4db7d-2m88k indexer
safe-transaction-indexer-6465f4db7d-2m88k indexer During handling of the above exception, another exception occurred:
safe-transaction-indexer-6465f4db7d-2m88k indexer
safe-transaction-indexer-6465f4db7d-2m88k indexer Traceback (most recent call last):
safe-transaction-indexer-6465f4db7d-2m88k indexer File "/usr/local/lib/python3.12/site-packages/django/db/backends/utils.py", line 105, in _execute
safe-transaction-indexer-6465f4db7d-2m88k indexer return self.cursor.execute(sql, params)
safe-transaction-indexer-6465f4db7d-2m88k indexer ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
safe-transaction-indexer-6465f4db7d-2m88k indexer psycopg2.errors.NotNullViolation: null value in column "created" of relation "history_safecontract" violates not-null constraint
safe-transaction-indexer-6465f4db7d-2m88k indexer DETAIL: Failing row contains (\xc0850a98fa32cfc4c2892793aebc1158cf5443aa, \x5ddcf671507d6b3a0a43e461f4e821c36536203c80ba67e14fc917fe85dcb3..., f, null).
To Reproduce
Steps to reproduce the behavior:
- Just sync on Gnosis Chain.
Expected behavior
Either the service handles the missing field gracefully or the insert works even when the field data is missing.
Environment (please complete the following information):
- safe-tx-service: v5.4.0
- network: Gnosis Chain
It turned out it was a deployment configuration issue. Sorry for the noise.
It turned out it was a deployment configuration issue. Sorry for the noise.
Can you give details about it!!, because i have a similar issue?
It turned out it was a deployment configuration issue. Sorry for the noise.
Can you give details about it!!, because i have a similar issue?
We rolled back all migration, essentially clearing the DB. Then re-ran everything, let it sync and it worked.