Internal server error when publishing on WebGL

Hello.

I am following the Unity Learn tutorials and have created my first microgame (the floor is lava!).

After following all the steps below, I get the message when attempting to publish on WebGL:

HTTP/1.1 500 Internal server error

Tutorial link, for anyone interested. It happens at step 6: Learn game development w/ Unity | Courses & tutorials in game design, VR, AR, & Real-time 3D | Unity Learn

Running Unity 2020.3.17f1
Running WebGL Publisher 4.2.2

Thanks in advance for any advice / workarounds!

Update for anyone interested / in the future: restarting Unity worked.

12 Likes

You’re beautiful

1 Like

I’m having the same error code, but i don’t know if it’s for the same reason. I tried restarting but it hasn’t fixed it. The error refers me to this code, but it doesn’t lead me anywhere. The line number 29 here is the exact line it sends me to:

static void CheckProgress(Store<AppState> store, string key)
        {
            var token = UnityConnectSession.instance.GetAccessToken();
            if (token.Length == 0)
            {
                CheckLoginStatus(store);
                return;
            }

            key = key ?? store.state.key;
            string baseUrl = GetAPIBaseUrl();

            var uploadRequest = UnityWebRequest.Get($"{baseUrl + QueryProgressEndpoint}?key={key}");
            uploadRequest.SetRequestHeader("Authorization", $"Bearer {token}");
            uploadRequest.SetRequestHeader("X-Requested-With", "XMLHTTPREQUEST");
            var op = uploadRequest.SendWebRequest();

            op.completed += operation =>
            {
#if UNITY_2020
                if ((uploadRequest.result == UnityWebRequest.Result.ConnectionError)
                    || (uploadRequest.result == UnityWebRequest.Result.ProtocolError))
#else
                if (uploadRequest.isNetworkError || uploadRequest.isHttpError)
#endif
                {
                    AnalyticsHelper.UploadCompleted(UploadResult.Failed);
                    Debug.LogError(uploadRequest.error);
                    StopUploadAction();
                    return;
                }
                var response = JsonUtility.FromJson<GetProgressResponse>(op.webRequest.downloadHandler.text);

                store.Dispatch(new QueryProgressResponseAction { response = response });
                if (response.progress == 100 || !string.IsNullOrEmpty(response.error))
                {
                    SaveProjectID(response.projectId);
                    return;
                }
                EditorCoroutineUtility.StartCoroutineOwnerless(RefreshProcessingProgress(1.5f, store));
            };
        }

Edit:
I figured it out, I removed WebGL from my package, re-installed it, made a new build and it published within five seconds.

Don’t know if it’s related but I’ve had internal server errors and 404 pages on various websites all day because the world and his dog are working from Home, Jubilee Bank Holiday weekend and all.

I was also getting this error in the console: ā€˜[Package Manager Window] Error searching for packages’ when I was reinstalling the WebGL Publisher package to fix the 500 error. The fix for this was to sign out and back in to the Unity Hub. After that everything worked.

3 Likes

how do you reinstal webgl

this was so helpfull thank you

1 Like

I can confirm that signing out and then back into the Unity Editor resolved this for me too. I also tried restarting the editor and uninstalling then reinstalling the WebGL Publisher package - neither of those worked.

Unfortunately the 500 Internal Server error is very generic and could be a lot of things. If this works for you then it’s most likely the authorisation token is expired. You can verify this by trying to refresh your package list and, if that fails, check the console - it’ll be more explanatory about the issue in there.

Thank you! You are my saver! Only your method works for me!

You are a HERO!!!

I continue to get this error even after trying the potential solutions mentioned. When publishing it does post the project on the unity play site, but gives me an error within the console (and processing never resolves/finishes within the Publish window).

I’ve been getting this error as well and had previously uninstalled it. I tried the logging out suggestion, and that stopped the error…BUT then it never finished processing. However, when I went to Unity Play my project is also there! Yay!

Also getting this error. Tried all the solutions above but none of them worked.
But, as for the previous comment, it uploads my game anyways! Ended up uploading it 7 times in a row before realizing that… Hahaha

I was having the same issue. What fixed it for me was updating all of the packages within my project to the latest version (specifically ā€œVersion Controlā€ and " Test Framework"; I believe it was the former that was creating the issue). This alone didn’t fix it as I then needed to go back a few steps and re-build the project before it would then upload.

After trying all of the above still getting:

HTTP/1.1 500 Internal server error on Unity tutorial.

When I try to enter the https://play.unity.com/ website it’s also shows:

{ā€œerrorCodeā€:ā€œInternalServerErrorā€,ā€œmessageā€:ā€œInternal server error: Fail to set redis dataā€,ā€œtargetā€:ā€œā€,ā€œdetailsā€:null}

When I reload, shows for a few seconds and reloads itself and it’s the same message again.

After trying multiple zillion times, finally works, not related to us, it’s a server error. Some of the suggestions above can work perhaps, but that doesn’t mean it’s the solution.

I hope this error will disappear in the future because you can’t pass the tutorial without it.

Opps I just uploaded zillion webGL games ':open_mouth: :slight_smile:

Hey Guys…

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.

wow, i checked it aswell, and as you said, my game is now uploaded 5 times on unity play. but still it gives me the error. wonder why?

Hi there!
I had the same problem and, after trying a lot of different possible solutions, ended up unistalling the Unity editor and also Unity Hub.
After reinstalling them, all bugs were gone and I’m able to upload everything perfectly.
Hope this helps! :slight_smile:

Worked for me. My default browser was Brave, switched to Chrome and everything went through. Ended two days of misery. Thanks.