Can NOT delete all spam comments at once

Olli5

Joined: 2008-10-23
Posts: 1
Posted: Thu, 2008-10-23 09:21

I have a fresh install of G2.3, imported albums from G1 to G2 succesfully, everything seems to work fine except that I Can NOT delete all spam comments (that were imported from G1) at once, only one by one.

When I try delete all spams at "Comments Awaiting Moderation", I get this:

An error has occurred while interacting with the platform.
The exact nature of the platform error is unknown. A common cause are insufficient file system permissions. This can happen if you or your webhost changed something in the file system, e.g. by restoring data from a backup.

Back to the Gallery
Error Detail -
Error (ERROR_PLATFORM_FAILURE) : /var/www/MYSERVERNAMEMODIFIED.com/gallery/gallerydata/locks/55

* in modules/core/classes/FlockLockSystem.class at line 72 (GalleryCoreApi::error)
* in modules/core/classes/GalleryLockSystem.class at line 95 (FlockLockSystem::_acquireLock)
* in modules/core/classes/helpers/GalleryLockHelper_simple.class at line 135 (GalleryLockSystem::acquireReadLock)
* in modules/core/classes/GalleryCoreApi.class at line 2267 (GalleryLockHelper_simple::acquireReadLockParents)
* in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 56 (GalleryCoreApi::acquireReadLockParents)
* in modules/core/classes/GalleryCoreApi.class at line 2377 (GalleryEntityHelper_medium::deleteEntityById)
* in modules/comment/AdminModerateSpam.inc at line 58 (GalleryCoreApi::deleteEntityById)
* in main.php at line 250 (AdminModerateSpamController::handleRequest)
* in main.php at line 104
* in main.php at line 88

System Information
Gallery version 2.3
PHP version 5.2.6-pl7-gentoo apache2handler
Webserver Apache
Database mysqlt 5.0.60-log
Toolkits ImageMagick, Thumbnail, NetPBM, Gd
Operating system Linux MYSERVERNAMEMODIFIED 2.6.25-gentoo-r8 #2 SMP Mon Oct 20 15:34:02 EEST 2008 i686
Browser Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3

Yes, I have tried to give all rights to gallery, (chmod 777 -R) and also removed the .htaccess but still it does not work...

Any help is appreciated, I don't really want to delete over 2700 spams one by one...

Br, Olli

 
sampas

Joined: 2008-11-12
Posts: 4
Posted: Wed, 2008-11-12 21:36

I had 41k comments in my G2 gallery, all of them spam. It took less than 8 seconds to delete all of them.

If you want to delete ALL comments (not just ones labelled spam), here's the MySQL syntax (stuff I typed in in bold, comments in italic.)
[root@mrtg gallery2]# mysql -u gallery -p My db username is "gallery."
Enter password: Enter your password -- you can find this info in config.php.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 782 to server version: 4.1.20

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use gallery2 My db name is gallery2.
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> delete from g2_Comment; When you leave out any kind of where statement, MySQL deletes ALL rows in the table.
Query OK, 44106 rows affected (7.81 sec)

 
al

Joined: 2003-08-12
Posts: 3
Posted: Mon, 2008-11-17 19:16

I also have this same problem. I don't see anything wrong permissions-wise, certainly nothing obvious.


Error (ERROR_PLATFORM_FAILURE) : /PATHTOGALLERY/g2data/locks/7

* in modules/core/classes/FlockLockSystem.class at line 72 (GalleryCoreApi::error)
* in modules/core/classes/GalleryLockSystem.class at line 95 (FlockLockSystem::_acquireLock)
* in modules/core/classes/helpers/GalleryLockHelper_simple.class at line 135 (GalleryLockSystem::acquireReadLock)
* in modules/core/classes/GalleryCoreApi.class at line 2267 (GalleryLockHelper_simple::acquireReadLockParents)
* in modules/core/classes/helpers/GalleryEntityHelper_medium.class at line 56 (GalleryCoreApi::acquireReadLockParents)
* in modules/core/classes/GalleryCoreApi.class at line 2377 (GalleryEntityHelper_medium::deleteEntityById)
* in modules/comment/AdminModerateSpam.inc at line 58 (GalleryCoreApi::deleteEntityById)
* in main.php at line 250 (AdminModerateSpamController::handleRequest)
* in main.php at line 104
* in main.php at line 88

System Information
Gallery version 2.3
PHP version 5.2.6-pl7-gentoo apache2handler
Webserver Apache
Database postgres7 8.0.15 3 8.0.15
Toolkits ImageMagick, NetPBM, Gd
Operating system Linux BOX 2.6.24-gentoo-r8 #1 SMP Thu Jul 17 08:50:26 UTC 2008 i686
Browser Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4


If I try and delete a single post I get a different error


Error (ERROR_MISSING_OBJECT) : Missing object for 14824

* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 2054 (GalleryCoreApi::error)
* in modules/core/classes/GalleryStorage/GalleryStorageExtras.class at line 98 (GalleryStorageExtras::_identifyEntities)
* in modules/core/classes/GalleryStorage.class at line 313 (GalleryStorageExtras::loadEntities)
* in modules/core/classes/helpers/GalleryEntityHelper_simple.class at line 71 (GalleryStorage::loadEntities)
* in modules/core/classes/GalleryCoreApi.class at line 2361 (GalleryEntityHelper_simple::loadEntitiesById)
* in modules/comment/CommentCallback.inc at line 92 (GalleryCoreApi::loadEntitiesById)
* in modules/comment/CommentCallback.inc at line 54 (CommentCallbackView::deleteComment)
* in main.php at line 450 (CommentCallbackView::renderImmediate)
* in main.php at line 104
* in main.php at line 88

System Information
Gallery version 2.3
PHP version 5.2.6-pl7-gentoo apache2handler
Webserver Apache
Database postgres7 8.0.15 3 8.0.15
Toolkits ImageMagick, NetPBM, Gd
Operating system Linux BOX 2.6.24-gentoo-r8 #1 SMP Thu Jul 17 08:50:26 UTC 2008 i686
Browser Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-GB; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4


 
mikeage

Joined: 2005-01-23
Posts: 103
Posted: Tue, 2008-11-18 21:26

Do NOT just delete from g2_Comment! You'll leave orphaned entries all over the place.

One unofficial-but-seems-to-work SQL statement is:

delete ce, e, co from g2_ChildEntity ce, g2_Entity e, g2_Comment co where ce.g_id=e.g_id and e.g_id=co.g_id and e.g_entityType='GalleryComment';

If you want to remove comments matching a pattern (say, containing the string http), use

delete ce, e, co from g2_ChildEntity ce, g2_Entity e, g2_Comment co where ce.g_id=e.g_id and e.g_id=co.g_id and e.g_entityType='GalleryComment' and co.g_comment like '%http%';

 
mikeage

Joined: 2005-01-23
Posts: 103
Posted: Tue, 2008-11-18 21:28

Regarding the lock issue; have you tried using database locking instead of file locking?

 
al

Joined: 2003-08-12
Posts: 3
Posted: Tue, 2008-11-18 23:53

mikeage, thanks for the pointer. Switching to DB sessions solves the problem. Thanks!

Al