Unity Microgame WebGL upload not working (500 Internal Server) - unity3d

I am trying to go through the Unity Essentials tutorials. The last step for the Microgame tutorial is the publication of the game. I've been trying to upload the Microgame using WebGL in Unity as instructed for the past three days to no avail. As of now, it says there was an internal server error (code 500). Does anyone know what might be happening?
I found a relevant post on SO where they stated that it was an issue not relating to Unity. However, before the internal 500 error I'm getting now appeared, my Unity Publishing loading bar would freeze at 2% on a different microgame.
Things I've tried: Restarting the computer, reinstalling unity hub and editor, deleting project and restarting, trying a different Microgame, and waiting it out for three days.

You can try changing the compression format, and/or enabling decompression fallback.
These configurations can be found in the Player Settings
Edit>Project Settings>Player
There are 3 compression settings for WebGL
gzip This is the default option. Gzip files are bigger than Brotli files, but faster to build, and natively supported by all browsers over both HTTP and HTTPS.
Brotli Brotli compression offers the best compression ratios. Brotli compressed files are smaller than gzip, but take a longer time to compress, which increases your iteration times on release builds. Chrome and Firefox only natively support Brotli compression over HTTPS.
Disabled Disables compression. Use this option if you want to implement your own compression in post-processing
scripts
. You should also use it if you plan to use static compression on the hosting server.
In addition, enabling decompression fallback may be the correct option.
When you enable decompression fallback, Unity adds a .unityweb extension to the build files. You should consider using Decompression Fallback if you have less experience with server configuration, or if server configuration is unavailable to you.
Note: Using this option results in a larger loader size and a less efficient loading scheme for the build files.
Unity Reference

I had the same issue...
when publishing to WebGL... the unity editor was giving internal server error.
So, i tried to loging to unity play and check what is going on.. as soon as i log in to unity play. the browser gave me internal server error...
So, i changed the browser (Firefox) to Google Chrome.... and it worked...
What you have to do is... change your default browser.
I hope it works for you ...
Enjoy.

I've had this issue for a couple releases now. Made a project for WebGL and always builds fine but after the upload I get a 500 error every time. Guess I've made a PC app now. Contacted support by email, this is where they sent me, so must be the correct thread. I have tried all the compression options.

2023 Solution
None of the other answers will fix the problem. The good news is, even if your Unity Editor tells you that failed the operation with the Error 500 Internal Server %99 of the time it's uploading to the server.😯
So, you should immediately check the Unity website https://play.unity.com under My Games Section (scroll down a little bit on the home page). You might find lots of successful uploads already there!
In 2022 I've faced the same issue, I forgot to share the answer, this year I'm facing the same exact issue again. But in fact, it's just an editor's upload tool's fault perhaps. I'm not sure.
Hope this will help someone else.

Related

Can’t submit file for Facebook App Approval

I’ll set my outrage with the way this process works (to whom can I speak?) aside for the moment: we are attempting to provide FB with a link to our ~200 mb app for approval. We have been rejected 3 times because they are incapable of extracting our zip file (they request a zip for some unknown reason — it has minimal size impact).
Some detail: we are linking to the zip on our Dropbox. We have removed all punctuation from our app title (Pandamonium!.app becomes Pandamonium.app). We have eliminated spaces from our source folder. I thought all these could be causing a problem with iOS-sim.
I’m not sure what is left to do, but I am hoping someone can present a clear set of instructions (NOT THEIR INSTRUCTIONS, WHICH I HAVE READ) they have followed particularly if you have met similar snags or ANY ideas for resolution. All they send me is useless screenshots of their simulator unable to open the app which I have simulated and opened successfully daily with iOS-sim for the last week.
After a great deal of trial and error I found that using Facebook's command-line instructions was what was causing the issue. You should just compress your .app file in an ordinary fashion (right click and compress -- I used a Windows computer just to make sure everything was copasetic after reading about bizarre Mac .cbgz compression issues).
Regardless, in summary, I can now see why no one else has had an issue with this: it's because no one reads their instructions and rather just creates their .zip files in the ordinary way; unsurprisingly, you're better off using your common sense rather than listening to others.
Aside: ironically, after being told my use case was fine and the only issue was not being able to unzip, Facebook (India) has now told me they couldn't find my login button (which is gigantic, in multiple places, and clearly described in my instructions). This process is an absolute joke. I wish anyone going through this hell good luck.

Packaging a GWT app to run completely offline NOT installed via a "marketplace"

Theres a few questions similar to this, so I'll try to be clear as possible.
We have an existing, fairly large and complex, GWT webgame I have been asked to make work offline. It has to be offline in pretty much the strictest sense.
Imagine we have been told to make it work off a CD Rom.
So installation is allowed, but we cant expect the users to go to a Chrome/Firefox store and install it from there. It would need to be off the disc.
Likewise, altering of the browsers start-up flags would be unreasonable to expect of users.
Ideally, it would be nice if they just clicked a HTML file for the start page and it opened in their browsers of choice.
We successfully got it working this way in Firefox by adding;
"<add-linker name='xsiframe' />"
To our gwt.xml settings. This seems to solve any security issues FF has with local file access.
However, this does not solve the problem for Chrome.
The main game starts up, but various file requests are blocked due to security issues like these;
XMLHttpRequest cannot load file:///E:/Game%20projects/[Thorn]%20Game/ThornGame/text/messages_en.properties. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.MyApplication-0.js:34053 com_google_gwt_http_client_RequestBuilder_$doSend__Lcom_google_gwt_http_client_RequestBuilder_2Ljava_lang_String_2Lcom_google_gwt_http_client_RequestCallback_2Lcom_google_gwt_http_client_Request_2 MyApplication-0.js:34053
Now I was aware same origin policy issues might popup as during development we often tested locally using flags in chrome to bi-pass them.
Thing is...now I dont know how to get around them when we cant use startup flags.
Obviously in the example given its just the .properties file GWT uses to get some language related text. I could dump that inline in one way or another.
However, its only one of many,many,many files being blocked.
The whole game was made to run off *.txt game scripts on the sever - to allow easy updating by non-coders. Really the actual GWT code is just an "engine" and all the XMLHttpRequested files supply the actual "game".
These files are of various types; csv, txt, ntlist, jam.
The last two being custom extensions for what are really just txt files.
All these files are blocked by chromes security. It seems from what I can make out only images are allowed to be accessed locally.
Having all these files compiled in would just be impossible, as they are not fixed in number (ie, one central .txt file determains various scene .txt files which in turn determain various object files and directory's...).
Putting all this into a bundle would be nightmare to create and maintain.
So in essence I need some way to supply a offline version of a GWT project that can access a large number of various files in its subdirectories without security issues.
So far all I can think of is;
A) Theres something I can tell chrome via html or gwt that allows these files to be read in Chrome like FF can. (I suspect this isn't possible).
An alternative to XMLHttpRequest maybe?
B) I need to somehow package a game+a webbrowser in a executable package that has permission to access files in its directory's. (http://www.appcelerator.com/titanium ? ?? ).
C) I need to package and have the user run a full webserver that can then deliver all these files in a XMLHttp accessible way.
D) Bit of a funny one...we cant tell the user to add flags to browser start up...but Maybe I could write a game installer which just detects if they have Chrome or Firefox. It then opens up the games html in their browser with the correct flags for them? This would open up security issues if they browse elsewhere with that instance though, so Id presumably need other flags to disable the url bar if that's possible.
I am happy to make various changes to our code to achieve any of this - but as mentioned above theres no way to determain all the files needing to be accessed at compile time.
And finally, of course, it all has to be as easy as possible for the end user.
Ideally just clicking a html file, or installing something no more complex then a standard windows program.
Thanks for reading this rather long explanation, any pointers and ideas would be very welcome. I especially will appreciate multiple different options or feedback from anyone that's done this.
========================================
I accepted the suggestion to use Chromiumembedded below.
This works and does what I need (and much much more)
To help others that might want to use it, I specifically made two critical changes to the example project;
Because CEF needs a absolute path to the web apps local html, I wrote a c++ function to get the directory the .exe was launched from. This was a platform specific implementation, so if supporting a few OS's (which CEF does) be sure to write dedicated code for each.
Because my webapp will make use of local files, I enabled the Chrome flag for this by changing the browser settings;
browser_settings.file_access_from_file_urls = STATE_ENABLED;
These two changes were enough to get my app working, but it is obviously the bare minimum to make a application. Hopefully my finding will help others.
I'd suggest going the wrapper route. That is, provide a minimal browser implementation that opens your files directly. Options are Chromium Embedded[1]. If the nature of the application absolutely requires the files to be served as non-file urls then bundle a minimal webserver, have the on-disk executable start the server and open the bundled browser with whatever startup arguments you want.
[1] https://bitbucket.org/chromiumembedded/cef

Old version of Unity WebPlayer binary gets loaded from cache, using Facebook Unity integration

We are in the process of switching our game from our own canvas page, to using the Unity integration on Facebook. However, during our development tests we have occasionally run into a problem where the webplayer binary gets loaded from the browser cache, even though a newer version was uploaded to the server.
Manually clearing the browser cache solves the problem, but that's not exactly a solution we want to present to our users all the time. Previously, when we embedded the unity object ourselves, we also passed in a ?version flag with the url, which would keep it up to date, but we can't exactly do that anymore with integration turned on, unless we manually update the binary location link in our app settings every time we do a build (Kind of a pain in the butt, since the rest of our build process is automated)
Is there any way around this?
Thanks.
We have exactly same problem and I can say only solution is to change the binary file name everytime you made a build but only for your production environment. Here is our solution:
We have development (sandbox mode)and production environment and one app for each one.
For development, we ran everything locally, we have buildpipeline that builds and copies the binary file to appropriate place with the same name always like MyGame.unity3d, and we have set our browsers not to cache anything, that solves the problem for testing.
For production, our buildpipeline constructs the binary name with:
YourGameNameMainVersion.SubVersion.TimeStamp like: MyGame0.3.1006-1004.unity3d and this one is manually set from facebook's app settings page in every build. But this is not a big problem as you won't want to make a new build more than once/twice a day for production.
We've found that all that needs to be done is to add "?version=xxxx"
This works, and perfectly fine. I do now, is only change version (?version=1.52) in main link:
<a href="http://cometoplaynow.com/Labyrinth3D/Labyrinth3D.html?version=1.52">
Have advantages using it:
Changing only 1 number - link is still the same (if people open game from your site)
Savings will stay as it was (if you change .unity3d you will lost PlayerPrefs).

Unable to open PNG file with kview or PictureViewer; opens fine with other viewers

I have a PNG file created using libPNG library. The file opens perfectly on Windows picture viewer and MS Paint, but opening with kview (on Linux RHEL5) or QuickTime PictureViewer (on Windows) fails - the former reports a "libpng read error whereas the latter reports the file as being corrupted. A similar problem is seen when trying to process the PNG using ImageMagick library on Linux. Given that the PNG opens fine on some applications, it doesn't seem that the file is really corrupted; I therefore suspect some problem with version compatibility, but I am not sure. I tried searching the web but couldn't find any information on the root cause or a solution to this problem. Can someone please guide me on this?
Judging from the example image you posted in the comments, the problem is that your PNG lacks the ending IEND chunk -something you can test by opening it with tweakpng and inspecting the structure visually, or choosing "Check Validity-F5". It is somewhat predictable that those kind of PNG are displayed by some viewers and rejected by others.
If you are using libpng, it seems you forgot to call png_write_end()

Auto-upload on save

I'm delveloping a PHP web application on my local PC. Whenever I save a file it would be handy if Eclipse could upload the file to my web server via FTP. Is Eclipse able to do that?? I think Netbeans offers such an option. At the moment I do the upload manually which is very annoying...
Take a look at Eclipse Target Management (RSE). You can find a tutorial on getting started page.
A big downside is that the quality of RSE's error messages range from okay-if-ambiguous to downright horrible (IBM-style 3 chars + 4 digits with no text message) so it's best if you know whatever protocol you're using well enough to guess what the error is without really needing the message to explain it to you.
So, after a whole lot of tries, I finally found something that works!
What you need to install is Eclipse WebDAV and FTP Support. I have not found the eclipse update site, but this site has n archived version of it. This allows you to sychronize your code with an FTP site.
http://eclipse.jcraft.com/
Then, to Automatically Upload On Save, you can use my Auto Hot Keys Script at:
Eclipse Synchronize Hotkeys