If I try and report a spam comment, or indeed publish a comment I get a 404. Any URLs beginning with domain.com/antispam/ result in a 404. All my other clean URLs work and there are no path rules that conflict with this URL.

Comments

reganjcunliffe’s picture

I, too, am experiencing this problem when clicking the "unpublish" link on unwanted comments

pixture’s picture

Assigned: Unassigned » pixture

Could you give me the full URL (starting from http://) of the unpublish link which ends up with 404 error.

Does this 404 error happen always with any unpublish link? or does this happen occasionally? or happen always with some certain unpublish link only? I need more information.

stephencarr’s picture

Example URL: http://example.com/antispam/comment/99/unpublish

Happens on *all* unpublish/submit spam links intermittently.

Seems to be a symptom of this bug:

http://drupal.org/node/530680

When the Antispam menu item disappears from the admin section *all* Antispam URLs end up with a 404. When the menu item is present it all works fine. The Antispam menu item disappears and reappears seemingly at random, could be a caching thing I am using authcache and eAccelerator.

reganjcunliffe’s picture

same for me

Taz’s picture

Happening for me as well. A flush of the menu cache is the quick fix.

A duplicate of this bug can be found here:
http://drupal.org/node/530680

MrGeek’s picture

Same problem here on two different sites.. Clearing the cache does clear it up temporarily.. Thank you..

davidinnes’s picture

Same problem here with a nearly-new installation. (Drupal 6.14)

* "AntiSpam moderation queue" disappears from content management menu
* All AntiSpam moderation controls go to 404
* "AntiSpam" remains on the site configuration menu
* AntiSpam settings page is active and appears to be in working order.

In my case clearing the cache didn't resolve the problem.
Neither did rebuilding the menus by visiting the Modules settings page

I was able to restore it by disabling AntiSpam in the Modules settings page and then re-enabling it.

MrGeek’s picture

any update on this? a month or so ago, this only happened about once per week, now it happens multiple times per day.

pixture’s picture

Since I can not reproduce the problem with my test site, could you do the followings and see if it helps or not?

Edit the antispam_menu() function in the antispam.module file. Toward the very end of this function, you should see the section like below:

  $item = array(
   'title' => 'switch content status',
   'page callback' => 'antispam_page',
   'page arguments' => array(0, 1, 2, 3),
     : (omitted)
   'access arguments' => array(0, 1, 2, 3),
   'type' => MENU_CALLBACK,    // add this one line
  );

  foreach (array('publish', 'unpublish', 'submit-spam', 'submit-ham') as $op) {
    $items['antispam/%antispam/%/' . $op] = $item;
  }
}

As you see, please add one line says 'type' => MENU_CALLBACK.
I would appreciate if you can give it a shot.

Thank you,

MrGeek’s picture

i've applied the change in #9 .. i'll report back in a day or so if it makes any difference..

MrGeek’s picture

Welp, that was fast.. Made no difference..

pixture’s picture

Thanks for testing, I will keep looking into it.

BTW, which cache mode are you using? Disabled, Normal, Aggressive?
Could you also let me know other settings of Site Configuration > Performance page?

MrGeek’s picture

Caching: Normal
Minimum lifetime: None
Page compression: Disabled
Block Cache: Enabled
Optimize CSS & JavaScript files: Disabled

MrGeek’s picture

*cough*bump*cough*

Still happening.. many, many times per day.

Let me know if you want more testing or more info on configuration, etc..

pixture’s picture

@MrGeek,

Sorry for the inconveniences.
Since I can not reproduce the problem any of my test servers and official servers, it's very difficult to work on this issue.

1) If you are using any modules that work with path, menu, and/or cache other than core modules, it is possibel to test AntiSpam with such modules disabled?

2) If you have a test server that can reproduce this problem, can you test it with all non-core modules (except for AntiSpam module) disabled?

3) I'm sure that you enabled Clean URL, but if you are not, then AntiSpam may not work properly.

4) When the problem occur, could it possible that you rebuild menu using Develop module, and would it fix the problem immediatelly?

5) How often do you run cron.php? Does the problem seems to come back after the cron run?

At the same time, I will do a bit more research by myself.

MrGeek’s picture

1) I'm using the PathAuto module.. only core caching, but i do have eAccelerator installed on the server. I cant really disable the Pathauto module

2) I don't have a test server, but i do have another site on the same server that has the same issue - with the following modules (all also on my main site): Bad behavior, Comment subjects, FCKeditor, Inactive User, Pathauto, Troll, Google Analytics, XML Sitemap .. cant really disable those because the site is in prduction

3) Clean URLs are enabled

4) I'll have to try the devel module

5) Cron runs every 30 minutes on my busy site and ever hour on the other site, and never helps the problem. The only thing that helps is clearing the cache.

I see in comment #3, that stephencarr is also using eAccelerator - coincidence?

pixture’s picture

I am not familiar with eAccelerator but I suspect that eAccelerator may be the cause of this problem. Can you disable it to see if the problem still occur without eAccelerator?

MrGeek’s picture

Ehh.. it's in the kernal build on the server, and if i disable it, i suffer big performance hits.
You can read up on it here: http://eaccelerator.net/

maybe you can install it on one of your servers?

kjholla’s picture

I raised another issue for the same issue. But then on googling, I found this thread, which I think is because of the same problem.

Basically, I have seen the the same symptoms as the ones pointed to by davidinnes above

On digging around in the database, I found that the following entries in the menu_router table are lost:

'admin/content/antispam'
'admin/content/antispam/overview'
'admin/content/antispam/nodes'
'admin/content/antispam/statistics'
'antispam/%/%/publish'
'antispam/%/%/submit-ham'
'antispam/%/%/submit-spam'
'antispam/%/%/unpublish'
'admin/content/antispam/comments/published'
'admin/content/antispam/comments/spam'
'admin/content/antispam/comments/unpublished'
'admin/content/antispam/nodes/published'
'admin/content/antispam/nodes/spam'
'admin/content/antispam/nodes/unpublished'

I am not too sure what causes this problem though. However, it has happened to me repeatedly. This seems to be limited to only the AntiSpam module and does not affect any others.

Regards,
KH

tobias’s picture

This just happened to me yesterday too, and turning the module off and then back on again worked to fix it.

Thanks,

Tobias

rex_the_first’s picture

Cheers Tobias,

I have not got http://eaccelerator.net/ so that wasn't part of my problem but I have been getting 404 errors. It is hard to re-create as I have two (almost identical) Drupal installs and this was only happening on one of them. I suspect that the system log is the best place to look for errors as if it is infrequent then reproducing it will be hard.

kjholla’s picture

OK. I think I have noticed a pattern.
- a few SPAM comments are received
- at least one valid comment has been entered into the system
- a new blog entry is published
- a new blog entry is created
- the Cron runs

I have noticed this issue occurring twice with seemingly the same sequence of activities. However, I tried recreating the issue manually on my test system using the same sequence without success :(

In any case, I ran the following script to fix the issue:

INSERT INTO `drp_menu_links` (`menu_name`, `mlid`, `plid`, `link_path`, `router_path`, `link_title`, `options`, `module`, `hidden`, `external`, `has_children`, `expanded`, `weight`, `depth`, `customized`, `p1`, `p2`, `p3`, `p4`, `p5`, `p6`, `p7`, `p8`, `p9`, `updated`) VALUES
('navigation', 470, 0, 'antispam/%/%/unpublish', 'antispam/%/%/unpublish', 'switch content status', 'a:0:{}', 'system', 0, 0, 0, 0, 0, 1, 0, 470, 0, 0, 0, 0, 0, 0, 0, 0, 0),
('navigation', 467, 0, 'antispam/%/%/publish', 'antispam/%/%/publish', 'switch content status', 'a:0:{}', 'system', 0, 0, 0, 0, 0, 1, 0, 467, 0, 0, 0, 0, 0, 0, 0, 0, 0),
('navigation', 468, 0, 'antispam/%/%/submit-ham', 'antispam/%/%/submit-ham', 'switch content status', 'a:0:{}', 'system', 0, 0, 0, 0, 0, 1, 0, 468, 0, 0, 0, 0, 0, 0, 0, 0, 0),
('navigation', 469, 0, 'antispam/%/%/submit-spam', 'antispam/%/%/submit-spam', 'switch content status', 'a:0:{}', 'system', 0, 0, 0, 0, 0, 1, 0, 469, 0, 0, 0, 0, 0, 0, 0, 0, 0),
('navigation', 465, 10, 'admin/content/antispam', 'admin/content/antispam', 'AntiSpam moderation queue', 'a:1:{s:10:"attributes";a:1:{s:5:"title";s:85:"Manage the AntiSpam spam queue, appropving or deleting content in need of moderation.";}}', 'system', 0, 0, 0, 0, 0, 3, 0, 2, 10, 465, 0, 0, 0, 0, 0, 0, 0);




INSERT INTO `drp_menu_router` (`path`, `load_functions`, `to_arg_functions`, `access_callback`, `access_arguments`, `page_callback`, `page_arguments`, `fit`, `number_parts`, `tab_parent`, `tab_root`, `title`, `title_callback`, `title_arguments`, `type`, `block_callback`, `description`, `position`, `weight`, `file`) VALUES
('admin/content/antispam', '', '', '_antispam_is_moderator', 'a:1:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}}', 'antispam_callback_queue', 'a:0:{}', 7, 3, '', 'admin/content/antispam', 'AntiSpam moderation queue', 't', '', 6, '', 'Manage the AntiSpam spam queue, appropving or deleting content in need of moderation.', '', 0, 'sites/all/modules/antispam/antispam.admin.inc'),
('admin/content/antispam/overview', '', '', '_antispam_is_moderator', 'a:1:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}}', 'antispam_callback_queue', 'a:0:{}', 15, 4, 'admin/content/antispam', 'admin/content/antispam', 'Overview', 't', '', 136, '', '', '', 0, 'sites/all/modules/antispam/antispam.admin.inc'),
('admin/content/antispam/comments', '', '', '_antispam_is_moderator', 'a:2:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}i:1;s:8:"comments";}', 'antispam_callback_queue', 'a:1:{i:0;s:8:"comments";}', 15, 4, 'admin/content/antispam', 'admin/content/antispam', 'Comments', 't', '', 128, '', '', '', 2, 'sites/all/modules/antispam/antispam.admin.inc'),
('admin/content/antispam/nodes', '', '', '_antispam_is_node_moderator', 'a:1:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}}', 'antispam_callback_queue', 'a:1:{i:0;s:5:"nodes";}', 15, 4, 'admin/content/antispam', 'admin/content/antispam', 'Nodes', 't', '', 128, '', '', '', 1, 'sites/all/modules/antispam/antispam.admin.inc'),
('admin/content/antispam/statistics', '', '', '_antispam_is_moderator', 'a:1:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}}', 'antispam_callback_queue', 'a:1:{i:0;s:10:"statistics";}', 15, 4, 'admin/content/antispam', 'admin/content/antispam', 'Statistics', 't', '', 128, '', '', '', 3, 'sites/all/modules/antispam/antispam.admin.inc'),
('antispam/%/%/publish', 'a:2:{i:1;a:1:{s:13:"antispam_load";a:2:{i:0;s:4:"%map";i:1;s:6:"%index";}}i:2;N;}', '', 'antispam_access_callback', 'a:4:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;}', 'antispam_page', 'a:4:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;}', 9, 4, '', 'antispam/%/%/publish', 'switch content status', 't', '', 6, '', '', '', 0, ''),
('antispam/%/%/submit-ham', 'a:2:{i:1;a:1:{s:13:"antispam_load";a:2:{i:0;s:4:"%map";i:1;s:6:"%index";}}i:2;N;}', '', 'antispam_access_callback', 'a:4:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;}', 'antispam_page', 'a:4:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;}', 9, 4, '', 'antispam/%/%/submit-ham', 'switch content status', 't', '', 6, '', '', '', 0, ''),
('antispam/%/%/submit-spam', 'a:2:{i:1;a:1:{s:13:"antispam_load";a:2:{i:0;s:4:"%map";i:1;s:6:"%index";}}i:2;N;}', '', 'antispam_access_callback', 'a:4:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;}', 'antispam_page', 'a:4:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;}', 9, 4, '', 'antispam/%/%/submit-spam', 'switch content status', 't', '', 6, '', '', '', 0, ''),
('antispam/%/%/unpublish', 'a:2:{i:1;a:1:{s:13:"antispam_load";a:2:{i:0;s:4:"%map";i:1;s:6:"%index";}}i:2;N;}', '', 'antispam_access_callback', 'a:4:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;}', 'antispam_page', 'a:4:{i:0;i:0;i:1;i:1;i:2;i:2;i:3;i:3;}', 9, 4, '', 'antispam/%/%/unpublish', 'switch content status', 't', '', 6, '', '', '', 0, ''),
('admin/content/antispam/nodes/published', '', '', '_antispam_is_node_moderator', 'a:1:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}}', 'antispam_callback_queue', 'a:2:{i:0;s:5:"nodes";i:1;s:9:"published";}', 31, 5, 'admin/content/antispam/nodes', 'admin/content/antispam', 'Published nodes', 't', '', 128, '', '', '', 2, 'sites/all/modules/antispam/antispam.admin.inc'),
('admin/content/antispam/comments/spam', '', '', '_antispam_is_moderator', 'a:2:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}i:1;s:8:"comments";}', 'antispam_callback_queue', 'a:1:{i:0;s:8:"comments";}', 31, 5, 'admin/content/antispam/comments', 'admin/content/antispam', 'Spam', 't', '', 136, '', '', '', 0, 'sites/all/modules/antispam/antispam.admin.inc'),
('admin/content/antispam/nodes/spam', '', '', '_antispam_is_node_moderator', 'a:1:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}}', 'antispam_callback_queue', 'a:1:{i:0;s:5:"nodes";}', 31, 5, 'admin/content/antispam/nodes', 'admin/content/antispam', 'Spam', 't', '', 136, '', '', '', 0, 'sites/all/modules/antispam/antispam.admin.inc'),
('admin/content/antispam/comments/unpublished', '', '', '_antispam_is_moderator', 'a:2:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}i:1;s:8:"comments";}', 'antispam_callback_queue', 'a:2:{i:0;s:8:"comments";i:1;s:11:"unpublished";}', 31, 5, 'admin/content/antispam/comments', 'admin/content/antispam', 'Unpublished comments', 't', '', 128, '', '', '', 1, 'sites/all/modules/antispam/antispam.admin.inc'),
('admin/content/antispam/nodes/unpublished', '', '', '_antispam_is_node_moderator', 'a:1:{i:0;a:4:{s:4:"blog";s:10:"Blog entry";s:4:"page";s:4:"Page";s:5:"story";s:5:"Story";s:8:"comments";s:8:"comments";}}', 'antispam_callback_queue', 'a:2:{i:0;s:5:"nodes";i:1;s:11:"unpublished";}', 31, 5, 'admin/content/antispam/nodes', 'admin/content/antispam', 'Unpublished nodes', 't', '', 128, '', '', '', 1, 'sites/all/modules/antispam/antispam.admin.inc');

Regards,
KH

kjholla’s picture

I think the pattern I mentioned in my earlier entry holds very true.

I just published another blog post today and waited for the cron to run. Sure enough, after the cron has run twice, the antispam menu entries are gone!

Looks fairly reproducible to me! Please let me know if I can help in any way to get to the root of this problem.

Regards,
KH

pixture’s picture

I was able to see the problem by myself at both of my official and test sites. When you disable and enable AntiSpam module , the menu comes back and everything works OK for a while, but the AntiSpam moderation queue menu under Administer > Content Management will again disappear after a while. I am not sure if this is directly related with cron run or not, but it seems to be related with menu cache and menu rebuild process of Drupal.

It seems that the menu items using wildcard loader arguments is the trigger of this problem. When I commented out the following section from antispam_menu() function, the Antispam moderation queue menu will no longer disappear. Based on some other experiments, I think this is not a bug of AntiSpam module but a bug of Drupal core.

    foreach (array('publish', 'unpublish', 'submit-spam', 'submit-ham') as $op) {
      $items['antispam/%antispam/%/'. $op] = $item;
    }

I did some experiment and also researched the Drupal.org and found the similar problem:
http://drupal.org/node/356209

This article says that there seems to be a bug of Drupal core. Anyway, I am now trying to find the way walk around this problem.

pixture’s picture

Finally, I found out what's wrong. This is a bug which has been carried over from Akismet module, predecessor of AntiSpam module.

I am now testing a new version at my sites to make sure everything is OK before releasing it. I am planning to release it sometime by the end of this month.

pixture’s picture

Version: 6.x-1.0-beta2 » 6.x-1.0
Status: Active » Fixed

Fixed with 6.x-1.0.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.