Search Unity

lots of customers experience 'invalid Unity file'

Discussion in 'Editor & General Support' started by dacloo, Nov 10, 2008.

  1. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Hi,

    On several sites, we've put Unity content, but users seem to get the 'invalid Unity file' error. This is odd. Most of the times on the Windows platform, sometimes with FireFox 3, sometimes IE6 or IE7.

    E.g it appears here:
    http://www.rijveiligmetmedicijnen.nl/view/page/simulator

    I would really appriciate if people responded with "OKAY" or "PROBLEM" after checking it out, so that we can see what's wrong with the template (we use the default template).

    Thanks
     
  2. VoxelBoy

    VoxelBoy

    Joined:
    Nov 7, 2008
    Posts:
    213
    Mac OS X 10.5.2
    Firefox 3.0.3
    WORKS
    (although the stuff near the middle of the viewport is wobbly, as if it was being reftacted, made me nauseous :D)
     
  3. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Thanks for checkin'!

    It's a gimmicky racer ("medicin simulator"). You've been injected with a medicin that'll blur your vision and changes respondse time.

    We're busy with a few new projects and experiencing the same "invalid Unity file" issues, so that's why were curious.
     
  4. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,837
    What message exactly are you getting:

    Is it this one: (Please double check that this is the message you are always getting)
    Invalid data file
    Data file is corrupt (not a Unity Web Player file)


    It basically happens when the browser tells Unity that the download is complete, but the header of the file can either not be completely parsed or the header is incorrect. The most likely explanation for it is that the server is only serving a small part of the file for some reason or the download aborts for some other reason. What are you using to host the content?


    Not that it would make a difference but the file name looks a bit strange
    "car.unityweb.unity3d" Whats up with that double extension.
     
  5. gutripper

    gutripper

    Joined:
    Sep 30, 2008
    Posts:
    45
    I get 'Invalid Unity web file'. The loading progress bar doesn't get all of the way across before it fails.
     
  6. col000r

    col000r

    Joined:
    Mar 27, 2008
    Posts:
    662
    Invalid Unity web file

    Mac OS X 10.5.5, Firefox 2.0.0.17

    BUT: Works fine in Safari
     
  7. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,208
    No problems here in Safari or Firefox, OS X 10.4.11.

    --Eric
     
  8. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Hi,

    It's "Invalid data file".
    We are using Linux to host the content (our own dedicated web server).
    Wouldn't this result in the same errors with browsers and OSes?
    Is it a MIME setting?

    The double extension is a mystery. When I build the project it is appended automaticly.

    Jeroen


     
  9. R.A.E.

    R.A.E.

    Joined:
    Apr 24, 2008
    Posts:
    44
    Works fine here on OS X 10.4.5 Safari
     
  10. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    To add: Re-installing on Windows IE7:

    Code (csharp):
    1. error opening file for writing: C:\program files\unity\webplayer\mono\2.x.x\mono-1-vc.dl
     
  11. jeffcraighead

    jeffcraighead

    Joined:
    Nov 15, 2006
    Posts:
    740
    WORKS. Safari. OSX 10.5.5
     
  12. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,837
    It's not added by default on my build of 2.1. In any case, just rename the file and remove the .unityweb and update the html.

    It seems like the issue is on both OS X and Windows. Since i've never seen this issue before with any unity content, I would think it is related to the web server. Possibly mime settings or something in the cache settings.

    First thing I would try is hosting the file on another web server.
     
  13. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Hi,

    I have renamed it. Now I am trying to add the mime on the server.
    What is the exact MIME type for Unity?
    (Is this application/unity3d ?)

    It would be nice if people who had problems, tried again now that I have added the MIME type. Thanks! This could be a solution for in the Wiki.

    Thanks!

     
  14. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    ps:

    If it is a MIME problem, how can it be that e.g col000r had issues in Firefox, but not Safari?
     
  15. Joachim_Ante

    Joachim_Ante

    Unity Technologies

    Joined:
    Mar 16, 2005
    Posts:
    4,837
    Works for me now. Last time i checked the issue was:
    * On Firefox, when both the 1.x and 2.x plugin is installed and visiting your page while it had the unityweb extension causes the issue. Same works fine on Safari, presumably because mime handling in Safari is different.

    Now with your change, removing the unityweb extension it works correctly for me, so lesson to learn, don't put unityweb as an extension on a unity3d file.
     
  16. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Noted! Great!

    ps: I did add a MIME though. (Application/unity3d)
     
  17. Deleted User

    Deleted User

    Guest

    As I recall from a year ago, that double extension occurs when you're upgrading a Unity 1.x project to 2.x. - apparently the .unity3d is appended to the entire filename you used in 1.x. (It was a minor inconvenience and didn't seem worth reporting as a bug, at the time, but maybe it was!)
     
  18. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Hi Technicat,

    Good to know.
    Strange enough it's v2.0 only :)
     
  19. Jonathan Czeck

    Jonathan Czeck

    Joined:
    Mar 17, 2005
    Posts:
    1,713
    I don't have a solution, but I have had scattered reports that this was happening as well. So presumably it's happening more but most aren't bothering to try and contact someone about it. There hasn't been a good opportunity to get further information.

    -Jon
     
  20. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Hmm that is worrying. Do you have info on which browsers this happens or does it seem random?

    I still get reports; it seems this isn't fixed yet :-(
     
  21. joew

    joew

    Joined:
    Apr 8, 2008
    Posts:
    96
    10.5.5 / Safari

    Works perfect.
     
  22. Deleted User

    Deleted User

    Guest

    I filed a bug report on the double extension creation. I reproduced it by loading a really old Unity project which I'd used to create web players before, waited for it to finish upgrade, selected Build Settings from the menu, saw the default target was still Web Player, clicked the Build button, and the resulting Save As popup has the entire original player name as the default, including the .unityweb extension. If you hit Save then you'll get a file ending .unityweb.unity3d. If you remove the .unityweb from the filename before hitting Save, you're fine from then on.
     
  23. the_motionblur

    the_motionblur

    Joined:
    Mar 4, 2008
    Posts:
    1,736
    OSX 10.5.5
    Firefox3

    works perfectly
     
  24. Bjerre

    Bjerre

    Joined:
    Nov 8, 2006
    Posts:
    108
    OsX 10.5.5
    Firefox 3.03

    Shows the loadbar but the it says Invalid Unity Web file
     
  25. Omar Rojo

    Omar Rojo

    Joined:
    Jan 4, 2007
    Posts:
    494
    Error

    OSX 10.4.11
    Firefox 3

    I notice that everytime i reload the webpage, the progress bar went a little further. So i reloaded like 6 times and the game worked, but the first 5 times i got the error Invalid Unity File.

    .org
     
  26. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Darn.

    I still get lots of error reports, daily!

    The double file extension is clearly not the issue here, so I have to investigate.
    It's important that our client believes in Unity, because they are now under
    the impression that it is "inmature technology".

    I get the same reports from other servers, and I'm totally out of ideas here.
    Is the streaming stuff buggy, does Unity 'think' it's been downloaded, but in fact, it's not?

    Jeroen
     
  27. egenfeldt

    egenfeldt

    Joined:
    Feb 1, 2007
    Posts:
    16
    We might have something similar.
     
  28. dacloo

    dacloo

    Joined:
    Jun 30, 2005
    Posts:
    469
    Hi,

    Check your webserver config (e.g Apache). There are several variables that determin the time-out of accepting requests. Shorter numbers are better for e.g small files which are often requested, like banners. Larger numbers are better when it comes to bigger downloads (but the load on the server gets 'heavier').

    What might be happening is that those variables are set too low. This results in the webserver "giving up too soon". The result is that the Unity plugin (?) thinks the file has been downloaded completely, but it hasn't, so an error occurs -> it cannot start.

    It helped our situation!
    Secondly, check your MIME settings and add Unity as filetype.
     
  29. dipanjan

    dipanjan

    Joined:
    May 2, 2009
    Posts:
    4
    If anyone needs help about setting MIME TYPE - you can try the following if you are using IIS6:

    Open IIS > Web Site > Properties > HTTP Headers Tab > (Mime Maps) File Types ... > New Type:

    Associated extension: .unity3d
    Content type (MIME): application/vnd.unity
     
  30. will_w

    will_w

    Joined:
    Feb 20, 2008
    Posts:
    56
    works

    Mac, Firefox
     
  31. psychentist

    psychentist

    Joined:
    Apr 12, 2009
    Posts:
    73
    OSX Leopard on Intel based mini mac, running safari. no problems.
    neat game. keep it up.
     
  32. Dom

    Dom

    Joined:
    Jul 10, 2007
    Posts:
    91
    I've seen this in the other day also frequently when visiting various sites with unity webplayer content. Seems fine now though.
     
  33. lance6

    lance6

    Joined:
    Jun 4, 2009
    Posts:
    3
    I met this problem too, but it was really MIME's problem.
    I added the item of application/unity3d in the MIME list of server2008 IIS.
    Than, problem solved.
     
  34. Marv

    Marv

    Joined:
    May 26, 2009
    Posts:
    85
    I'm having the same 'invalid unity web file' error. It's working when on the hard drive, but not on the server (apache).

    I've tried adding the mime type, but it didn't change anything.

    Is this the right way to do it? :

    ' AddType application/vnd.unity .unity3d '

    greetz
     
  35. roberdan

    roberdan

    Joined:
    Aug 7, 2009
    Posts:
    35
    Yes I can confirm I had the same problem and was getting crazy because it worked when i used it locally on the net but not once i placed it on the webserver.

    in this case you need to add a new MIME unity3d as extension and Applicantion as content type.

    Now all work ok. :wink:
     
  36. bobber205

    bobber205

    Joined:
    May 12, 2009
    Posts:
    139
    Works.
    Google Chrome beta (3.x) Vista 64 bit.
     
  37. Busker John

    Busker John

    Joined:
    Aug 7, 2009
    Posts:
    14
    Just created a very simple, very small 166kb, unity project. Ran a web build, and uploaded files to my server. Added the MIME type, had the tech at the hosting site verify the MIME type was good, and I'm still getting "Invalid Unity Web File"..

    The host isn't blocking the filesize, I've given full permissions to the folder and files, and the MIME is valid..

    Any help would be awesome.
     
  38. guacamola

    guacamola

    Joined:
    Sep 6, 2009
    Posts:
    2
    yes, i have the same problem and my hosting can solve it changing the MIME settings in the server.
    BYe.
     
  39. spaceMan-2.5

    spaceMan-2.5

    Joined:
    Oct 21, 2009
    Posts:
    710
    I´m on Windows 7 with Chrome works fine, with Opera works fine, with ie too....

    i´m having the same trouble with my project, but i guess is related to that i was uploaded my file to mediafire.com
     
  40. janoonk

    janoonk

    Joined:
    Dec 3, 2008
    Posts:
    77
    I got the same problem.
    It worked locally on my Apache 2.x under IE7 and FF3. But when I tested it on a remote IIS6 webserver under FF3 the progressbar never progressed. In IE7 I got an "invalid Unity file" error.

    I found out I got an 404 error (file not found), when I tried to download the .unity3d through a direct URL.

    The fix is to add a MimeType Application/Unity3D for files with an .unit3d extension:
    Open IIS > Web Site > Properties > HTTP Headers Tab > (Mime Maps) File Types ... > New Type

    Worked for me!
     
  41. paulmac

    paulmac

    Joined:
    Feb 17, 2011
    Posts:
    8
    i got this problem in IE8 so I tried in Firefox, which brought up the initial screen but it didnt load the game.

    I went into the MIME settings on my web server and added the extension unity3d with type Application and it now works in both IE8 and Firefox.


     
  42. KirkLarkin

    KirkLarkin

    Joined:
    Jun 8, 2011
    Posts:
    1
    This thread seemed questionable as a solution, so I am here to re-enforce that this is a VALID SOLUTION.

    I just registered here. The WebPlayer worked great when it on my localserver. When I threw it on my site it gave me this error. I updated the MIME for .Unity3d and all i well.


    FYI. I downladed this like an hour ago and got a web player for a web browser made quick. I This is a great product.
     
  43. Selecters75

    Selecters75

    Joined:
    Apr 16, 2011
    Posts:
    5
    Hi all,
    I've experienced this issue before. The solution was including the proper MIME type on the webserver (IIS in my case).
    If you are using IIS, and you have ASP.NET installed you can add a new MIME type by including the following in the web.config file:

    <configuration>
    <system.webServer>
    <staticContent>
    <remove fileExtension=".unity3d" />
    <mimeMap fileExtension=".unity3d" mimeType="application/vnd.unity" />
    </staticContent>
    </system.webServer>
    </configuration>


    HTH
     
unityunity