#4081 closed Defect (fixed)
deleting should use ElggBatch
| Reported by: | topdog08 | Owned by: | brettp |
|---|---|---|---|
| Priority: | normal | Milestone: | Elgg 1.8.4 |
| Component: | Core | Version: | 1.7 |
| Severity: | major | Keywords: | spammer delete user fails http 500 internal server error |
| Cc: | brett@… | Difficulty: |
Description
It appears that if a spammer is fast enough, they can post enough material that any attempts to delete them will fail, because the server will time out the request. While I can pursue performance tweaks with my web host, this is a dedicated box, there is no other system activity at the time because I blocked all access but mine, it should be able to delete the spam, even if it takes a long time.
Change History (9)
comment:1 Changed 19 months ago by topdog08
comment:2 Changed 18 months ago by cash
Wow, 42,000 blog posts. I hate spammers.
This is going to be an issue for any user with a lot of content. If someone tried to delete me from the Elgg community site, I'm sure it would fail. If it does fail, we don't want anything bad to happen to the database.
In 1.8, I fixed a bug in the system logger. It was caching a report for every database modification (like a delete) and that was using up all the memory. There may still be other caching issues causing the out of memory errors.
comment:3 Changed 17 months ago by cash
- Milestone changed from Needs Review to Elgg 1.8.4
- Severity changed from critical to major
- Summary changed from HTTP 500 Server Internal Error deleting spammers to deleting should use ElggBatch
When deleting things in a container, we should use ElggBatch to avoid OOM errors.
comment:4 Changed 16 months ago by cash
- Owner brett@… deleted
comment:5 Changed 16 months ago by brettp
See also #4288
comment:6 Changed 16 months ago by brettp
- Owner set to brettp
- Status changed from new to assigned
comment:7 Changed 16 months ago by Brett Profitt
- Resolution set to fixed
- Status changed from assigned to closed
Fixes #4081. Using ElggBatch to delete recursive.
Changeset: 4202d7d3087db4f503a7586a1f3fc824ebf45b30
comment:8 Changed 16 months ago by Brett Profitt
Refs #4081. Correctly calling setIncrementOffset(false) for deleting entities using ElggBatch.
Changeset: d082021c2a344d677ac2f1e8806182c9501e8484
comment:9 Changed 16 months ago by Brett Profitt
Fixes #4081. Using ElggBatch to delete recursive.
Changeset: 4202d7d3087db4f503a7586a1f3fc824ebf45b30

For example, I had 42000 spam blog posts, was only able to delete any by taking offline, increasing PHP mem limit to 512M and timeout to 300sec and letting it run.
Unfortunately now in the morning half of spam posts are gone but my database is corrupt and the validator tool can't detect it so I'm not clear the best course of action at this point. Either way would really like to avoid this in the future!
Here is what I get now when I try deleting the three spam IDs that they created:
DatabaseException
Incorrect key file for table './xyz/elgg_entities.MYI'; try to repair it
QUERY: SELECT * from elgg_entities where guid=217778 and ( (1 = 1) )
DatabaseException
Incorrect key file for table './xyz/elgg_objects_entity.MYI'; try to repair it
QUERY: DELETE from elgg_objects_entity where guid=224102
DatabaseException
Incorrect key file for table './xyz/elgg_river.MYI'; try to repair it
QUERY: delete from elgg_river where object_guid = 188644