As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
Usage of permissionService.deletePermissions started throwing DataIntegrityViolationException in certain cases when calling this method prior to setting permissions:
permissionService.deletePermissions(nodeRef)
Detailed exception message also contains following information:
Cause: org.postgresql.util.PSQLException: ERROR: update or delete on table "alf_access_control_list" violates foreign key constraint "fk_alf_node_acl" on table "alf_node" Detail: Key (id)=(38685) is still referenced from table "alf_node".
Can you inspect the permissions of the nodeRef in question? Did you also tried this manually?