Search Unity

Internal server error when publishing on WebGL

Discussion in 'Getting Started' started by cellist1, Oct 1, 2021.

  1. cellist1

    cellist1

    Joined:
    Sep 5, 2021
    Posts:
    2
    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: https://learn.unity.com/tutorial/creating-and-publishing-webgl-builds#601abda6edbc2a0028f7a5d6

    Running Unity 2020.3.17f1
    Running WebGL Publisher 4.2.2

    Thanks in advance for any advice / workarounds!
     
  2. cellist1

    cellist1

    Joined:
    Sep 5, 2021
    Posts:
    2
    Update for anyone interested / in the future: restarting Unity worked.
     
  3. SweetFeet

    SweetFeet

    Joined:
    Feb 9, 2022
    Posts:
    1
    You're beautiful
     
    Angelosbuf likes this.
  4. MapleGlazedCrow

    MapleGlazedCrow

    Joined:
    May 30, 2022
    Posts:
    1
    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:

    Code (CSharp):
    1.  
    2. static void CheckProgress(Store<AppState> store, string key)
    3.         {
    4.             var token = UnityConnectSession.instance.GetAccessToken();
    5.             if (token.Length == 0)
    6.             {
    7.                 CheckLoginStatus(store);
    8.                 return;
    9.             }
    10.  
    11.             key = key ?? store.state.key;
    12.             string baseUrl = GetAPIBaseUrl();
    13.  
    14.             var uploadRequest = UnityWebRequest.Get($"{baseUrl + QueryProgressEndpoint}?key={key}");
    15.             uploadRequest.SetRequestHeader("Authorization", $"Bearer {token}");
    16.             uploadRequest.SetRequestHeader("X-Requested-With", "XMLHTTPREQUEST");
    17.             var op = uploadRequest.SendWebRequest();
    18.  
    19.             op.completed += operation =>
    20.             {
    21. #if UNITY_2020
    22.                 if ((uploadRequest.result == UnityWebRequest.Result.ConnectionError)
    23.                     || (uploadRequest.result == UnityWebRequest.Result.ProtocolError))
    24. #else
    25.                 if (uploadRequest.isNetworkError || uploadRequest.isHttpError)
    26. #endif
    27.                 {
    28.                     AnalyticsHelper.UploadCompleted(UploadResult.Failed);
    29.                     Debug.LogError(uploadRequest.error);
    30.                     StopUploadAction();
    31.                     return;
    32.                 }
    33.                 var response = JsonUtility.FromJson<GetProgressResponse>(op.webRequest.downloadHandler.text);
    34.  
    35.                 store.Dispatch(new QueryProgressResponseAction { response = response });
    36.                 if (response.progress == 100 || !string.IsNullOrEmpty(response.error))
    37.                 {
    38.                     SaveProjectID(response.projectId);
    39.                     return;
    40.                 }
    41.                 EditorCoroutineUtility.StartCoroutineOwnerless(RefreshProcessingProgress(1.5f, store));
    42.             };
    43.         }
    44.  
    Edit:
    I figured it out, I removed WebGL from my package, re-installed it, made a new build and it published within five seconds.
     
    Last edited: Jun 1, 2022
  5. RichAllen2023

    RichAllen2023

    Joined:
    Jul 19, 2016
    Posts:
    1,026
    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.
     
  6. IsaacLusher

    IsaacLusher

    Joined:
    Jun 29, 2017
    Posts:
    1
    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.
     
    Kedlaw, kitkat7 and jdehaven72 like this.
  7. mcchry00

    mcchry00

    Joined:
    Aug 5, 2022
    Posts:
    1
    how do you reinstal webgl
     
  8. thebestofrest1132

    thebestofrest1132

    Joined:
    Aug 19, 2022
    Posts:
    1
    this was so helpfull thank you
     
    rxrgamez likes this.
  9. FinalEntity

    FinalEntity

    Joined:
    Oct 5, 2022
    Posts:
    1
    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.
     
  10. unity_9B7D53E1AEFA9280EE59

    unity_9B7D53E1AEFA9280EE59

    Joined:
    Oct 9, 2022
    Posts:
    1
    Thank you! You are my saver! Only your method works for me!
     
  11. zw2754

    zw2754

    Joined:
    Nov 10, 2022
    Posts:
    1
    You are a HERO!!!!!!
     
  12. Nomvi

    Nomvi

    Joined:
    Nov 5, 2022
    Posts:
    1
    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).
     
  13. kitkat7

    kitkat7

    Joined:
    Jun 8, 2022
    Posts:
    1
    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!
     
  14. Longeloe

    Longeloe

    Joined:
    Oct 4, 2022
    Posts:
    4
    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
     
  15. The_Technologist

    The_Technologist

    Joined:
    Nov 25, 2022
    Posts:
    1
    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.
     
  16. mgyky

    mgyky

    Joined:
    May 2, 2022
    Posts:
    1
    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 ':O :)
     
    Last edited: Nov 25, 2022
  17. cRaj79

    cRaj79

    Joined:
    Nov 26, 2022
    Posts:
    1
    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.
     
  18. FoolishNex

    FoolishNex

    Joined:
    Nov 26, 2022
    Posts:
    1
    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?
     
  19. Longeloe

    Longeloe

    Joined:
    Oct 4, 2022
    Posts:
    4
    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! :)
     
  20. zebman

    zebman

    Joined:
    Dec 22, 2021
    Posts:
    2
    Worked for me. My default browser was Brave, switched to Chrome and everything went through. Ended two days of misery. Thanks.
     
  21. tayler6000

    tayler6000

    Joined:
    Feb 6, 2023
    Posts:
    1
    I had to fully restart my computer to resolve this issue, restarting Unity did not work for me.
     
  22. bdilloughery_mvla

    bdilloughery_mvla

    Joined:
    Sep 22, 2017
    Posts:
    39
    Mine was doing the same. Hanging on 0% or 2% processing. It shows the WebGL build was correct but when I click publish it would hang at 0% or 2%, then throw the HTTP error.

    It was actually uploading it to play.unity.com. I went to the site and logged in (sometimes I would get an error and just reload the page once or twice until page loaded). After logging in, scroll to the bottom and your project is there.

    The weird thing is the project that I uploaded today would show that it was posted 14-15 days ago and had 20-50 views already. I know this was the case because I had 8 different projects on 8 different accounts have this same error, and every single one was actually getting posted and would show as a 2 week old date with some tens of views.
     
  23. ponder_s

    ponder_s

    Joined:
    Aug 25, 2021
    Posts:
    2
    I tried everything and could not fix this error. It publishes it to the unity play website and the game works on there, but I get stuck on processing in Unity and get this error every time.
     
  24. wynandjordaan

    wynandjordaan

    Joined:
    Jun 12, 2020
    Posts:
    1
  25. AnteG1985

    AnteG1985

    Joined:
    Mar 8, 2023
    Posts:
    1
    logged out and restarted, it worked. Thank you
     
  26. zox2mm

    zox2mm

    Joined:
    Jul 25, 2023
    Posts:
    1
    you're hero