Computer or server time out of sync by

zmippie

Verified User
Joined
Apr 19, 2015
Messages
160
This looks like code leaking into the front-end. Haven't seen this before, it's not happening anymore. Anyone know what caused it?
 

Attachments

  • outofsync.jpg
    outofsync.jpg
    339.1 KB · Views: 168
Hello,

Are clocks on the both server and your network device correct, i.e. synced with the global clocks?

In what browser do you see the error? Did you try different browser?

JavaScript enabled? Disabled in browser?
 
Hello,

Are clocks on the both server and your network device correct, i.e. synced with the global clocks?

In what browser do you see the error? Did you try different browser?

JavaScript enabled? Disabled in browser?


I'm not sure about the browser, I didn't actually see this happen. One of my users did. The garbage showed only once. The clock is automatically synced.
I assume it was caused by the date at the bottom of the login screen, but I'm surprised to see so many errors (or code?) barfed to the output.
 
Actually the JavaScript goes after closing tag </html>, so probably the browser is too old or probably too new... So it would be useful to know its name and version:

HTML:
 </body></html><script language="JavaScript">computer_time=Math.floor(Date.now()/1000); server_time=1495644684; time_diff=Math.abs(computer_time-server_time); if (time_diff>432000) { document.getElementById('outofsync').innerHTML='Computer or server time out of sync by '+(Math.round(100*time_diff/3600)/100)+' hours.';}</script>

When checking it here: https://validator.w3.org/ it reports "Validation Output: 8 Errors", and among them you can find:

Line 25, Column 30: document type does not allow element "SCRIPT" here

HTML:
<script language="JavaScript">computer_time=Math.floor(Date.now()/1000); server…

The element named above was found in a context where it is not allowed. This could mean that you have incorrectly nested elements -- such as a "style" element in the "body" section instead of inside "head" -- or two elements that overlap (which is not allowed).


One common cause for this error is the use of XHTML syntax in HTML documents. Due to HTML's rules of implicitly closed elements, this error can create cascading effects. For instance, using XHTML's "self-closing" tags for "meta" and "link" in the "head" section of a HTML document may cause the parser to infer the end of the "head" section and the beginning of the "body" section (where "link" and "meta" are not allowed; hence the reported error).
 
Actually the JavaScript goes after closing tag </html>, so probably the browser is too old or probably too new... So it would be useful to know its name and version:

That's some good investigation work you did there, Alex ;)

I've asked, and the browser was Safari 10.1 on macOS 10.12.4. But if it happened because of errors in the HTML output, then I guess it would be reproducible. Which is isn't. So it remains mysterious why this happened.
I tried reloading the page with JavaScript turned off, but it makes no difference either.
 
Back
Top