View Issue Details

IDProjectCategoryView StatusLast Update
0004398Talerobsolete componentpublic2016-04-15 12:56
ReporterChristian Grothoff Assigned ToMarcello Stanisci Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PrioritynormalSeveritycrashReproducibilityhave not tried
Status closedResolutionunable to reproduce 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Version0.0 
Target Version0.0Fixed in Version0.0 
Summary0004398: taler-bank-manage --flushdata crashes
Description$ taler-bank-manage --flushdata
You have requested a flush of the database.
This will IRREVERSIBLY DESTROY all data currently in the 'talerbank' database,
and return each table to an empty state.
Are you sure you want to do this?

    Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
psycopg2.NotSupportedError: cannot truncate a table referenced in a foreign key constraint
DETAIL: Table "bank_app_bankaccount" references "auth_user".
HINT: Truncate table "bank_app_bankaccount" at the same time, or use TRUNCATE ... CASCADE.


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/django/core/management/commands/flush.py", line 67, in handle
    cursor.execute(sql)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/lib/python3/dist-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
django.db.utils.NotSupportedError: cannot truncate a table referenced in a foreign key constraint
DETAIL: Table "bank_app_bankaccount" references "auth_user".
HINT: Truncate table "bank_app_bankaccount" at the same time, or use TRUNCATE ... CASCADE.


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/grothoff/bin/taler-bank-manage", line 66, in <module>
    call_command('flush')
  File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 119, in call_command
    return command.execute(*args, **defaults)
  File "/usr/lib/python3/dist-packages/django/core/management/base.py", line 399, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3/dist-packages/django/core/management/commands/flush.py", line 77, in handle
    six.reraise(CommandError, CommandError(new_msg), sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/django/core/management/commands/flush.py", line 67, in handle
    cursor.execute(sql)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 79, in execute
    return super(CursorDebugWrapper, self).execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 64, in execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python3/dist-packages/django/db/utils.py", line 97, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/usr/lib/python3/dist-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/django/db/backends/utils.py", line 62, in execute
    return self.cursor.execute(sql)
django.core.management.base.CommandError: Database talerbank couldn't be flushed. Possible reasons:
  * The database isn't running or isn't configured correctly.
  * At least one of the expected database tables doesn't exist.
  * The SQL was invalid.
Hint: Look at the output of 'django-admin sqlflush'. That's the SQL this command wasn't able to run.
The full error: cannot truncate a table referenced in a foreign key constraint
DETAIL: Table "bank_app_bankaccount" references "auth_user".
HINT: Truncate table "bank_app_bankaccount" at the same time, or use TRUNCATE ... CASCADE.

TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Florian Dold

2016-04-15 12:52

manager   ~0010478

The wrapper completely changed, and I'm not able to reproduce this error. I think it can be closed.

Issue History

Date ModifiedUsernameFieldChange
2016-04-11 17:26Christian GrothoffNew Issue
2016-04-11 17:26Christian GrothoffStatusnew => assigned
2016-04-11 17:26Christian GrothoffAssigned To => Marcello Stanisci
2016-04-15 12:52Florian DoldNote Added: 0010478
2016-04-15 12:52Florian DoldStatusassigned => informing
2016-04-15 12:52Florian DoldResolutionopen => unable to reproduce
2016-04-15 12:56Christian GrothoffStatusinforming => closed
2016-04-15 12:56Christian GrothoffFixed in Version => 0.0
2016-04-15 12:56Christian GrothoffTarget Version0.1 => 0.0
2022-08-23 18:26Christian GrothoffCategorybank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 00:23Christian GrothoffCategorypy bank (demonstrator, obsolete) => obsolete componet
2023-12-11 19:08Florian DoldCategoryobsolete componet => obsolete component