passbolt / passbolt_api

Passbolt Community Edition (CE) API. The JSON API for the open source password manager for teams!
https://passbolt.com
GNU Affero General Public License v3.0
4.73k stars 311 forks source link

User can't be deleted because (s)he is the sole owner of shared content #497

Closed zbrag closed 7 months ago

zbrag commented 1 year ago

What you did

I am trying to delete a user

What happened

the screen turns to black (dark theme), in the logfile there is a line 2023-10-04 13:38:05 error: [App\Error\Exception\CustomValidationException] The user cannot be deleted. The user should not be sole owner of shared content, transfer the ownership to other users. in /var/www/vhosts/simba.vzw.io/httpdocs/src/Controller/Users/UsersDeleteController.php on line 194

What you expected to happen

I expected a dialog which tells me which passwords should get a new owner.

I've checked the releasenotes, and I don't see any mention of this issue.

cedricalfonsi commented 1 year ago

Hello @zbrag,

Sorry to read you are facing an issue while trying to delete a user.

Prior to mark the ticket as a bug, there are 2 things that could be done:

  1. Check for data integrity issue (and fix)

sudo -u www-data /usr/share/php/passbolt/bin/cake passbolt cleanup --dry-run

If it outputs an error, you can fix it reusing the same command without the --dry-run argument.

  1. Upgrade the API to a recent version

The v3.6.0 is more than a year old (May 25th, 2022) and a lot of changes were made since then. You should be able to upgrade to the latest v3 without any problem.

zbrag commented 1 year ago

Checking the data integrity found 8 errors in total: ` Cleanup shell (dry-run)

3 issues found in table Comments (soft deleted users) 5 issues found in table Comments (soft deleted resources)` Unfortunately fixing these errors didn't fix the issue. I will report later if upgrading fixed the problem

zbrag commented 11 months ago

I've upgraded to api version 3.12.2, the error remains the same, although the line is different: 2023-12-07 12:25:43 error: [App\Error\Exception\CustomValidationException] The user cannot be deleted. The user should not be sole owner of shared content, transfer the ownership to other users. in /var/www/vhosts/simba.vzw.io/httpdocs/src/Controller/Users/UsersDeleteController.php on line 217

I'm currently trying to see if I can upgrade to 4.X without problems

cedricalfonsi commented 7 months ago

I'm closing this issue as a later version might have fixed the issue. Feel free to reopen the ticket if the problem persist.