AMP icon indicating copy to clipboard operation
AMP copied to clipboard

Failed to Create Instance When Port Range Needed Is Not in Range Provided

Open IceOfWraith opened this issue 3 years ago • 14 comments

Bug Report

System Information

  • Operating System - Windows 11 Pro
  • AMP version and build date - v2.4.0.4, built 10/09/2022 16:30
  • Which AMP release stream you're using - Bleeding

I confirm:

  • [x] that I have searched for an existing bug report for this issue.
  • [x] that I am using the latest available version of AMP.
  • [x] that my operating system is up-to-date.

Symptoms

  • What are you trying to do? Create an instance of Vintage Story.

  • What are you expecting to happen? The system should find the first port available, whether above or below the default port. Otherwise, predefined port ranges are kind of pointless for high port games.

  • What is actually happening? ('Nothing' is not an acceptable answer!) Create Instance Failed: There are no available application service ports above 42420. You can address this by adding an extra port range that covers this under Configuration -> Networking -> Application Port Ranges

Reproduction

Set a port range below 42420 and create a Vintage Story instance (available in Greelan's dev repo) at time of posting.

IceOfWraith avatar Sep 14 '22 00:09 IceOfWraith

This looks like the intended behaviour. In this situation you could either add the required port range, or set the port allocation mode to Exclude only.

PhonicUK avatar Sep 17 '22 17:09 PhonicUK

I'm misunderstanding why it would only go to higher ports. My use case is I want my specific targets to use specific port ranges. i.e. 40200:40399. If a game wants a port above this range it just fails. It shouldn't be that way. AMP should try any port within the allowed range.

IceOfWraith avatar Sep 17 '22 17:09 IceOfWraith

The reason for that is that it kept games that used the same port ranges close together. So if you had a game that used 7777 and created multiples of it, they'd end up on 7778, 7779 even if a different game got created in-between.

PhonicUK avatar Sep 20 '22 10:09 PhonicUK

This seems like a personal preference over functionality. If the game server is okay using the port, it should use it rather than AMP erroring out.

IceOfWraith avatar Nov 06 '22 18:11 IceOfWraith

I've just run into this issue as a new AMP user. As a workaround I've added a port range of 65530:65535 so that AMP allows me to create an instance, I then reassigned the ports back into my desired range (10100:10200). It would be nice if this restriction could be disabled/removed, I find it counter-intuitive and needlessly limiting.

As suggested in one of the previous comments, I tried to use Port assignment mode "Use all except excluded", adding 0:65535 to Application port ranges, 0:10099 and 10201:65535 to Application port exclusions but I still couldn't create an instance, this time failing with "There are no available AMP service ports."

recursiveGecko avatar Sep 11 '23 21:09 recursiveGecko

This bug still exists in v2.4.7 image I have a fix range of ports forwarded to the AMP container (LXC), so I don't need to adjust the port forwarding every time for a new game and every container has a fix range it can use for services which need to be accessible through IPv4. image Because of the bug, I need to adjust the ports manually after creating the instance. It should be really easy to fix this bug..

BroOtti avatar Jan 21 '24 16:01 BroOtti

No longer an issue as exclude is now the default behavior.

PhonicUK avatar Apr 11 '24 07:04 PhonicUK

Hmm... how is this solved though? If I exclude all but my set range of ports will it work even if I don't contain the higher ports in my rsnge?

IceOfWraith avatar Apr 11 '24 07:04 IceOfWraith

The default is to allow all ports and only pay attention to the exclusion range.

PhonicUK avatar Apr 11 '24 07:04 PhonicUK

Can this be reopened? I just tried with v2.5.0.4, built 04/04/2024 18:29 and the issue is still existing. image It's really annoying to have to change the ports every time after instance creation. image

BroOtti avatar Apr 11 '24 07:04 BroOtti

I'm still confused why it's such an issue to have AMP just circle back around and see if a lower port is available. I see no reason for this not to be open and addressed. Just because the default behavior is a workaround. It's not a good one.

IceOfWraith avatar Apr 11 '24 07:04 IceOfWraith

lol... AMP is really dump if you set it to exclude mode xD

image

Port 100001 is not a valid port... The highest possible port is 65535.

BroOtti avatar Apr 11 '24 07:04 BroOtti

Just for completion. I set the excluded ports as follows image First noticed it set the port to 65536 of the new instance and then tested with a higher number to see if it just checks the limit wrong

BroOtti avatar Apr 11 '24 07:04 BroOtti

The default is to allow all ports and only pay attention to the exclusion range.

You sure?

Greelan avatar Apr 11 '24 08:04 Greelan