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

Error deleting 'project' #3649

Closed
matthias-ronge opened this issue May 19, 2020 · 2 comments · Fixed by #4665 or #4771
Closed

Error deleting 'project' #3649

matthias-ronge opened this issue May 19, 2020 · 2 comments · Fixed by #4665 or #4771
Assignees
Labels

Comments

@matthias-ronge
Copy link
Collaborator

matthias-ronge commented May 19, 2020

Create a project, give the project to users, then click the trash. The project is no longer displayed, but an error message is displayed.

Screenshot
Stacktrace:

[ERROR] 2020-05-19 08:41:23.782 [ajp-nio-8009-exec-3] SqlExceptionHelper - Cannot delete
    or update a parent row: a foreign key constraint fails (`kitodo`.`project_x_template`,
    CONSTRAINT `FK_project_x_template_project_id` FOREIGN KEY (`project_id`) REFERENCES
    `project` (`id`))
[DEBUG] 2020-05-19 08:41:23.845 [ajp-nio-8009-exec-3] SearchService -
    org.kitodo.data.database.exceptions.DAOException:
    javax.persistence.PersistenceException:
    org.hibernate.exception.ConstraintViolationException: could not execute statement
[ERROR] 2020-05-19 08:41:23.845 [ajp-nio-8009-exec-3] ProjectForm - errorDeleting
    org.kitodo.data.exceptions.DataException: 
    org.kitodo.data.database.exceptions.DAOException: 
    javax.persistence.PersistenceException: 
    org.hibernate.exception.ConstraintViolationException: could not execute statement
    at org.kitodo.production.services.data.base.SearchService.remove
        (SearchService.java:334)
    at org.kitodo.production.services.data.ProjectService.delete(ProjectService.java:377)
    at org.kitodo.production.forms.ProjectForm.delete(ProjectForm.java:291)
    ...

After logout and login, the index must be updated because projects are not fully indexed. It looks like the project was deleted from the index, but not from the database. However, it is no longer displayed. It is probably no longer possible to create a new project with the name.

Goal: Delete project completely. If this is not possible, do not delete the project at all.

@solth
Copy link
Member

solth commented Sep 21, 2021

Unfortunately this error does not seem to be fixed by #4665 after all. (still occurs in the current master)

@solth solth reopened this Sep 21, 2021
@matthias-ronge
Copy link
Collaborator Author

matthias-ronge commented Oct 4, 2021

Just tested: Not yet fixed.

Reason is that on duplicating a project, the process templates of the origin project are linked with the duplicated project as well. So the correct solution should be to remove the project to delete from any production templates, before deleting it. The underlying assumption is, that a project cannot be deleted if processes are linked to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants