View Issue Details

IDProjectCategoryView StatusLast Update
0004398Talerobsolete componentpublic2016-04-15 14:56
ReporterChristian Grothoff Assigned ToMarcello Stanisci  
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.

Activities

Florian Dold

2016-04-15 14: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 Modified Username Field Change
2016-04-11 19:26 Christian Grothoff New Issue
2016-04-11 19:26 Christian Grothoff Status new => assigned
2016-04-11 19:26 Christian Grothoff Assigned To => Marcello Stanisci
2016-04-15 14:52 Florian Dold Note Added: 0010478
2016-04-15 14:52 Florian Dold Status assigned => resolved
2016-04-15 14:52 Florian Dold Resolution open => unable to reproduce
2016-04-15 14:56 Christian Grothoff Status resolved => closed
2016-04-15 14:56 Christian Grothoff Fixed in Version => 0.0
2016-04-15 14:56 Christian Grothoff Target Version 0.1 => 0.0
2022-08-23 20:26 Christian Grothoff Category bank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 01:23 Christian Grothoff Category py bank (demonstrator, obsolete) => obsolete componet
2023-12-11 20:08 Florian Dold Category obsolete componet => obsolete component