Skip to content

[Bug]: RemoteAPI hosts return 502 instead of 404 for non-officially supported games #1183

Description

@Fluffyalien1422

All of the following criteria must be met

  • All Requirements must be installed.
  • Changed the title so that it doesn't just says "[Bug]: "
  • I have searched the GitHub issues for my bug, even in the closed issues.

All of the following are optional to answer

  • Tried reinstalling the Game.
  • Tried reinstalling MelonLoader.
  • Tried restarting PC.

Describe the issue.

Hi,

The following errors appear in the console when launching a game that isn't officially supported:

[19:15:29.899] [ERROR] [Il2CppAssemblyGenerator] WebException (BadGateway) while Contacting RemoteAPI Host (https://api.melonloader.com/api/v1/game/suzerain): System.Net.Http.HttpRequestException: Response status code does not indicate success: 502 (Bad Gateway).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at MelonLoader.Il2CppAssemblyGenerator.RemoteAPI.ContactHosts() in D:\a\MelonLoader\MelonLoader\Dependencies\Il2CppAssemblyGenerator\RemoteAPI.cs:line 61
[19:15:30.566] [ERROR] [Il2CppAssemblyGenerator] WebException (BadGateway) while Contacting RemoteAPI Host (https://api-1.melonloader.com/api/v1/game/suzerain): System.Net.Http.HttpRequestException: Response status code does not indicate success: 502 (Bad Gateway).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at MelonLoader.Il2CppAssemblyGenerator.RemoteAPI.ContactHosts() in D:\a\MelonLoader\MelonLoader\Dependencies\Il2CppAssemblyGenerator\RemoteAPI.cs:line 61
[19:15:30.854] [ERROR] [Il2CppAssemblyGenerator] WebException (BadGateway) while Contacting RemoteAPI Host (https://api-2.melonloader.com/api/v1/game/suzerain): System.Net.Http.HttpRequestException: Response status code does not indicate success: 502 (Bad Gateway).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at MelonLoader.Il2CppAssemblyGenerator.RemoteAPI.ContactHosts() in D:\a\MelonLoader\MelonLoader\Dependencies\Il2CppAssemblyGenerator\RemoteAPI.cs:line 61
[19:15:31.555] [ERROR] [Il2CppAssemblyGenerator] WebException (BadGateway) while Contacting RemoteAPI Host (https://melon.samboy.dev/api/v1/game/suzerain): System.Net.Http.HttpRequestException: Response status code does not indicate success: 502 (Bad Gateway).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at MelonLoader.Il2CppAssemblyGenerator.RemoteAPI.ContactHosts() in D:\a\MelonLoader\MelonLoader\Dependencies\Il2CppAssemblyGenerator\RemoteAPI.cs:line 61
[19:15:31.709] [ERROR] [Il2CppAssemblyGenerator] WebException (526) while Contacting RemoteAPI Host (https://melon.dubyadu.de/api/v1/game/suzerain): System.Net.Http.HttpRequestException: Response status code does not indicate success: 526 (<none>).
   at System.Net.Http.HttpResponseMessage.EnsureSuccessStatusCode()
   at MelonLoader.Il2CppAssemblyGenerator.RemoteAPI.ContactHosts() in D:\a\MelonLoader\MelonLoader\Dependencies\Il2CppAssemblyGenerator\RemoteAPI.cs:line 61

I manually sent a web request to the URL https://api.melonloader.com/api/v1/game/suzerain and confirmed it does return a 502.

I also sent a web request to the URL for Audica https://api.melonloader.com/api/v1/game/audica which successfully returns {"gameSlug":"audica","gameName":"Audica","mappingUrl":null,"mappingFileSHA512":null,"forceCpp2IlVersion":null,"forceUnhollowerVersion":null,"obfuscationRegex":null}.

This doesn't seem to cause any actual issues. The assemblies are still generated successfully and I have noticed no problems actually playing the game.

I thought this was worthy of a report since, after looking at RemoteAPI.cs, it seems like the web server is supposed to return a 404 but is instead returning 502:

if (hre.StatusCode == System.Net.HttpStatusCode.NotFound)
{
    Core.Logger.Msg($"Game Not Found on RemoteAPI Host ({info.URL})");
    break;
}

Latest.log

Did you attach your log file?

Yes, I attached my log file to the text box above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions