Ajax error clearing notifications/cookies

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Ajax error clearing notifications/cookies

Post by nhseacoast »

When clearing notifications or the boards cookies..I get the following error:

AJAX error

Something went wrong with the request and the server returned an invalid reply.


Any ideas?
Thank you.
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
janus_zonstraal
Registered User
Posts: 6414
Joined: Sat Aug 30, 2014 1:30 pm

Re: Ajax error clearing notifications/cookies

Post by janus_zonstraal »

Take a look at your server error logs and find out if there's anything about it in there. These are usually available in your host's control panel. If not, then ask your host to look for you.
Sorry! My English is bat ;) !!!
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: Ajax error clearing notifications/cookies

Post by nhseacoast »

There are no error log entries. What could this problem be?
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: Ajax error clearing notifications/cookies

Post by nhseacoast »

janus_zonstraal wrote: Wed Sep 13, 2017 5:58 pm Take a look at your server error logs and find out if there's anything about it in there. These are usually available in your host's control panel. If not, then ask your host to look for you.
I was told by my host that it is a scripting issue. Are there known extensions that could cause this to happen?
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26456
Joined: Fri Aug 29, 2008 9:49 am

Re: Ajax error clearing notifications/cookies

Post by Mick »

I don’t know about ‘known’ extensions but generally disabling them one at a time until the error goes away will find the culprit if it is an extension issue.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: Ajax error clearing notifications/cookies

Post by nhseacoast »

Mick wrote: Thu Oct 19, 2017 1:23 pm I don’t know about ‘known’ extensions but generally disabling them one at a time until the error goes away will find the culprit if it is an extension issue.
I tried this and the error still exists. Could this be a PHP setting?
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
kasimi
Former Team Member
Posts: 4900
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Ajax error clearing notifications/cookies

Post by kasimi »

When debug mode is enabled, more details about the error are printed to the browser console.

How to enable debug mode: open config.php, find // @define('DEBUG', true); and remove the //. If you can't find it, add @define('DEBUG', true); at the bottom of the file. Don't forget to undo these changes afterwards.
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: Ajax error clearing notifications/cookies

Post by nhseacoast »

Thank you. I made the change, but not sure where to find the error info? I'm using Firefox.
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: Ajax error clearing notifications/cookies

Post by nhseacoast »

Found it. The debugger. Duh.

Here it is:
AJAX error. status: parsererror, message: SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
kasimi
Former Team Member
Posts: 4900
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Ajax error clearing notifications/cookies

Post by kasimi »

Hit Ctrl+Shift+E (on Mac it's Cmd+Option+E) to open the Network tool, trigger the error and click on the failed request. In the panel on the right, there's a Response tab with the data returned from the server. I suspect you will find the actual error message that the server produces there.
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: Ajax error clearing notifications/cookies

Post by nhseacoast »

This is what I get.

{"MESSAGE_BODY":"\t<form action=\".\/ucp.php?_=1508504487895&amp;mode=delete_cookies&amp;confirm_key=26OUPYMKHD\" method=\"post\">\n\t\t<h3>Delete all board cookies<\/h3>\n\t\t<p>Are you sure you want to delete all cookies set by this board?<\/p>\n\n\t\t<fieldset class=\"submit-buttons\">\n\t\t\t<input type=\"button\" name=\"confirm\" value=\"Yes\" class=\"button2\" \/>&nbsp;\n\t\t\t<input type=\"button\" name=\"cancel\" value=\"No\" class=\"button2\" \/>\n\t\t<\/fieldset>\n\t<\/form>\n\n","MESSAGE_TITLE":"Delete all board cookies","MESSAGE_TEXT":"Are you sure you want to delete all cookies set by this board?","YES_VALUE":"Yes","S_CONFIRM_ACTION":".\/ucp.php?_=1508504487895&mode=delete_cookies&confirm_key=26OUPYMKHD&confirm_uid=2&sess=9dfbc54827a7926ebb72a10e7b3aabb9&sid=9dfbc54827a7926ebb72a10e7b3aabb9","S_HIDDEN_FIELDS":"<input type=\"hidden\" name=\"confirm_uid\" value=\"2\" \/>\n<input type=\"hidden\" name=\"sess\" value=\"9dfbc54827a7926ebb72a10e7b3aabb9\" \/>\n<input type=\"hidden\" name=\"sid\" value=\"9dfbc54827a7926ebb72a10e7b3aabb9\" \/>\n"}

Also, I don't get prompted for a Yes or No.
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: Ajax error clearing notifications/cookies

Post by nhseacoast »

BTW...I get the same pop-up error when clearing notifications.
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
kasimi
Former Team Member
Posts: 4900
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Ajax error clearing notifications/cookies

Post by kasimi »

That's valid JSON. The only thing I can think of now is that there's an invisible BOM that the JSON parser doesn't like. Go back to the Response tab and make sure there's no space character before the very first {. If there is, you have probably edited a file with a text editor that added a BOM.
User avatar
nhseacoast
Registered User
Posts: 625
Joined: Sun Sep 22, 2002 10:31 pm
Location: NH, USA
Contact:

Re: Ajax error clearing notifications/cookies

Post by nhseacoast »

I have this. Could the red dot indicate where the error is? Whitespace perhaps??
Capture.PNG
Capture.PNG (9.9 KiB) Viewed 905 times
http://nhgunforum.com phpBB v3.2.1
http://wtprise.org phpBB v3.3.2
User avatar
kasimi
Former Team Member
Posts: 4900
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: Ajax error clearing notifications/cookies

Post by kasimi »

Yes, that's most likely a BOM. Did you make manual changes to any files?
Post Reply

Return to “[3.2.x] Support Forum”