Skip to content
This repository has been archived by the owner on Jun 2, 2021. It is now read-only.

failed to delete migrated projects #7

Open
changsijay opened this issue Aug 26, 2016 · 1 comment
Open

failed to delete migrated projects #7

changsijay opened this issue Aug 26, 2016 · 1 comment

Comments

@changsijay
Copy link

changsijay commented Aug 26, 2016

I use version 1.0.1 jar and migrated some projects from redmine.
While I want to delete those projects from django /admin/projects/project/, it resulted in internal server error(500) as below error:

In /admin/projects/project/, project id=8 is the migrated project. It still there now.

ERROR:2016-08-26 11:18:46,917: Internal Server Error: /admin/projects/project/
Traceback (most recent call last):
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/db/backends/base/base.py", line 211, in _commit
    return self.connection.commit()
psycopg2.IntegrityError: insert or update on table "projects_points" violates foreign key constraint "projects_points_project_id_3b8f7b42_fk_projects_project_id"
DETAIL:  Key (project_id)=(8) is not present in table "projects_project".


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

Traceback (most recent call last):
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/core/handlers/base.py", line 149, in get_response
    response = self.process_exception_by_middleware(e, request)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/core/handlers/base.py", line 147, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/contrib/admin/options.py", line 541, in wrapper
    return self.admin_site.admin_view(view)(*args, **kwargs)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/views/decorators/cache.py", line 57, in _wrapped_view_func
    response = view_func(request, *args, **kwargs)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/contrib/admin/sites.py", line 244, in inner
    return view(request, *args, **kwargs)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/utils/decorators.py", line 67, in _wrapper
    return bound_func(*args, **kwargs)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/utils/decorators.py", line 149, in _wrapped_view
    response = view_func(request, *args, **kwargs)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/utils/decorators.py", line 63, in bound_func
    return func.__get__(self, type(self))(*args2, **kwargs2)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1512, in changelist_view
    response = self.response_action(request, queryset=cl.get_queryset(request))
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/contrib/admin/options.py", line 1245, in response_action
    response = func(self, request, queryset)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/contrib/admin/actions.py", line 49, in delete_selected
    queryset.delete()
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/db/models/query.py", line 600, in delete
    deleted, _rows_count = collector.delete()
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/db/models/deletion.py", line 316, in delete
    sender=model, instance=obj, using=self.using
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/db/transaction.py", line 223, in __exit__
    connection.commit()
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/db/backends/base/base.py", line 242, in commit
    self._commit()
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/db/backends/base/base.py", line 211, in _commit
    return self.connection.commit()
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/db/utils.py", line 95, in __exit__
    six.reraise(dj_exc_type, dj_exc_value, traceback)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/home/devops/.virtualenvs/taiga/lib/python3.5/site-packages/django/db/backends/base/base.py", line 211, in _commit
    return self.connection.commit()
django.db.utils.IntegrityError: insert or update on table "projects_points" violates foreign key constraint "projects_points_project_id_3b8f7b42_fk_projects_project_id"
DETAIL:  Key (project_id)=(8) is not present in table "projects_project".
@changsijay
Copy link
Author

oh, sorry, I found it is not migrator issue.
It failed when I tried to delete project, even those from python manage.py sample_data

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant