Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception raised when null value in column "created" of relation "history_safecontract" #2204

Closed
tolbrino opened this issue Sep 13, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@tolbrino
Copy link

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:

  1. 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
@tolbrino tolbrino added the bug Something isn't working label Sep 13, 2024
@tolbrino
Copy link
Author

It turned out it was a deployment configuration issue. Sorry for the noise.

@alfredolopez80
Copy link

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?

@tolbrino
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants