Forums Archived

This forum has been archived. No new posts can be made and no new users can sign up. It remains here for reference only.

Find the new forums here

AMP not honoring minecraft port assignment

  • 1.2K Views
  • Last Post 30 November 2018
  • Topic Is Solved
tunedetune posted this 30 November 2018

OS Name/Version: Ubuntu 18.04.1

Product Name/Version: AMP v1.6.10.8

Problem Description: More than one MC server running on AMP, set server port to 25568, server.properties shows 25568, server tries to start on 25565.

Steps to reproduce:

Active AMP Minecraft server already running on port 25565. Create new AMP instance, standalone (did same thing on ADS managed), specify port assignment to 25566 and up, start instance, convert to managed, manage, verify port assignment on configuration page, start service, verify server.properties shows port assignment, but console shows system trying to start on 25565.

Actions taken to resolve so far:

Deleted instance, made new instance with different name, same options, verified all files were showing correct values, used lsof to try and see what files were being written to while changing things that should have been in server.properties, stopped instance, restarted instance, stopped, killed, restarted service.

I have a modded MC 1.10.2 instance, a Vanilla 1.13.2 instance, and this Snapshot instance.

AMP Console:

11/30/2018 09:15:49
09:15:49Ambiguity between arguments [teleport, destination]: and [teleport, targets] with inputs: [Player, 0123, @e, dd12be42-52a9-4a91-a8a1-11c01849e498]
Ambiguity between arguments [teleport, location]: and [teleport, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
Ambiguity between arguments [teleport, location]: and [teleport, targets] with inputs: [0.1 -0.5 .9, 0 0 0]
Ambiguity between arguments [teleport, targets]: and [teleport, destination] with inputs: [Player, 0123, dd12be42-52a9-4a91-a8a1-11c01849e498]
Ambiguity between arguments [teleport, targets, location]: and [teleport, targets, destination] with inputs: [0.1 -0.5 .9, 0 0 0]
main/INFO 11/30/2018 09:15:49
09:15:49Loaded 0 recipes
Loaded 0 advancements
Server thread/INFO 11/30/2018 09:15:49
09:15:49Starting minecraft server version 18w48a
Loading properties
Default game type: SURVIVAL
Generating keypair
09:15:50Starting Minecraft server on 0.0.0.0:25565
Using epoll channel type
Server thread/WARN 11/30/2018 09:15:50
09:15:50**** FAILED TO BIND TO PORT!
The exception was: io.netty.channel.unix.Errors$NativeIoException: bind(..) failed: Address already in use
Perhaps a server is already running on that port?
Server thread/INFO 11/30/2018 09:15:50
09:15:50Stopping server
Saving worlds

server.properties:

spawn-protection=16
max-tick-time=60000
query.port=25565
generator-settings=
force-gamemode=true
allow-nether=true
enforce-whitelist=false
gamemode=survival
broadcast-console-to-ops=true
enable-query=false
player-idle-timeout=0
difficulty=easy
spawn-monsters=true
broadcast-rcon-to-ops=true
op-permission-level=3
pvp=true
snooper-enabled=true
level-type=default
hardcore=false
enable-command-block=true
max-players=10
network-compression-threshold=256
resource-pack-sha1=
max-world-size=29999984
rcon.port=25575
server-port=25568
server-ip=0.0.0.0
spawn-npcs=true
allow-flight=true
level-name=world
view-distance=10
resource-pack=
spawn-animals=true
white-list=true
rcon.password=
generate-structures=true
online-mode=true
max-build-height=256
level-seed=helovesher
use-native-transport=true
prevent-proxy-connections=true
motd=Snapshot 18w48a
enable-rcon=false

Order By: Standard | Newest | Votes
Mike posted this 30 November 2018

This usually means some kind of permissions issue that prevents the server from reading its server.properties file so it reverts to the default. AMP doesn't have any direct control over the port assignment, it just writes out server.properties and starts the server as normal.

Try deleting server.properties and start the server again, which will cause AMP to regenerate the file with the correct permissions.

tunedetune posted this 30 November 2018

Tried that again, didn't mention that was also something that was attempted, same issue. The file populated correctly as the server started up, but it still tried to start on 25565 while the file shows 25568. Perms are 664 for server.properties after regeneration.

Mike posted this 30 November 2018

Does the port match what's specified in Instances.json ?

tunedetune posted this 30 November 2018

Yes it does: "MinecraftModule.Minecraft.PortNumber": "25568",

Mike posted this 30 November 2018

If you change AMPs loglevel to 0 in AMPConfig.conf - you can see what arguments it's starting Java with, can you drop that here?

tunedetune posted this 30 November 2018

Log output:

[20:16:02] [Minecraft:Admin Info] : Java located at /usr/bin/java
[20:16:02] [Minecraft:Admin Info] : Hash for minecraft_server.jar: 12ddc3db6ed60fe578880ad0aceca2c4
[20:16:02] [Minecraft:Admin Info] : Using 'Official' compatibility mode.
[20:16:02] [Minecraft:Admin Debug] : Java located at: /usr/bin/java
[20:16:02] [Minecraft:Admin Debug] : Java start arguments: -Xmx4096M  -jar minecraft_server.jar nogui
[20:16:02] [Core:Admin Debug]     : Starting process /usr/bin/java
[20:16:02] [Core:Admin Debug]     : Working Directory: ./Minecraft/
[20:16:02] [Core:Admin Debug]     : Arguments: -Xmx4096M  -jar minecraft_server.jar nogui
[20:16:02] [Core:Admin Debug]     : Started process with ID 32372
[20:16:10] [Minecraft:Admin Warning] : The application stopped unexpectedly.

Mike posted this 30 November 2018

So if you login as the user you're running AMP as in SSH and go to the Minecraft for that instance, run this just to verify:

cat server.properties | grep 25568

And then run

java -Xmx4096M  -jar minecraft_server.jar nogui

This of course completely pulls AMP out of the equation. See if the issue still occurs. If it does then it's an issue with the server jar you're using.

  • Liked by
  • tunedetune
tunedetune posted this 30 November 2018

For reference, I did the same with the Vanilla instance (log level 0), restarted and this is the same snippet from that log:

[20:25:58] [RemoteAMPAuth:Anonymous Activity] : Authentication success
[20:26:02] [API:Admin Activity]   : Starting the application.
[20:26:02] [Minecraft:Admin Info] : Java located at /usr/bin/java
[20:26:02] [Minecraft:Admin Info] : Hash for minecraft_server.jar: 17d651dc8f72cadcc2082220aaaf7188
[20:26:02] [Minecraft:Admin Info] : Using 'Official' compatibility mode.
[20:26:02] [Minecraft:Admin Debug] : Java located at: /usr/bin/java
[20:26:02] [Minecraft:Admin Debug] : Java start arguments: -Xmx4096M  -jar minecraft_server.jar nogui
[20:26:02] [Core:Admin Debug]     : Starting process /usr/bin/java
[20:26:02] [Core:Admin Debug]     : Working Directory: ./Minecraft/
[20:26:02] [Core:Admin Debug]     : Arguments: -Xmx4096M  -jar minecraft_server.jar nogui
[20:26:02] [Core:Admin Debug]     : Started process with ID 1664
[20:26:15] [Minecraft:Admin Debug] : Sleep client is connecting to 127.0.0.1:25567...
[20:26:15] [Minecraft:Admin Debug] : Server protocol version is 404

tunedetune posted this 30 November 2018

root@hoban:/home/AMP/.ampdata/instances/Snapsh0t/Minecraft# cat server.properties | grep 25568 server-port=25568

I deleted the server.jar and it downloaded 18w48b (I'd been using 18w48a), and that worked perfectly fine. Now I can't download 18w48a, and I see this on the 18w48b issues:

CHANGES IN 18W48B
Fixed a nasty crash
Fixed an issue with server port

Thanks!

Mike posted this 30 November 2018

Careful! You're logged in as root there, you must always login as your AMP user or you'll immediately trash all your permissions.

Close