Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled exception when getting remote time #124

Open
einstine909 opened this issue Apr 12, 2024 · 7 comments
Open

Unhandled exception when getting remote time #124

einstine909 opened this issue Apr 12, 2024 · 7 comments

Comments

@einstine909
Copy link

Describe the bug/error

It seems like there is an issue when min-ed-launcher is getting the remote time.

Some notes:

  • I am running Steam on Pop_OS 22.04 natively (not flatpack)
  • my Steam launch option is kitty sh -c "./MinEdLauncher %command% /autorun /autoquit /edh4"
  • The min-ed-laucher settings file is whatever was auto-generated on its first startup
  • I have tried with multiple Proton versions with no luck
  • I get a valid response from https://api.zaonce.net/1.1/server/time on my system using curl

Let me know if I can provide any other information that would be useful.

Thanks!

Debug log

2024-04-12 11:19:11.333 -06:00 [INF] Elite Dangerous: Minimal Launcher - v0.9.0+cebb41d8
2024-04-12 11:19:11.411 -06:00 [DBG] 
    Args: [|"/home/einstine909/.local/share/Steam/ubuntu12_32/reaper"; "SteamLaunch";
  "AppId=359320"; "--";
  "/home/einstine909/.local/share/Steam/ubuntu12_32/steam-launch-wrapper"; "--";
  "/home/einstine909/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point";
  "--verb=waitforexitandrun"; "--";
  "/home/einstine909/.local/share/Steam/steamapps/common/Proton - Experimental/proton";
  "waitforexitandrun";
  "/home/einstine909/.local/share/Steam/steamapps/common/Elite Dangerous/EDLaunch.exe";
  "/Steam"; "/novr"; "/autorun"; "/autoquit"; "/edh4"|]
    OS: Linux64
    Env: STEAM_COMPAT_DATA_PATH=/home/einstine909/.local/share/Steam/steamapps/compatdata/359320
    
2024-04-12 11:19:11.413 -06:00 [DBG] Reading settings from '/home/einstine909/.config/min-ed-launcher/settings.json'
2024-04-12 11:19:11.590 -06:00 [DBG] Settings: { Platform = Steam
  DisplayMode = Pancake
  AutoRun = true
  AutoQuit = true
  WatchForCrashes = false
  ProductWhitelist = seq ["edh4"]
  ForceLocal = true
  CompatTool =
   Some
     { EntryPoint = "/home/einstine909/.local/share/Steam/ubuntu12_32/reaper"
       Args =
        [|"SteamLaunch"; "AppId=359320"; "--";
          "/home/einstine909/.local/share/Steam/ubuntu12_32/steam-launch-wrapper";
          "--";
          "/home/einstine909/.local/share/Steam/steamapps/common/SteamLinuxRuntime_sniper/_v2-entry-point";
          "--verb=waitforexitandrun"; "--"; "python3";
          "/home/einstine909/.local/share/Steam/steamapps/common/Proton - Experimental/proton";
          "waitforexitandrun"|] }
  CbLauncherDir =
   "/home/einstine909/.local/share/Steam/steamapps/common/Elite Dangerous"
  PreferredLanguage = None
  ApiUri = https://api.zaonce.net/
  Restart = None
  AutoUpdate = true
  CheckForLauncherUpdates = true
  MaxConcurrentDownloads = 4
  ForceUpdate = set []
  Processes = []
  ShutdownProcesses = []
  FilterOverrides =
   seq [[FORC-FDEV-DO-1000, edo]; [FORC-FDEV-DO-38-IN-40, edh4]]
  AdditionalProducts = []
  DryRun = false
  ShutdownTimeout = 00:00:10
  CacheDir = "/home/einstine909/.cache/min-ed-launcher"
  GameStartDelay = 00:00:00
  ShutdownDelay = 00:00:00 }
2024-04-12 11:19:11.597 -06:00 [DBG] Unset LC_ALL. Using $LANG to determine correct UI culture
2024-04-12 11:19:11.624 -06:00 [INF] Elite Runtime
    Platform: Steam
    CobraBay Version: 1.7.6926.10
    Products Dir: /home/einstine909/.local/share/Steam/steamapps/common/Elite Dangerous/Products
2024-04-12 11:19:11.634 -06:00 [DBG] Getting machine id
2024-04-12 11:19:11.675 -06:00 [INF] Logging in
2024-04-12 11:19:11.675 -06:00 [DBG] Getting remote time
2024-04-12 11:20:51.718 -06:00 [ERR] Unhandled exception: System.Threading.Tasks.TaskCanceledException: net_http_request_timedout, 100
 ---> System.TimeoutException: TaskCanceledException_ctor_DefaultMessage
 ---> System.Threading.Tasks.TaskCanceledException: TaskCanceledException_ctor_DefaultMessage
   at System.Threading.Tasks.Tas...ion[36]`1.WaitWithCancellationAsync(CancellationToken)
   at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionAsync(Boolean, CancellationToken)
   at System.Net.Http.HttpConnectionPool.Sen...ync[37](HttpRequestMessage, Boolean, Boolean, CancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage, Boolean, CancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken)
   Exception_EndOfInnerExceptionStack
   Exception_EndOfInnerExceptionStack
   at System.Net.Http.HttpClient.HandleFailure(Exception, Boolean, HttpResponseMessage, CancellationTokenSource, CancellationToken, CancellationTokenSource)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken)
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at MinEdLauncher.Program.main(String[])
@rfvgyhn
Copy link
Owner

rfvgyhn commented Apr 12, 2024

When did you use curl to test it compared to getting the exception? The launcher's request timed out so maybe you just had bad luck with your timing.

Do you have any issues with the default launcher?

@einstine909
Copy link
Author

Retested just now.

I had the same net_http_request_timedout at the same time I had a successful request with curl:

$ curl https://api.zaonce.net/1.1/server/time
{"unixTimestamp":1712965795}

The default launcher successfully launched the game just now.

@rfvgyhn
Copy link
Owner

rfvgyhn commented Apr 13, 2024

I have no idea why it's timing out for you.

Does manually running it from a terminal change anything?
STEAM_COMPAT_DATA_PATH=/home/einstine909/.local/share/Steam/steamapps/compatdata/359320 /path/to/MinEdLauncher /steam /dryrun

Just grasping at straws, does the latest CI build change anything? It's built with .net 8 instead of .net 7.

@einstine909
Copy link
Author

Running the 0.9 release manually from the terminal get the same result as when running under Steam:

$ STEAM_COMPAT_DATA_PATH=/home/einstine909/.local/share/Steam/steamapps/compatdata/359320 /home/einstine909/.local/share/Steam/steamapps/common/Elite\ Dangerous/MinEdLauncher /steam /dryrun
[14:14:49 INF] Elite Dangerous: Minimal Launcher - v0.9.0+cebb41d8
[14:14:49 INF] Elite Runtime
    Platform: Steam
    CobraBay Version: 1.7.6926.10
    Products Dir: /home/einstine909/.local/share/Steam/steamapps/common/Elite Dangerous/Products
[14:14:50 INF] Logging in
[14:16:30 ERR] Unhandled exception: System.Threading.Tasks.TaskCanceledException: net_http_request_timedout, 100
 ---> System.TimeoutException: TaskCanceledException_ctor_DefaultMessage
 ---> System.Threading.Tasks.TaskCanceledException: TaskCanceledException_ctor_DefaultMessage
   at System.Threading.Tasks.Tas...ion[36]`1.WaitWithCancellationAsync(CancellationToken)
   at System.Net.Http.HttpConnectionPool.HttpConnectionWaiter`1.WaitForConnectionAsync(Boolean, CancellationToken)
   at System.Net.Http.HttpConnectionPool.Sen...ync[37](HttpRequestMessage, Boolean, Boolean, CancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage, Boolean, CancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken)
   Exception_EndOfInnerExceptionStack
   Exception_EndOfInnerExceptionStack
   at System.Net.Http.HttpClient.HandleFailure(Exception, Boolean, HttpResponseMessage, CancellationTokenSource, CancellationToken, CancellationTokenSource)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken)
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at MinEdLauncher.Program.main(String[])
Press any key to quit...

Here is the attempt with the latest CI build (same result as release):

$ STEAM_COMPAT_DATA_PATH=/home/einstine909/.local/share/Steam/steamapps/compatdata/359320 /home/einstine909/.local/share/Steam/steamapps/common/Elite\ Dangerous/MinEdLauncher /steam /dryrun
[14:20:46 INF] Elite Dangerous: Minimal Launcher - v0.9.0-ci8531602785+146367c1
[14:20:46 INF] Elite Runtime
    Platform: Steam
    CobraBay Version: 1.7.6926.10
    Products Dir: /home/einstine909/.local/share/Steam/steamapps/common/Elite Dangerous/Products
[14:20:46 INF] Logging in
[14:22:26 ERR] Unhandled exception: System.Threading.Tasks.TaskCanceledException: net_http_request_timedout, 100
 ---> System.TimeoutException: TaskCanceledException_ctor_DefaultMessage
 ---> System.Threading.Tasks.TaskCanceledException: TaskCanceledException_ctor_DefaultMessage
   at System.Threading.Tasks.Tas...ion[36]`1.WaitWithCancellationAsync(CancellationToken)
   at System.Net.Http.HttpConnectionPool.Sen...ync[37](HttpRequestMessage, Boolean, Boolean, CancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage, Boolean, CancellationToken)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken)
   Exception_EndOfInnerExceptionStack
   Exception_EndOfInnerExceptionStack
   at System.Net.Http.HttpClient.HandleFailure(Exception, Boolean, HttpResponseMessage, CancellationTokenSource, CancellationToken, CancellationTokenSource)
   at System.Net.Http.HttpClient.<SendAsync>g__Core|83_0(HttpRequestMessage, HttpCompletionOption, CancellationTokenSource, Boolean, CancellationTokenSource, CancellationToken)
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at [email protected]()
   at MinEdLauncher.Program.main(String[])
Press any key to quit...

I have a hunch on what might be happening, I will be back with more information shortly.

@einstine909
Copy link
Author

I found the problem: Unruly IPV6

I broke out wireshark to find out what the difference between curl and min-ed-launcher was. I found that curl was attempting to connect to api.zaonce.net's IPV6 address, and when that failed it retried with the IPV4 address. It seems that min-ed-launcher's http request lib does not do that. It attempts the IPV6 address which request gets lost somewhere along the way, and does not try to fall back to IPv4, causing the timeout error.

I have not yet compared the default launcher to min-ed-launcher with wireshark but I assume that it is also falling back to IPV4 when the IPV6 request fails, because I am able to login and launch the game.

Now knowing this I got E:D Horizon launching with min-ed-launcher by temporarily removing my machine's IPV6 address.

@rfvgyhn Its your call if you want to consider this closed or not. It would be nice if min-ed-launcher could also fallback to IPV4, but I can also make this work with the new knowledge that I have. Thank you for being so responsive!

@rfvgyhn
Copy link
Owner

rfvgyhn commented Apr 13, 2024

I'm not certain, but you might be able to work around it by either specifying the env var DOTNET_SYSTEM_NET_DISABLEIPV6=true or disabling IPV6 by creating MinEdLauncher.runtimeconfig.json in the same directory as MinEdLauncher. I haven't tested either, so I'm not sure if the env var is a build time specific var or not. I'm also not sure if the json file will work with MinEdLauncher since it's a self-contained app.

{
  "runtimeOptions": {
    "configProperties": {
      "System.Net.DisableIPv6": true
    }
  }
}

I'll leave this open for now. I'm not sure how much effort it is to configure dotnet's HttpClient to fallback to IPV4 if IPV6 fails.

Thanks for the in-depth debugging. I doubt I'd have ever figured that out.

@rfvgyhn
Copy link
Owner

rfvgyhn commented Jun 28, 2024

Looks like this is a known issue in .net. The API proposal to implement a happy eyeballs/fast fallback approach has been approved but the implementation hasn't been completed yet. It's possibly coming with .net 9.

Not sure what will come first, the .net team implementing it or me manually implementing it via ConnectCallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants