Uncaught exception: unknown compression method

Just trying out the new 5.3 version of WebGL and think we have everything configured right on the server, .jsgz, .memgz, .datagz mime types all setup and compression enabled (IIS server setup)
But when loading the files I get this error

Any ideas on what would cause that and how to fix it?

Get the same error in Chrome, Firefox and Edge

Get the same error too with compression turned off for the server, which I thought would at least force Unity to use it’s own decompression code…

Same issue here. Any help would be appreciated.

I’ve made builds that work (and continue to work) with Unity 5.2.3. Unity 5.3 builds, however, only work locally. Running them from the webserver does not. I am running Apache 2.4.16.

Double post because I solved the problem:

Lots of fiddling and restarting Apache until it finally started working. Monark, I would suggest restarting your server a few times and ensuring that the conf files are correct. Though I had set the MIME types correctly, my webserver wouldn’t pick up the changes until the last restart I did.

For anyone else with an Apache issue…

If your server is configured to allow .htaccess in the directories around your Unity WebGL build simply create/add to your .htaccess the following lines (not csharp ;P)

AddType application/octet-stream .memgz .datagz .unity3dgz
AddType application/javascript .jsgz

If you’d rather not create an .htaccess file or your Apache isn’t configured to use them, you can always set the MIME types globally. The process seems a bit more involved but it’s not too bad.

First, let’s find your httpd location. With Apache running
ps -ef | grep apache You should see a path like "/usr/sbin/httpd" Then, let's find your root http location: /usr/sbin/httpd -V | grep HTTPD_ROOT
And then finally the conf file itself:
$ /usr/sbin/httpd -V | grep SERVER_CONFIG_FILE

Find the right spot to add the lines I showed above. Finally, restart Apache. Maybe a couple of times. I had to do it quite a few times.

Thanks to Lareieli for pointing out the correct types! WebGl Not Working - Unity Engine - Unity Discussions

1 Like

Hmmm still doesn’t work.
I’m getting a 404 error on this file

TemplateCompressed/UnityProgress.jsgz

Which indeed does not exist, though the uncompressed one does
TemplateData/UnityProgress.js

There appears to be nothing even trying to load the gz one only the .js one

all very weird…

I should add our server is IIS not Apache

Some progress following this thread

But still getting an error on UnityLoader.js which it insists on loading as UnityLoader.jsgz

hmmm and round in circles, getting that to load by moving it just means that I get errors back on the original gz files again.

It’s loading! hurrah. Needed to move the data files from Release to Compressed for some reason…

Ah! the Web.config from that other thread redirects them into a Compressed folder… mystery all solved, eveything working.

What was the solution exactly?

Yeah I’m having the same issue. I’ve tried everything that everyone tried and am having no luck.

BobsledTM I’m getting Incorrect Header what is your issue?

Same… uncaught exception: incorrect header check
I’ve been trying to change the .htaccess file like everyone else is saying, but it doesn’t seem to help. I’m still getting the warning in the console “Decompressed Release/Flockers.datagz in 187ms. You can remove this delay if you configure your web server to host files using gzip compression.” But my server is using gzip compression (I checked using some websites that do that kind of check/ godaddy says gzip compression is on by default)… So I’m real stumped now.

Not only that I had this running on my web host before on 5.2. Also when I built the web app with Data Cache on I’d get the error. Now I cleared cached and disabled it and it just stops responding!

Now I’m allocating more memory and uploading again to give that a try.

Not sure what is going on.

Think I just got it working in FireFox. Chrome still stops responding thought. Maybe I need to allocate more memory.

So again if you can try, disable Data Cache and allocate more memory.

So I just did some gross stuff and got something working. I continued to clear the cache like you said, then I modified the html file where it says dataUrl, codeUrl, and memUrl by adding a gz to the end of all of the paths. After that I deleted the .htaccess. I’m assuming what I just did was get it working by not using gz compression. I don’t think this is a legit solution, but I suppose this is what I’m going to have to get this working in the meantime.

Ok, now it’s not working. No idea what’s going on.

I think I’d keep the .htaccess.

You had no luck just disabling the data cache? Try other browsers as well.

Like for some odd reason it won’t run on my chrome AT ALL! no matter what. But it ran on my friends computer, in chrome/firefox and it runs on my firefox and it ran on chrome in my mac.

Ok, so it wasn’t working because I needed to clear out my local cache as well. So frustrating. But yeah, I just removed the htaccess file and then it worked. Unity added auto gzunzipping in case your server wasn’t set up to do so, but something was breaking when my server WAS set up to do so. So… yeah, I’ll just keep the htaccess file out until I hear of a better solution/the problem gets fixed.

Oh I didn’t know that! So it will unzip with out the .htaccess! I’ll have to try!

Also I hope cache clearing isn’t required for every user >_<

Did you remove ever .htaccess file including the ones in the sub folders or just the root?
Because it isn’t loading for me after removing them all. Are there any extra steps?

EDIT, nvm seems to have loaded, although the progress bar wasn’t updating!

Also did you keep data cache enabled when building?

Yeah Unity does an auto-unzip but that’s what causes the progress bar to act strange and freeze.

I didn’t remove the htaccess from the higher levels, just at the release level.

As for data caching, I’m using GoDaddy managed wordpress as my host so I don’t have the ability to turn caching off, I can only clear the cache. I tried fiddling with the .htaccess at the higher level to turn caching off for the specific page, but I had no luck as it still seems to be caching.

1 Like