Using: http://drupal.org/project/facebook_status

My facebook_status page view (ie. individual user status page view) currently gives "An error occurred at views/ajax" when attempting to switch page. The general status page at facebook_status_recent does not give the same error and works perfectly.

I can't figure out why as they use more or less the same settings.

The only other even slightly similar seeming instance I found of this was a permissions bug here:
http://drupal.org/node/408894

I have ensured permissions are set up and tried changing the access option for the problematic view to 'access content' with no help. I have cleared cache and tried different themes.

Furthermore, if I right click the page link and copy/paste it into my address bar it will load the next page perfectly, so I know it is getting the right links. I just can't click them directly.

Why does AJAX give this error? Any ideas or ways I can debug this?

Thanks.

Comments

uomeds’s picture

I checked the error logs and they seem to be registering as 406 page not found. When I try going to the link they are trying to reach I also get Page Not Found.

So for some reason my Ajax is looking for a wrong address on that view. From the link it's requesting below, any idea why or where I should go from here?

Type	page not found
Date	Tuesday, August 18, 2009 - 11:17
User	uomeds
Location	WEBSITE/views/ajax?view_name=facebook_status&view_display_id=page_1&view_args=1&view_path=user%2F1%2Fstatus&view_base_path=user%2F%25%2Fstatus&view_dom_id=1&pager_element=0&page=1
Referrer	WEBSITE/user/1/status
Message	406.shtml
Severity	warning

(I added WEBSITE to the link above so it would read properly here)

Thanks again.

edit: It appears 406 is typically a server setup issue usually with Apache mod_security. Checking with my host now.

uomeds’s picture

Just for the archives in case someone else has this issue, I contacted my host requesting they disable mod_security.

They replied:

"We have got the following error in the error logs.

=====================
[Tue Aug 18 12:43:32 2009] [error] [client 99.225.189.34] ModSecurity: Access denied with code 406 (phase 2). Pattern match "\%(?![0-9a-fA-F]{2}|u[0-9a-fA-F]{4})" at ARGS:view_base_path. [file "/usr/local/apache/conf/modsec2.user.conf"] [line "20"] [id "950107"] [msg "URL Encoding Abuse Attack Attempt"] [severity "WARNING"] [hostname "WEBSITE.com"] [uri "/views/ajax"] [unique_id "SoraNEYh9woAAAjOdz0AAAAH"]
=====================

To fix this we have disabled that mod sec rule for the URI "/views/ajax". Kindly check now."

It now works perfectly.

uomeds’s picture

Status: Active » Fixed

fixed

twod’s picture

I also had this problem on one of my sites, but only in Firefox (IE worked fine for once).
It also happened with the AJAX code from CTools.

A simple fix made it work, insert a space in the data property in all ajaxSubmit calls (views/js/ajax.js). Seems something goes wrong when Firefox tries to POST an empty string.

That host is also running mod_security2, which means it can't be turned off in .htaccess, so you'd have to contact the host like uomeds did.

Status: Fixed » Closed (fixed)

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

spangaroo’s picture

Status: Closed (fixed) » Active

I'll add my issue here as it's exactly the same: "An error occurred at /views/ajax."

I contacted my webhost and they suggested that I put this code in my .htaccess to prevent the 406 error:

<IfModule mod_security.c>
# Turn off mod_security filtering.
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

Unfortunately, my error log shows that I'm still getting the 406.

page not found
Date	Wednesday, October 21, 2009 - 11:06
User	spangaroo
Location	WEBSITE/views/ajax?view_name=feeds_flickr&view_display_id=block_1&view_args=&view_path=front&view_base_path=node%2F%25%2F1318&view_dom_id=2&pager_element=0&page=1
Referrer	WEBSITE
Message	406.shtml
Severity	warning

I have ajax working with views and panels in another section of the site and there is no problem there.

The 2 sections where the error occurs is "Slideshow" and "Video" on my front page (Flexible Panel). Those views were built using FeedAPI fields.

When I built this locally on my MAMP environment, everything was fine so it might be a problem with my webhost.

If anyone has encountered a similar issue or has any idea how to fix, please let me know. I'll update with info from the webhost if they find a solution.

spangaroo’s picture

Status: Active » Closed (fixed)

Just to give an update, this was the reply from my webhost.

"The modsecurity rule present in the server was blocking the pattern which resulted in the error. Mod_security cannot be disabled globally as the domain residing in a shared environment, so I had to tweak the setting for this domain alone so that the rule could be bypassed.

But please note, disabling mod_security for the domain decreases the level of security of your website. So you can go for a plan upgrade, if needed so that you can tweak the settings as per your wish.

Anyway, this issue should be resolved by now. I request you to check the status from your end after clearing the browser cache and cookies or using a different browser."

Everything is up and running so glad that's fixed. As mentioned in this comment, I'm not too concerned about the mod_security setting being turned off but will report back if there are any bizarre twists.

WSRyu’s picture

#6 worked for me, check here: http://drupal.org/node/452384