Closed (fixed)
Project:
Automated Logout
Version:
6.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
7 Jun 2013 at 11:46 UTC
Updated:
10 Jun 2014 at 13:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
rapira101 commentedSame problem
Comment #2
johnennew commentedThanks for the bug report. Looks like an issue with Drupal installed in a sub folder.
Comment #3
johnennew commentedOK, 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.
Comment #4
Mig commentedMy 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.
Comment #5
johnennew commentedDo you get a result at either of the following URLs?
http://192.168.73.200/prueba/es/autologout_ajax_get_time_left
http://192.168.73.200/prueba/en/autologout_ajax_get_time_left
Comment #6
Mig commentedNo.
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.
Comment #7
johnennew commentedI 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.
Comment #8
Mig commentedCron runs succesfully, and there are no errors related to faults with cache, menu system or cron.
Comment #9
johnennew commentedAre you able to run SQL commands on your website? Can you paste the result of:
Comment #10
Mig commentedI execute the query with pgAdmin, and it retuns three lines, i have attached a csv file with the results.
Comment #11
johnennew commentedLooks 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
Comment #12
Mig commentedThe result is the same:
The requested URL /prueba/autologout_ahah_set_last was not found on this server.
Comment #13
johnennew commentedThese 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
Comment #14
Mig commentedSame result, URL not found.
Comment #15
johnennew commentedThis 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.
Comment #16
tdhcom commentedSame result, URL not found
Comment #17
johnennew commentedAre you getting the Drupal 404 screen or is your web server returning the 404?
Comment #18
johnennew commented@Mig, What happens at:
http://192.168.73.200/prueba/?q=autologout_ajax_get_time_left
Comment #19
johnennew commentedI'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!
Comment #20
Mig commentedWith 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.
Comment #21
Mig commented7.x-2.0-beta1 seems to work well with this setup.
Comment #22
johnennew commented@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?
Comment #23
Mig commentedFor now I have no problems with other modules. I attach a txt file with modules.
Comment #24
dtarrant commentedI 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?
Comment #25
johnennew commentedHi @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?
Comment #26
dtarrant commentedOnly 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?
Comment #27
johnennew commentedHi @nuby admin,
Can you tell me what OS your hosting platform is using? Also, what web browser are you using to access the site?
Comment #28
dtarrant commentedUsing 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
Comment #29
dasha_v commentedThe 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.
Comment #30
johnennew commentedThanks @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.
Comment #31
johnennew commentedPatch for 6.x-4.x attached
Comment #32
Metulski commentedI 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?
Comment #33
johnennew commentedHi @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?
Comment #34
Metulski commentedHi @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.
Comment #35
johnennew commentedHi @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
Comment #36
johnennew commentedIs someone with this issue able to give the attached patch a go on 7.x-4.x branch?
Thanks
Comment #37
Metulski commentedYes the root folder of the drupal site is https://www.example.com/ferry7x10alpha3/
Comment #38
johnennew commentedHi 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.basePathComment #39
Metulski commented@ceng
this is the firebug-console output for
>>> Drupal.settings.basePath
"/ferry7x10alpha3/"
Comment #40
johnennew commentedSo 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:
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.
Comment #41
Metulski commentedI 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 .
Comment #42
johnennew commentedThough 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.
Comment #43
lzande commentedI 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]
Comment #44
johnennew commentedHi @lzande,
Thanks for sharing this fix.
Is anyone else with this problem able to confirm?
Comment #45
wdouglascampbell commentedYes. 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:
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.
Comment #46
johnennew commentedThanks @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?
Comment #47
wdouglascampbell commented@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.
Comment #48
wdouglascampbell commentedHere is a patch to fix the issue.
Comment #50
wdouglascampbell commented#48: fix-ajax-calls-for-sites-with-non-clean-urls-2014473-48.patch queued for re-testing.
Comment #52
wdouglascampbell commentedNot 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.
Comment #53
wdouglascampbell commentedOkay. Apparently I misread the instructions. I was creating the patch against the development branch not the actual issue branch. Here is the correct patch.
Comment #54
wdouglascampbell commentedLet's try this again with needs review selected!
Comment #55
johnennew commentedWe should fix this against head - changing issue status
Comment #56
johnennew commented48: fix-ajax-calls-for-sites-with-non-clean-urls-2014473-48.patch queued for re-testing.
Comment #57
johnennew commentedTests 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.
Comment #58
johnennew commentedPatch for 6.x-4.x attached.
Comment #59
johnennew commentedcommitted to 6.x-4.x