Some parts of the Rails page doesn't render randomnly? - ruby-on-rails

Using Rails 3.2.11 and finding this weird issue.
When the page is rendered, header partial is displayed and even the footer is also displayed in the browser. And the form/content doesn't get rendered and shown blank.
If the page is refreshed then the whole page is displayed.
The weird thing is that it doesn't happen always. It happens rarely which I'm finding kinda lost to debug and its even hard to reproduce.
What might be wrong of how can I debug this weirdness?
Any help would be much appreciated!!!

Related

Partials Not Rendering in Safari Only - Rails

I use "inspect" on Safari to see why... and the HTML is all there, but it just isn't visible. It is the weirdest thing to me. Works flawlessly in Chrome. I haven't encountered this before, so I am at a loss on how to debug this. Could anybody point me in a direction so I can try to debug? HTML is all there, but looks blank inside the browser. I can provide code if it helps?

Umbraco 6 - Published page throws 404 in specific scenarios

I am running an instance of Umbraco 6.1.x and it has started throwing 404 on published pages.
My page structure is as follows,
Content
Home
About
Course
...
Component
Home
About
Course
Where component holds all resources and modules (HTML sections and stuff) for a page and using a partial view macro I dynamically load all components at runtime for a specific page.
We are facing an issue where we get 404 on every page after a full republish once we hit the HomePage. Before hitting home page they are all fine, but the moment we hit the homepage they are all throwing 404. By overriding the handlers I found out that they are hitting ~/umbraco/RenderMvc!
Any idea what can cause this?
Thanks in advance.
EDIT:
It is actually throwing:
No template exists to render the document at url '/'
considering the aforementioned scenario.
I have proper allowed template setup and property on nodes are showing the correct template associated with the respective items. Not sure why it's losing template info. I can force it to load under correct template using ?altTemplate=templateName.
Some pointers, we have a view in Views/Shared folder (apart from macro partials) tied to a surface controller.
One thing I would like to say is, we are using nested (library.RenderMacroContent with Umbraco markup) in our partial views and I have realized that the whole page throws 404 if there's a page with a link to the broken page which is broken (i.e. page got re-created and on t==e of the components is holding a link to the page with previous id). Suggestions?
did you get to the bottom of this? We're having exactly the same problem at the moment, on the same version of Umbraco.
I've noticed that when it happens, the umbraco.config becomes either corrupt or rolls back to a much, much earlier version, with all sorts of attributes missing. This lead us to believe it was a sync issue between the DB and umbraco.config.
We initially thought we had solved it by deleting App_Data > TEMP > ExamineIndex and recycling the app pool etc. Maybe give this ago, as it fixed it for a while for us, but alas, the demon has reared its ugly head once more. We are still in a full on dev stage though, so the constant changing may be complicating it further for us - perhaps it will be a fix for you.
If you have any more info, or even a fix, it would be greatly appreciated.
Cheers
EDIT:
Ok, I think I've solved this now, but only time will tell. Try emptying your recycle bin & then republish entire site.
I managed to consistently recreate the bug using IIS SEO site analysis. Each time I did this, the log threw up an error 'cannot find node id xyz', turns out that (and other) nodes were in the recycle bin. Upon emptying it the errors stopped. Good luck!

Google Analytics MIME type issue in Chrome using Rails 3

I'm adding GA to a Rails 3 app, which would normally be extremely simple, of course. I've added the GA JS snippet, which is rendering just fine. Everything works perfectly in Safari. In Chrome, however, it's giving me a console error: Resource interpreted as Script but transferred with MIME type text/html: "about:blank", pointing to the JS line that loads the ga.js file: s.parentNode.insertBefore(ga, s). Some things I've investigated:
I created a plan HTML page with the JS snippet, and it loads outside Rails in Chrome with no error.
The same HTML page, when put in /public, gives the error above.
The same HTML page, loaded in Safari from /public, doesn't give any error according to Firebug.
I tried the GA Debug extension in Chrome, but it remains silent, because ga.js isn't getting loaded.
Looking at the developer console in Chrome, I see a request for "http://www.google-analytics.com/ga.js" that seems to stay in "pending" state, and a redirect to "about:blank" seemingly initiated by http://www.google-analytics.com/ga.js, which makes very little sense.
So this seems to be related to Rails (since the snippet works in the HTML outside Rails), and doesn't affect Safari, but other than that I'm stumped. Hopefully I've just been staring at it wrong, and someone else will point out the obvious to me...? Anyone come across this before? Any ideas will be very much appreciated.
Came across this issue myself. "Disconnect" disabled share buttons on my site (g+, twitter and fb). Had to remove it to view the site properly.

Why does SIFR rendering this page in Chrome as a blank page?

In chrome - http://unitonenine.com/ loads for a few seconds that changes into a blank white page. This site was working fine up until a few months ago.
Upon inspection it just loads the 2 swf files. In FireFox it loads just fine.
Any thoughts?
I posted some information regarding the same bug that seems to be removed. So I poked around the javascript source for sifr r436 and discovered as was mentioned here:
http://discuss.joyent.com/viewtopic.php?id=24243
That there was an issue with the prefetch function and indeed commenting the prefetch function out fixes the problem. I looked at the site linked above and this is not their solution. I have not been able to figure out how they resolved it, the prefetch function is unchanged on their site. So removing the prefetch would make this problem go away, however it is important to know that this will slow total page load time by putting off calling the flash file until after the rest of the page loads.

Rails Partial rendering results in a blank page?

I'm stuck with a bug at the moment which is puzzling me. I have a
layout containing some HTML and a partial (for the navigation) - there
is nothing else there other than the yield.
If the nav is included as a partial I get nothing returned to the
browser at all (blank page) but everything else appears normal
If I remove the partial the page works fine
If I put the nav code directly in the template it works fine
if I replace the nav code in the partial with a simple string, I get
a blank page again.
Does anyone have any ideas as to what the problem could be, or know how
I might debug it?
Found the issue, the partial was in the layouts folder, instead of the
relevant controller views folder.
However, Rails was throwing a ActionView::MissingTemplate Exception
which was only visible via the debugger which is probably a bug.
First off, check the log file to see if you're getting an error message somewhere. If that doesn't help follow these steps:
Make a copy of your template & partial, linked as the original
Test that they exhibit the problem
Start removing things from them until you have the simplest possible case that still exhibits the problem (your string in the partial test is a step in this direction)
If you don't figure it out in that process, come back and edit your question to include the code for the simplified case
I have had this error on a number of occasions. The problem has always been solved by changing something in the offending template or one of it's partials (in my latest case, I added a blank line into the source between a </div> and a <div>, which was in a partial invoked by the template; changing the template itself had no effect). The really odd thing is that the problem rarely occurs when I actually change a template, but usually when I change something related (e.g. edit an image displayed in the page or the CSS relating to the page). While the problem is often related to a partial, the entire page is blank, not just the portion provided by the partial.
BTW, restarting the web server (in this case Unicorn) does not fix the problem. Running Ruby 1.9.3, Rails 3.1.3. Using SASS and Unicorn.
UPDATE: Just determined that Rails is returning a 304-not modified, based upon the "If-none-match" header sent by my browser (which in turn was based upon the ETAG of the previous page). However, in the meantime, the browser cleared the window. So, presumably, something in what Rails sent caused the browser to clear the window.

Resources