Unable to Connect to SMF for Latest News File

Started by Colin, March 04, 2013, 10:38:46 PM

Previous topic - Next topic

Colin

Howdy,

On a client's forum they are getting the "You are unable to connect to simplemachines.org's latest news file." There is nothing in the server error log, but in the dev console I am seeing

Resource interpreted as Script but transferred with MIME type text/plain: "chrome-extension://cpngackimfmofbokmjmljamhdncknpmg/page_context.js". page.js:852
page.injectJavaScriptResource page.js:852
page.init page.js:869
(anonymous function) page.js:887


It works on other themes so it is the default theme files. With my javascript skills I could sure use some help.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Arantor

It's not the default theme file as such. The error refers to a Chrome extension, looking at the URL it would appear to be some kind of screen capture. The JS has some kind of issue which causes all later JS to break (the 'unable to connect' message is hard written into the template and is replaced with JS later on, it's complicated)

Colin

Thanks Arantor,

I didn't think much about the extension part. I removed the extension and that series of errors went away, but I suppose we are back at square one. Manually executing the task from the scheduled tasks does work though. With zippo errors in the server error log or forum error log I am not sure where this one is coming from.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

Arantor

I guess I'll have to explain to how it works so that you can continue debugging.

Firstly, the maintenance task. This fetches several JS files from sm.org and stores them into smf_admin_info_files, completely.

Secondly, when you go to the admin panel, it includes a call to load those JS files, through action=viewsmfile.

Thirdly, the JS runs and injects the content into the page, putting the right news into the page, replacing the preset wording "Unable to connect to SMF..."

If the maintenance task runs correctly and there's no errors in the admin panel, that means step 1 worked. If smf_admin_info_files has content, that means step 2 worked (and step 1 reperforming step one would fix step 2)

That leaves step 3. You have some rogue JS in there somewhere causing an error and that should be where you should look.

Colin

Thanks for taking the time to write that out Arantor. That makes sense. I will take a deeper look.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

user1234

#5
I've had an excellent experience with SimpleMachines with one forum for years now. In spite of the warnings from a couple members in here I have been able to remain blissfully ignorant to the inner workings of SMF software, as well as html code for my websites, since I use software that lets me write and simply push a button to publish, and not waste time with putting in the code tags and such.

I recently decided to open another forum, and acquired the SMF 2.0.4 version with a one-click "Simple Scripts" button at hostmonster.com (who I also love along with you guys).
My new forum has this "Unable to Connect to SMF for Latest News File" failure message of the OP of this thread.

Over the last two days I've read through a couple of threads on this subject in here and tried going to > scheduled tasks > Fetch Simple Machines Files
and check the box for manual and "run now" and I immediately get the message in a green block:
"All selected tasks were completed"

I downloaded a third forum, from the same host, also with Simple Scripts, and that works just fine. Interestingly the version Simple Scripts loaded was 2.0.2, which may have made the difference.

I upgraded with the package manager twice and now that forum (my #3 forum) is 2.0.4 and still communicates with SMF just fine.

Could I do something like download the cPanel file from the file manager, or the database, and search out the germane section in one of these that works, and copy and paste it into the same section of the one that doesn't work?
I don't even know what to look for in the database.

I even did a fourth forum on another website also at hostmonster with Simple Scripts and that also works just fine. (however it also installed as a 2.0.2)
So I think it's safe to say that it isn't a server problem at my host, however these three different sites are not likely located on the same server.

I guess I am just asking which file in my public_htm folder do I look in, and what do I change?

Or how about this? Should I put the "repair_settings.php" file in my public_html cPanel folder and go to mysite/index.php/repair_settings.php and go through that list of files clicking to the suggested defaults? "localhost" etc.?

Colin

Look in the browser's console when loading the page. Anything showing up?

"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

user1234

Quote from: Colin on March 12, 2013, 02:08:22 PM
Look in the browser's console when loading the page. Anything showing up?
Not sure what you are asking me to look at. (nothing like a "prevented popup" or anything like that)
I use the same browser (firefox) which successfully loads, and logs me into my admin section, and connects to SMF for my #1, #3 and #4 forums (#3 and #4 forums with the same host as my non-functioning #2)

Arantor

As per reply #3, the 'fetch SM files' fetches some JavaScript from the main server here and displays it in your browser. The fetching may have occurred successfully but the displaying may not due to some other issue, but checking the browser console is the only way to know for sure.

Colin

Install the firebug addon and look at the console tab when you load the main admin page on the problematic forum.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

user1234

Quote from: Colin on March 12, 2013, 02:18:55 PM
Install the firebug addon and look at the console tab when you load the main admin page on the problematic forum.

My package manager won't connect, so should I download "firebug" and upload it to the forum at my host?

Arantor

Firebug is an addon for Firefox, not for your forum.

user1234

Quote from: Arantor on March 12, 2013, 02:20:36 PM
Firebug is an addon for Firefox, not for your forum.
Thanks will do. But why would it not be needed for the 2 that work? Should I just try it in internet explorer instead?

Arantor

-sigh-

As already explained, it's for figuring out what's going wrong so it can be dealt with...

user1234

#14
Quote from: Colin on March 12, 2013, 02:18:55 PM
Install the firebug addon and look at the console tab when you load the main admin page on the problematic forum.
Pretty nifty tool. It says:

SyntaxError: syntax error
[Break On This Error]  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//E

And when I click on that link there are a lot of lines of code. In line 1-3 I see (in red where I indicate):

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>



Then a little further down in lines 16-20 (I presume this isn't an error, but an error message that is sent to guests or members when an error occurs):

// ]]></script>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="description" content="An Error Has Occurred!" />
<title>An Error Has Occurred!</title>
<meta name="robots" content="noindex" />




As I go down the page in line 44 to 49 I see in red where I indicate:


</div>
         <div class="news normaltext">
            <form id="search_form" action="http://www.mysite.com/index.php?action=search2" method="post" accept-charset="ISO-8859-1">
               <input type="text" name="search" value="" class="input_text" />&nbsp;
               <input type="submit" name="submit" value="Search" class="button_submit" />
               <input type="hidden" name="advanced" value="0" /></form>

</div>
<div class="news normaltext">
<form id="search_form" action="http://www.mysite.com/index.php?action=search2" method="post" accept-charset="ISO-8859-1">
<input type="text" name="search" value="" class="input_text" />&nbsp;
<input type="submit" name="submit" value="Search" class="button_submit" />
<input type="hidden" name="advanced" value="0" /></form>



and in lines 231-232 another in red that reads:


<span class="smalltext" style="display: inline; visibility: visible; font-family: Verdana, Arial, sans-serif;"><a href="http://www.mysite.com/index.php?action=credits" title="Simple Machines Forum" target="_blank" class="new_win">SMF 2.0.4</a> |
<a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF &copy; 2013</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>

<span class="smalltext" style="display: inline; visibility: visible; font-family: Verdana, Arial, sans-serif;"><a href="http://www.mysite.com/index.php?action=credits" title="Simple Machines Forum" target="_blank" class="new_win">SMF 2.0.4</a> |
<a href="http://www.simplemachines.org/about/smf/license.php" title="License" target="_blank" class="new_win">SMF &copy; 2013</a>, <a href="http://www.simplemachines.org" title="Simple Machines" target="_blank" class="new_win">Simple Machines</a>

         

user1234

#15
Quote from: user1234 on March 12, 2013, 02:59:10 PMAs I go down the page in line 44 to 49 I see in red where I indicate:


</div>
         <div class="news normaltext">
            <form id="search_form" action="http://www.mysite.com/index.php?action=search2" method="post" accept-charset="ISO-8859-1">
               <input type="text" name="search" value="" class="input_text" />&nbsp;
               <input type="submit" name="submit" value="Search" class="button_submit" />
               <input type="hidden" name="advanced" value="0" /></form>

</div>
<div class="news normaltext">
<form id="search_form" action="http://www.mysite.com/index.php?action=search2" method="post" accept-charset="ISO-8859-1">
<input type="text" name="search" value="" class="input_text" />&nbsp;
<input type="submit" name="submit" value="Search" class="button_submit" />
<input type="hidden" name="advanced" value="0" /></form>


I found this item in my "Themes\core\index.template.php" folder.
With firebug having highlighted it in red does that mean I should just eliminate it, or do something else with it?
Or is it completely irrelevant?

Colin

You are looking at the wrong tab. Select the console module once you open firebug.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

user1234

Quote from: Colin on March 12, 2013, 07:12:50 PM
You are looking at the wrong tab. Select the console module once you open firebug.
In order to select console (on the console) I have to select at least 1 of 6 choices to the left of it (HTML, CSS, Script, DOM, Net and Cookies)
I selected them all.
Then in the menu to the right of the console button, in which I select "enable", there are 14 menu choices beginning with "Show JavaScript Errors" etc. etc.
I selected them all.
_____________________

When I log in to the forum, under the console "error" tab, I get the syntax error mentioned previously as well as:

TypeError: this.showContextMenu is not a function
[Break On This Error]    
Filtered chrome url chrome://y2layers/content/overlay.js                    overlay.js (line 34)

When I click on that link it highlights a line in blue:

            .addEventListener("popupshowing", function(e) { this.showContextMenu(e); }, false);

After a while the "error" tab also added the following error a bunch of times:

aRequest.URI is undefined
[Break On This Error]    
Filtered chrome url chrome://y2layers/content/overlay.js
overlay.js (line 366)

Clicking on it I get:

            if (aRequest.URI.host != "api.yontoo.com")

Still later I get another error:

Error: Permission denied to access property 'toString'

[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIURI.host]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://y2layers/content/overlay.js :: <TOP_LEVEL> :: line 366" data: no]

Clicking on it highlighted in blue I get:

                  Components.utils.reportError(e);
__________________________

Under the "warnings" tab I get these:

Use of Mutation Events is deprecated. Use MutationObserver instead.
[Break On This Error]    
Filtered chrome url chrome://firebug/content/chrome/tabContext.js
tabContext.js (line 589)
<System>

ReferenceError: assignment to undeclared variable oImage
[Break On This Error]    
for (oImage in oImages)
theme.js?fin20 (line 26)

TypeError: anonymous function does not always return a value
[Break On This Error]    
...Y2",payload:null}},isFacebook=function(){try{return window.content.location.host...
overlay.js (line 221, col 60)
   

TypeError: variable a redeclares argument
[Break On This Error]    
...or=function(a){var c=new XMLHttpRequest,a="[url="http://api.yontoo.com/sl?message="+en..."]http://api.yontoo.com/sl?message="+en...[/url]
overlay.js (line 223, col 60)
   

TypeError: anonymous function does not always return a value
[Break On This Error]    
getCookie=function(a){try{var c=document.cookie.split(";"),b="",e="",g="";for(i=
overlay.js (line 228, col 21)
   

TypeError: anonymous function does not always return a value
[Break On This Error]    
...c){}},isLocalStorageAvailable=function(){try{var a=!1;window.content.localStorag...
overlay.js (line 229, col 60)
   

TypeError: variable a redeclares argument
[Break On This Error]    
...}},loadY2ClientData=function(a){try{var a=localStorageAvailable==!0?"http://api....
overlay.js (line 229, col 60)
   

TypeError: anonymous function does not always return a value
[Break On This Error]    
...l"){var localStorageAvailable=function(){try{var a=!1;window.content.localStorag...
overlay.js (line 236, col 60

Colin

That's better, temporarily disable your chrome extensions and reload and report the errors.
"If everybody is thinking alike, then somebody is not thinking." - Gen. George S. Patton Jr.

Colin

user1234

#19
Quote from: Colin on March 13, 2013, 06:16:50 AM
That's better, temporarily disable your chrome extensions and reload and report the errors.

Using the same browser I get no errors logging into my other forums.
(though I get similar "warnings")
_______________________

Maybe I don't know how to "disable chrome extensions"

When I go to tools > add-ons > extensions

I only have download helper, firebug, and Yontoo (which I presume is part of the problem since that name showed up in one of the errors)
Disabled it.
(However there isn't anything about Chrome in my add-ons)
(and I did close all my browser windows and restart firefox)

Now it only shows the syntax error and a few minutes later:

Error: Permission denied to access property 'toString'
______________________

Thought I would bump it by selecting "package manager > browse packages

and again the syntax error arrives quickly.

Log out and log back in and two syntax errors arrive long before anything else. Still waiting.....
_____________________

Under "warnings"

Use of Mutation Events is deprecated. Use MutationObserver instead.
[Break On This Error]    
Filtered chrome url chrome://firebug/content/chrome/tabContext.js
tabContext.js (line 589)
<System>

ReferenceError: assignment to undeclared variable oImage
[Break On This Error]    
for (oImage in oImages)
theme.js?fin20 (line 26)

Advertisement: