Cancelling an account (Delete the account and its content) is impossible. An error occurs:
An AJAX HTTP error occurred. HTTP Result Code: 500 Debugging information follows. Path: /batch?render=overlay&id=78&op=do StatusText: Service unavailable (with message) ResponseText: PDOException: SQLSTATE[22003]: Numeric value out of range: 1264 Out of range value adjusted for column 'count' at row 1: UPDATE {flag_counts} SET count=:db_update_placeholder_0 WHERE (fid = :db_condition_placeholder_0) AND (content_id = :db_condition_placeholder_1) ; Array ( [:db_update_placeholder_0] => -1 [:db_condition_placeholder_0] => 2 [:db_condition_placeholder_1] => 198 ) in flag_user_account_removal() (line 621 of .../sites/all/modules/flag/flag.module).
Manually unflagged all of the user's flags, but it did not help.
I am in the process of handing over this new website to the customer and would love to have cancelled all test accounts.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 1362260.d6.flag_.clear-counts-user-delete.patch | 1.16 KB | joachim |
| #3 | flag-clear_counts_table_after_account_removal-1362260.patch | 1.04 KB | janchojnacki |
Comments
Comment #1
quicksketchI don't think deleting accounts is "impossible" in all situations, but it does reveal a bug in our incrementing/decrementing of counts. You can solve this problem in the short term by simply emptying the flag_content and flag_counts tables for whatever flag is causing the problem (looks like FID 2).
Note that this problem does not always occur. I can delete and add accounts just fine. The reason you're running into this problem is because Flag is attempting to decrement a count below "0", which isn't allowed by our database schema. I'm not sure what could cause this situation, but we should prevent Flag from attempting to do such a SQL query in the first place.
Comment #2
Tino commentedThanks you quicksketch, deleting those records solves it!
You are right, it is not "impossible" in all situations. I have also been able to delete users without this problem occurring. I should have said something like "Cancelling a certain account is impossile"....
Comment #3
janchojnacki commentedRemoving rows from the DB each time when error appears is not solution. Created patch.
Comment #4
joachim commentedComment #5
joachim commentedWe already cover this possibility when an object is unflagged, BTW:
Committed with code style tweaks.
Issue #1362260 by jaanhoinatski: Fixed user account deletion potentially causing out of bounds PDO error when decrementing flag counts.
Comment #6
joachim commentedProbably needs a backport, but patch will need considerable work to apply on 6-2.
Comment #7
joachim commented*sigh* This is now holding up the 6-2 beta 8.
Can anyone give it a quick review?
Comment #8
socketwench commentedLooks good to me. Tests clean.
Comment #9
joachim commentedThanks! Committed.
Applies cleanly to 6-1 too.
Comment #10.0
(not verified) commentedTypos