Discourse site loads via IP but via domain only header

Hi guys

Anyone aware of an issue that prevents a site from loading over the domain? only the Header loads. But If i try to load via the IP of the vps everything works just fine?

Thanks

Did you configure the correct domain in app.yml?

1 Like

Happy happy birthday! and thanks for your time

It is set correctly, any other ideas? randomly it will load the site but most of the time just the header. yet the site over IP loads perfectly. it was working fine for over 2 years now…

Could it be an issue with cloudflare?

1 Like

That would explain it. Best to turn off the orange cloud. Else, you will need to turn off various speed-up things until it starts working.

1 Like

Cloud was originally on and the site worked. Now its just loading the header only. but on IP its fine which explains a domain issue. Any ideas though? . If i turn the cloud off the site gives an insecure error

Update, disabling cloudflare does not resolve the issue unfortunately.

Have you checked the error console in your browser for hints as to how it’s failing?

2 Likes

Yes, there are a few errors such as this

“Uncaught ReferenceError: jQuery is not defined”

Could you please post ALL of the errors? By the time we get to the error you posted, there’s probably already been multiple significant errors that caused this one.

Thanks for your time, exporting the error list brings up the following:

ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js:6 Uncaught SyntaxError: Invalid or unexpected token
_preload-store-ec90ffab9d7a6d9e507dda7cf7343e9d50b8bce624f7f44486ac8fd6b9814309.js:1 Uncaught TypeError: define is not a function
    at _preload-store-ec90ffab9d7a6d9e507dda7cf7343e9d50b8bce624f7f44486ac8fd6b9814309.js:1
vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1 Uncaught ReferenceError: Ember is not defined
    at vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1
    at vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1
vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1 Uncaught ReferenceError: $ is not defined
    at window.onerror (vendor-957bcfd0b1422c19974dcf8f64f73eeada523e3d12dd3c76eb24c753f9399397.js:1)
_pretty-text-bundle-1ffc769a242112508cf55cebf48084d3d074ec9376e7448676acd524a027b1d6.js:1 Uncaught TypeError: define is not a function
    at _pretty-text-bundle-1ffc769a242112508cf55cebf48084d3d074ec9376e7448676acd524a027b1d6.js:1
application-2d07fc19aa7165b0fc0c3b985a2b90f6cf72cc5f4420ad8626f14626e15a049e.js:8 Uncaught SyntaxError: Unexpected end of input
_plugin-e206a6cff2124b943dc0420347fa41f9e92d28b8100c0e7be64b7f5a2705bfe5.js:58 Uncaught ReferenceError: jQuery is not defined
    at _plugin-e206a6cff2124b943dc0420347fa41f9e92d28b8100c0e7be64b7f5a2705bfe5.js:58
_preload-application-data-0a59ccab480941aaac91f9e7fa7f77496323ae056aaa4158822dea35de319c01.js:2 Uncaught ReferenceError: require is not defined
    at _preload-application-data-0a59ccab480941aaac91f9e7fa7f77496323ae056aaa4158822dea35de319c01.js:2
    at _preload-application-data-0a59ccab480941aaac91f9e7fa7f77496323ae056aaa4158822dea35de319c01.js:66

Not to bother you but did you have a chance to review this?

Looks like this file is corrupt - if you look at the file is there anything obvious?

Have you tried rebuilding?

I have tried rebuilding and updatting, same problem unfortunately

After looking at the .js file in question, I see that it’s truncated and my browser is throwing networking errors to the console.

This is probably caused by using CloudFlare - we have seen enough problems using CloudFlare that we recommend disabling it entirely if possible.

This particular error seems to be on CloudFlare’s end as my browser also threw various non-source related errors downloading the file such as:

GET https://forum.example.com/assets/ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js net::ERR_SPDY_PROTOCOL_ERROR 200

And it even errored on the command line:

○ → wget https://forum.example.com/assets/ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js
--2018-12-20 16:30:10--  https://forum.example.com/assets/ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js
Resolving forum.example.com (forum.example.com)... 104.18.37.128, 104.18.36.128
Connecting to forum.example.com (forum.example.com)|104.18.37.128|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/javascript]
Saving to: ‘ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js’

ember_jquery-07f49b     [ <=>                ] 160.87K  --.-KB/s    in 0.03s   

2018-12-20 16:30:11 (4.62 MB/s) - Read error at byte 164729 (Success).Retrying.

--2018-12-20 16:30:12--  (try: 2)  https://forum.example.com/assets/ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js
Connecting to forum.example.com (forum.example.com)|104.18.37.128|:443... connected.
HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable

    The file is already fully retrieved; nothing to do.

I would recommend disabling CloudFlare entirely here if possible; if not, search meta for recommendations on disabling all of CloudFlare’s optimizations.

3 Likes

You’ll need an SSL certificate; I recommend following the Setting up HTTPS support with Let's Encrypt guide to get a free SSL certificate for your site.

First though, you ought to verify that the ember_jquery.js file is complete when loaded directly from the IP instead of via CF.

1 Like

OKay site now is off cloudflare however still just the header.

The file is loaded correctly over the IP, no errors at all. I moved off cloudflare now but still experiencing the same issue

There is something very wrong with your setup such causing it to return truncated files.

A comparison of the file downloaded from your site with the same version of the file present on another site (found by searching for that asset version) shows the same content right up until when yours gets truncated around 25% of the way into the file:

○ → diff -u <(sed -e 's/;/;\n/g' < guapic_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js) <(sed -e 's/;/;\n/g' < elixir_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js) | head
--- /dev/fd/63	2018-12-20 18:21:35.589330942 -0500
+++ /dev/fd/62	2018-12-20 18:21:35.589330942 -0500
@@ -1268,4 +1268,3443 @@
 return!1===l?["expr",n]:l}if(void 0!==a){var u=this.funcs[a],l=u(r,i,o,t);
 return!1===l?["expr",n]:l}return["expr",n]},e}();
 F(On,new An);
-var Sn=["javascript:","vbscript:"],Tn=["A","BODY","LINK","IMG","IFRAME","BASE","FORM"],kn=["EMBED"],Rn=["href","src","background","action"],Nn=["
\ No newline at end of file
+var Sn=["javascript:","vbscript:"],Tn=["A","BODY","LINK","IMG","IFRAME","BASE","FORM"],kn=["EMBED"],Rn=["href","src","background","action"],Nn=["src"],Pn={BUTTON:{type:!0,form:!0},INPUT:{type:!0,form:!0,autocorrect:!0,list:!0},SELECT:{form:!0},OPTION:{form:!0},TEXTAREA:{form:!0},LABEL:{form:!0},FIELDSET:{form:!0},LEGEND:{form:!0},OBJECT:{form:!0}},Dn={colgroup:{depth:2,before:"<table><colgroup>",after:"</colgroup></table>"},table:{depth:1,before:"<table>",after:"</table>"},tbody:{depth:2,before:"<table><tbody>",after:"</tbody></table>"},tfoot:{depth:2,before:"<table><tfoot>",after:"</tfoot></table>"},thead:{depth:2,before:"<table><thead>",after:"</thead></table>"},tr:{depth:3,before:"<table><tbody><tr>",after:"</tr></tbody></table>"}},jn="http://www.w3.org/2000/svg",In="http://www.w3.org/2000/svg",Ln={foreignObject:1,desc:1,title:1},Mn=Object.create(null);
+["b","big","blockquote","body","br","center","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","head","hr","i","img","li","listing","main","meta","nobr","ol","p","pre","ruby","s","small","span","strong","strike","sub","sup","table","tt","u","ul","var"].forEach(function(e){return Mn[e]=1});

File sizes:

164729 guapic_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js
589450 elixir_ember_jquery-07f49b58317ea9292d939348ec0091eb50a9d8aaabd9e86cc074ef5f049918aa.js
1 Like

Thanks :smiley: so what is the possible best solution for this? rebuilds are giving gateway errors.