Hi,

I have installed the 7.x-4.x module (not upgrade), and I am experiencing the same problem as stefank posted two days ago here here, but i can't solve it cleaning the cache.

Hubo un error HTTP AJAX.
Código de Resultado HTTP:404
A continuación se detalla la información de depuración
Ruta: /prueba/autologout_ajax_get_time_left
StatusText: Not Found
ResponseText:
404 Not Found
NotFound
The requested URL /prueba/autologout_ajax_get_time_left was not found on this server.

any suggestions?

I am using Drupal 7.21 Apache/2.2.21 (Unix) mod_ssl/2.2.21 OpenSSL/1.0.0 PHP/5.2.17

Thanks.

Comments

rapira101’s picture

Same problem

johnennew’s picture

Version: 7.x-4.2 » 7.x-4.x-dev
Assigned: Mig » johnennew
Category: support » bug

Thanks for the bug report. Looks like an issue with Drupal installed in a sub folder.

johnennew’s picture

OK, I can't replicate this. Can I get some more information about your setup?

Is your Drupal installation installed in the prueba subfolder so that your homepage is accessible at http://example.com/prueba ?

What language modules do you have installed? Does the error appear for users in all languages? (locale / content translation)

Can you post the results of pointing your web browser to http://example.com/prueba/autologout_ajax_get_time_left both logged in and not logged in?

Can you enable the Testing module and run the tests for auto logout ( Configuration -> Testing -> Tick Autologout -> Click Run Tests ) and post the results.

Mig’s picture

My homepage is accesible at http://192.168.73.200/prueba

I have installed locale and content translation modules.
And I have English and spanish languages, spanish is default language.
The same results with English by default.

Logged in:

The requested URL /prueba/autologout_ajax_get_time_left was not found on this server.

Logged out:

The requested URL /prueba/autologout_ajax_get_time_left was not found on this server. was not found on this server.

I can´t enable testing module, because PHP cURL is not installed and for now i can`t install it.

johnennew’s picture

Mig’s picture

No.
The requested URL /prueba/es/autologout_ajax_get_time_left was not found on this server.
The requested URL /prueba/en/autologout_ajax_get_time_left was not found on this server.

johnennew’s picture

I am at a loss as to what to suggest. I can't imagine how any other module would interfere with standard Drupal menu routing to such an extent that it would cause a path described in a hook_menu to return a 404. Typically, this happens because hook_menu is only called after a cache clear, so if you have stale data in your cache, the routing data will not have been rebuilt yet.

Are there any errors in your watchdog logs? Particularly ones pointing to faults with the cache, menu system or cron? Try running cron from the reports screen and see if cron runs successfully - if not, it could help point towards to cause of the problem.

Mig’s picture

Cron runs succesfully, and there are no errors related to faults with cache, menu system or cron.

johnennew’s picture

Are you able to run SQL commands on your website? Can you paste the result of:

select * from menu_router where path like 'autologout%';
Mig’s picture

StatusFileSize
new443 bytes

I execute the query with pgAdmin, and it retuns three lines, i have attached a csv file with the results.

johnennew’s picture

Looks like Drupal has built the routing items correctly but then does not route the request correctly. Do any of the autologout paths work?

What is the results of going to the following URL in your browser:

http://192.168.73.200/prueba/autologout_ahah_set_last

Mig’s picture

The result is the same:
The requested URL /prueba/autologout_ahah_set_last was not found on this server.

johnennew’s picture

These are all standard paths defined by hook_menu, there is nothing special about autologout here. What happens when you point your web browser to http://192.168.73.200/autologout_ahah_set_last

Mig’s picture

Same result, URL not found.

johnennew’s picture

This is pretty basic Drupal routing. I'm out of ideas, I'll leave the issue open and see if other's can describe how to replicate this.

tdhcom’s picture

Same result, URL not found

johnennew’s picture

Are you getting the Drupal 404 screen or is your web server returning the 404?

johnennew’s picture

johnennew’s picture

I've setup Drupal 7.21, minimum install profile + autologout 4.2 in a subfolder called test and cannot replicate. Any suggestion on how to replicate welcome!

Mig’s picture

With http://192.168.73.200/prueba/?q=autologout_ajax_get_time_left I get the Drupal 404 screen. For previous URLs is the web server 404 page.

Mig’s picture

7.x-2.0-beta1 seems to work well with this setup.

johnennew’s picture

@Mig - can you supply an enabled module list? Since I cannot reproduce this on a vanillia Drupal build I am assuming it must be a conflict with another module. Can you confirm you have no path negotiation problems with any other modules?

Mig’s picture

StatusFileSize
new9.51 KB

For now I have no problems with other modules. I attach a txt file with modules.

dtarrant’s picture

Version: 7.x-4.x-dev » 7.x-4.2

I am seeing the same error with 7.x-4.2 in a fresh install - not an upgrade.

Are there any tests I can perform to help isolate?

johnennew’s picture

Hi @nubay admin - thanks for the report. I cannot replicate this error on a fresh D7 install. These paths are defined via a hook_menu and so the only way they would return a 404 as far as I can tell is if Drupal itself is not routing the call or your web server (apache or otherwise) is not routing the call to Drupal. Some have reported that they just needed to do a cache clear but there have been enough reports saying this is not enough to suggest there is a deeper issue.

I can't really suggest anything to diagnose since it works on a base Drupal install and I cannot imagine anyway that another module would interfere with autologout's hook_menu.

What might be unusual about your setup? Are you using multisite or multi lingual? Is Drupal installed in a subfolder or is it accessible at the domain root? Can you compare you list of enabled modules with the list @Mig provided in #23 to see if there are any obvious matches?

dtarrant’s picture

StatusFileSize
new20.7 KB
new11.21 KB

Only module overlap (other than Core) is Wysiwyg. I disabled that and retried but same result.

Attached files show specific errors that I am receiving.

I have been successfully using autologout-7.x-2.0-beta1.tar.gz in other implementations. Would you suggest I return that that version - if only as a test?

johnennew’s picture

Hi @nuby admin,
Can you tell me what OS your hosting platform is using? Also, what web browser are you using to access the site?

dtarrant’s picture

Using AWS Linux, chrome for browser, Drupal 7.2.2

I reverted to 7.x 2.0 beta and it seems to be working OK now.

I can try a 7.4 version if you think that there is value in isolating which version seems to introduce the problem

dasha_v’s picture

The 404 error may be caused by this module: https://drupal.org/project/m4032404 or similar solution on the server (security reasons). In our case the 404 error was 403 initially, and user has been already logged out. No need in error screen - see patch attached.

johnennew’s picture

Status: Active » Needs review

Thanks @dasha_v - This patch sounds sensible. Is anyone with this issue able to confirm it? I am going to commit to 6.x and 7.x branches anyway since the popup alert is pretty annoying.

johnennew’s picture

Version: 7.x-4.2 » 6.x-4.x-dev
StatusFileSize
new1.64 KB

Patch for 6.x-4.x attached

Metulski’s picture

I have tried the 7.x-4.2 and the later the 7.x-4.x-dev-module on a clean drupal 7.22 core installation (without https) as well as on a ferry7x10alpha3 distribution (with https) but I always had the same trouble with the error dialogs. I got two similar dialogs:

Error 1
An AJAX HTTP error occurred.
HTTP Result Code: 404
Debugging information follows.
Path: /ferry7x10alpha3/autologout_ajax_get_time_left
StatusText: Not Found
ResponseText:
404 - Not Found
404 - Not Found

Error 2
An AJAX HTTP error occurred.
HTTP Result Code: 404
Debugging information follows.
Path: /ferry7x10alpha3/autologout_ahah_set_last
StatusText: Not Found
ResponseText:
404 - Not Found
404 - Not Found

I looked for the files or folders called autologout_ajax_get_time_left and autologout_ahah_set_last but I could not find any of them. Creating folders with these name did not solve this error either.

The Automated Logout moduĺe was installed automatically in /sites/all/modules/autologout/ by both drupal distributions.

Then I have applied the patch 2014473-29-autologout-disable-ajax-error-reporting.patch and the error message was away.

But I still have a critical malfunction:
The "Redirect URL at logout" seems not to work and the and the automatic logout itself does not work, either. If you click on the "Reset Timeout"-Button even after a longer period of time after the remaining time expired you can still reset the timeout and you can continue. The logout only works if you try to go to a different page. Then you get the message You have been logged out due to inactivity. as expected.
By the way I have not seen any message box that shows the text Your session is about to expire. Do you want to reset it? yet.
If the redirection to user/login (or to what else) does work would it be possible to get a simple page refresh to finalize the logout?

johnennew’s picture

Hi @Metulski - as you can see from the thread, there has not been a way for the maintainers to replicate this error. A 404 error from Drupal is caused by a path not being negotiable. Paths are defined by the hook_menu system and autologout is no different from any other module in this regard - it has no special way of routing calls. I cannot understand why a 404 would be sent by drupal on those paths which makes me believe that either there is something before drupal that isn't able to route the call or that in some circumstances the JavaScript builds the wrong URLs to call.

Assuming a problem with the JavaScript, the URLs you provide in the error messages are relative "/ferry7x10alpha3/autologout_ajax_get_time_left". Are you able to view the HTTP requests made by AJAX and see the absolute URL that is being called - does it look correct?

Metulski’s picture

Hi @ceng - although the 7.x-2.0 branch is not supported anymore. I tried the 7.x-2.0 beta 1 and it worked out of the box as reported by Mig (#21), too.
I did not specify any path for "Redirect URL at logout" and the user was redirected to the landing page some seconds after the remaining time expired.

ceng: error messages are relative "/ferry7x10alpha3/autologout_ajax_get_time_left"
I wondered why the root directory /ferry7x10alpha3/ was displayed in the path of the error message. When I use java script/Ajax for example for "datatables.net" it is not necessary to specify the root directory. Something like /sites/all/and_so_on/ would be enough.

But here are some more details about my system:
server: lighttpd 1.4.20 (no https redirection, no mod_rewrite => no clean URLs)
My domain runs on a vhost.

johnennew’s picture

Hi @Metulski, the 7.x-4.x branch is a complete rewrite so there is little to be gained by comparing the two versions.

What is the root URL of your Drupal site? Is it:

http://example.com/ferry7x10alpha3

johnennew’s picture

Version: 6.x-4.x-dev » 7.x-4.x-dev
StatusFileSize
new1.15 KB

Is someone with this issue able to give the attached patch a go on 7.x-4.x branch?

Thanks

Metulski’s picture

Yes the root folder of the drupal site is https://www.example.com/ferry7x10alpha3/

johnennew’s picture

Hi all, the patch in #36 isn't going to solve the issue. @metulski - are you able to check the value of Drupal.settings.basepath on your site. If you are using chrome you can do this by opening the homepage and typing the following into the chrome console:

Drupal.settings.basePath

Metulski’s picture

@ceng
this is the firebug-console output for
>>> Drupal.settings.basePath
"/ferry7x10alpha3/"

johnennew’s picture

So we have come back to the same point. Lets see if we can determine if it is Drupal routing or JavaScript which is at fault.

If you are able to do some debug with me, can you back up your index.php then replace its contents with the following:

<?php
define('DRUPAL_ROOT', getcwd());

require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
print '<pre>';
var_dump($_GET);
die;
menu_execute_active_handler();

Then, in your web browser, goto the autologout callback URL (replacing example.com with your own domain):
http://example.com/ferry7x10alpha3/autologout_ajax_get_time_left

Post the result here then restore your index.php back to how it was.

Metulski’s picture

I have seen that Mig uses a Postgresql database, too. (#10 "I execute the query with pgAdmin...")

I use Postgresql 9.1.5 and php-5.4.13 on SuSe Linux 11.1 .

johnennew’s picture

Though I would not discount anything, a 404 is generally caused by a routing issue. The callbacks are provided by Drupal's standard hook_menu functionality. If you can determine if Drupal is receiving the page request following my instructions in #40 then we can determine if the fault lies inside or outside of Drupal.

lzande’s picture

Version: 7.x-4.x-dev » 7.x-4.2

I solved this problem just by enabling clean URL's.

If you are running a multisite and your end users url is something.something.com/sitename
you need to add this in the main Drupal .htaccess for each site:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/sitename
RewriteRule ^(.*)$ sitename/index.php?q=$1 [L,QSA]

johnennew’s picture

Hi @lzande,

Thanks for sharing this fix.

Is anyone else with this problem able to confirm?

wdouglascampbell’s picture

Yes. This module does not seem to work properly unless Clean URLs is turned on. I would suggest then that the links in autologout.js that call the modules ajax services be modified to include ?q=.

For example:

      Drupal.ajax['autologout.getTimeLeft'] = new Drupal.ajax(null, $(document.body), {
        url: Drupal.settings.basePath  + '?q=autologout_ajax_get_time_left',
        event: 'autologout.getTimeLeft'
      });

There were three places in the code that need such a change and now it works as it should. This should make the module work regardless of whether Clean URLs are in use.

johnennew’s picture

Thanks @wdouglascampbell for the confirmation. Do you know why this is necessary with autologout though - what is it doing so different from everything else in the Drupal ecosystem that it needs to account for non clean URLs?

wdouglascampbell’s picture

@ceng, when you the ajax call to autologout_ajax_get_time_left is given for example as http://example.com/drupalbase/autologout_ajax_get_time_left and you aren't rewriting the URL, you never enter the Drupal ecosystem.

The rewriting of the URLs causes for example, http://example.org/drupalbase/autologout_ajax_get_time_left to http://example.org/drupalbase/?q=autologout_ajax_get_time_left which then causes Drupal to be able to know about it and process it.

Basically, this autologout module has setup a three menu routers. One of these menu routers is autologout_ajax_get_time_left. So when you pass this as the value to the query parameter, the function associated with that menu router gets called.

I hope this is making sense. I am trying to be quick and brief.

wdouglascampbell’s picture

Here is a patch to fix the issue.

Status: Needs review » Needs work

The last submitted patch, fix-ajax-calls-for-sites-with-non-clean-urls-2014473-48.patch, failed testing.

wdouglascampbell’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, fix-ajax-calls-for-sites-with-non-clean-urls-2014473-48.patch, failed testing.

wdouglascampbell’s picture

Not really understanding why it is not passing my patch. There is nothing wrong with it and it applies cleanly. I have tested it manually myself and have followed the instructions given at https://drupal.org/node/707484.

wdouglascampbell’s picture

Okay. Apparently I misread the instructions. I was creating the patch against the development branch not the actual issue branch. Here is the correct patch.

wdouglascampbell’s picture

Status: Needs work » Needs review
StatusFileSize
new1.05 KB

Let's try this again with needs review selected!

johnennew’s picture

Version: 7.x-4.2 » 7.x-4.x-dev
Issue summary: View changes

We should fix this against head - changing issue status

johnennew’s picture

johnennew’s picture

Version: 7.x-4.x-dev » 6.x-4.x-dev
Status: Needs review » Active

Tests passed - tested and working with clean URLs.

Committed and pushed to 7.x-4.x - thanks @wdouglascampbell !

Setting to 6.x-4.x for the back port.

johnennew’s picture

Status: Active » Needs review
StatusFileSize
new1.93 KB

Patch for 6.x-4.x attached.

johnennew’s picture

Status: Needs review » Fixed

committed to 6.x-4.x

Status: Fixed » Closed (fixed)

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

  • Commit 2ff8cbc on 7.x-4.x, 8.x-1.x authored by dasha_v, committed by ceng:
    Issue #2014473 by dasha_v et al: Prevent the popup alert appearing on a...
  • Commit bb9bb3c on 7.x-4.x, 8.x-1.x authored by wdouglascampbell, committed by ceng:
    Issue #2014473 by wdouglascampbell, lzande, Metulski, dasha_v, nubay...