timvisee / lazymc

💤 Put your Minecraft server to rest when idle.
GNU General Public License v3.0
600 stars 18 forks source link

The requested address is not valid in its context. (os error 10049) #39

Closed TigerBazooka2213 closed 1 year ago

TigerBazooka2213 commented 1 year ago

I am getting this error when trying to start lazymc on Windows: "The requested address is not valid in its context. (os error 10049)".

Basic research online seems to indicate it is to do with the local IP, so I have targeted the local IP and port field on line 27 of lazymc.toml. However no matter what I try in this field I cannot get around this error. I have tried 127.0.0.1, localhost, the machine's local IP on the LAN, even my public IP. I have also ensured the port is different from the public port, and that the port I put here matches the port set in the server config file. Lazymc still returns the same error every time. I'd love to use verbose mode to get more info but I can't seem to add that to the startlazymc batch file in a way that doesn't also produce an error about --verbose not being expected.

I'd also love to review the configuration page referenced in the Windows usage info, but that page 404s.

I have tried generic solutions from online like flushing dns.

timvisee commented 1 year ago

That is super weird! This might be a more general OS error outside of lazymc itself. I've not seen it before.

Do you also see this when listening on a public IP address, or when using other software?

You can find the configuration reference here: https://github.com/timvisee/lazymc/blob/master/res/lazymc.toml

TigerBazooka2213 commented 1 year ago

Thanks for your quick response. I'm continuing to investigate whether it's something on my system. I think I could probably gain a lot, though, from getting the program to run in verbose mode so I could possibly get a better idea of where it's encountering a roadblock. I'm sure it's something silly, but could you advise on how I should be configuring the startlazymc.bat file? Among others, I tried:

.\lazymc.exe start --verbose pause

Where pause is on line 2.

But that returns the following:

error: Found argument '--verbose' which wasn't expected, or isn't valid in this context

  If you tried to supply `--verbose` as a value rather than a flag, use `-- --verbose`

USAGE: lazymc.exe start [OPTIONS]

I tried its suggestion, which also didn't work.

To answer your questions, I haven't encountered this error before. For some context, the machine runs both a Valheim dedicated server, and heavily modded Minecraft server, but isn't used for much else, so it's possible I haven't done enough things on it to find out about this problem until now.

Many thanks!

TigerBazooka2213 commented 1 year ago

So it turns out it was a mistake on my part. I shall explain, in case anyone else does what I did:

I put my public IP address and the port users use to connect in line 16. I put my local IP address (127.0.0.1) and the server's port on line 27. As we know, I then got the error. My research online told me that this error has to do with the local IP, so I thought I must have done something wrong on line 27. It turns out that I had actually made a mistake on line 16, the public IP. Leaving it at 0.0.0.0:xxxx was the solution, which I discovered by regening the config file and starting anew.

At this point I had gotten around the error and was off to the races. The only other issue I encountered was previously documented by Wiiinterr and solved by supitsmike here: https://github.com/timvisee/lazymc/issues/25

It's working perfectly now and I'm thrilled, as this will save a lot of wasted power. Much appreciate the nifty software and your responsiveness as a dev when I raised my self-inflicted issue.

timvisee commented 1 year ago

Oh yes, that makes sense! Sorry I didn't catch that. It may be possible to add a specific error for this, hinting users to set their IP properly.

Happy to see you got it to work!