The Minecraft server stopped within 5 seconds / java.lang.OutOfMemoryError:

  • 76 Views
  • Last Post 2 weeks ago
  • Topic Is Solved
draco2005 posted this 4 weeks ago

Hi,

I struggle to bring up any instance in AMP

Error: Unable to start server. The Minecraft server stopped within 5 seconds of starting, this is not a fault with AMP - you should check your Minecraft servers log files to find out why it is unable to start. (The logfile is 0 Bytes)

But here are the details for this installation:

Updates done: - OS - Minecraft - AMP

AMP output: Field Value OS Linux Platform VPS Ubuntu 18.04 LTS 64bit System Type x86_64 Virtualization OpenVZ Module ADSModule Loaded Plugins FileManagerPlugin, EmailSenderPlugin, WebRequestPlugin, LocalFileBackupPlugin, CommonCorePlugin Application Name AMP Application Version 2.1.0.14 Release Stream Release Build Date 08/04/2021 18:11

System: - Virtual root server at a hoster - OS: Linux - Platform: VPS Ubuntu 18.04 LTS 64bit + Plesk Obsidian - System Type: x86_64 - CPU vCores: 4 - Ram: 8 GB - Diskspace: 100 GB

From the linux "top": KiB Mem : 8388608 total, 5772844 free, 374884 used, 2240880 Buff/Cache KiB Swap: 0 total, 0 free, 0 used. 7978284 avail. Mem

Minecraft Version: - Minecraft Official - 1.16.5

Tested with JDK8 and JDK11

Java Parameter: -Xmx2048M -Xms512M

JDK11 First start:

[0,068s][warning][os,thread] Failed to start thread - pthread_create failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached. Error occurred during initialization of VM java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached

Second start:

[0,203s][warning][os,thread] Failed to start thread - pthreadcreate failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 4k, detached. [0,211s][warning][os,thread] Failed to start thread - pthreadcreate failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached. Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached at java.base/java.lang.Thread.start0(Native Method) at java.base/java.lang.Thread.start(Thread.java:803) at java.base/jdk.internal.ref.CleanerImpl.start(CleanerImpl.java:118) at java.base/java.lang.ref.Cleaner.create(Cleaner.java:203) at java.base/jdk.internal.ref.CleanerFactory.(CleanerFactory.java:42) at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:729) at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:849) at java.base/java.util.zip.ZipFile.(ZipFile.java:247) at java.base/java.util.zip.ZipFile.(ZipFile.java:177) at java.base/java.util.jar.JarFile.(JarFile.java:348) at java.base/java.util.jar.JarFile.(JarFile.java:319) at java.base/java.util.jar.JarFile.(JarFile.java:258) at java.base/sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:521) at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:747) at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:655)

JDK 8 First start:

Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start0(Native Method) at java.lang.Thread.start(Thread.java:717) at java.util.concurrent.ForkJoinPool.createWorker(ForkJoinPool.java:1486) at java.util.concurrent.ForkJoinPool.tryAddWorker(ForkJoinPool.java:1517) at java.util.concurrent.ForkJoinPool.signalWork(ForkJoinPool.java:1634) at java.util.concurrent.ForkJoinPool.externalSubmit(ForkJoinPool.java:2367) at java.util.concurrent.ForkJoinPool.externalPush(ForkJoinPool.java:2419) at java.util.concurrent.ForkJoinPool.execute(ForkJoinPool.java:2648) at java.util.concurrent.CompletableFuture.asyncRunStage(CompletableFuture.java:1654) at java.util.concurrent.CompletableFuture.runAsync(CompletableFuture.java:1871) at com.mojang.datafixers.DataFixerBuilder.build(DataFixerBuilder.java:70) at agb.b(SourceFile:208) at agb.(SourceFile:203) at x.b(SourceFile:200) at x.a(SourceFile:193) at aqe$a.a(SourceFile:636) at aqe.a(SourceFile:148) at aqe.(SourceFile:154) at ckc.(SourceFile:27) at cjl.(SourceFile:62) at kh.(SourceFile:92) at hk.e(SourceFile:46) at hk.a(SourceFile:75) at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) at hk.(SourceFile:74) at gm.(SourceFile:237) at vm.a(SourceFile:42) at net.minecraft.server.Main.main(SourceFile:87)

Second start:

Error occurred during initialization of VM java.lang.OutOfMemoryError: unable to create new native thread

Can anyone please help ... I try to solve it now since entire 3 days ......

Order By: Standard | Newest | Votes
Mike posted this 4 weeks ago

Not really an AMP issue because it's the MC server itself producing this message, but...

You might have reached the open file handle limit. Try increasing the maximum file handle limit (you will probably need to google how to do this for your distro)

  • Liked by
  • draco2005
draco2005 posted this 4 weeks ago

Dear team,

thank you very much for the fast feedback.

I contacted you, based on that I tried it with minecraft and a different user. The version I installed was the same and by running one of the following commands we could play Minecraft on the server.

--- snip ---

sudo java -d64 -Xmx1024M -Xms1024M -jar minecraft_server.jar nogui

sudo java -d64 -Xmx2048M -Xms2048M -jar minecraft_server.jar nogui

sudo java -d64 -Xms2048M -Xmx4096M -jar minecraft_server.jar nogui

sudo screen -AmdS minecraft java -Xmx4096M -Xms2048M -jar /home/mcraft/minecraft/minecraft_server.jar --- snip ---

So only when I try to run it via AMP Minecraft do not come up. Any information you need I will try to get for you. Or if I cann assist you, please let me know.

I will search in parallel for your hint..

thank you very much....

draco2005 posted this 4 weeks ago

do you haveany idea where the difference is to the commands I did manually and you do with APM?

Mike posted this 3 weeks ago

You can see what command AMP is running on the support tab.

draco2005 posted this 3 weeks ago

sorry to say but with these commands and others I tried ... I get the same result Last Executable /usr/lib/jvm/java-11-openjdk-amd64/bin/java Last Arguments -Xmx2048M -Xms1024M -jar minecraft_server.jar nogui

Error [0,061s][warning][os,thread] Failed to start thread - pthreadcreate failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 4k, detached. [0,063s][warning][os,thread] Failed to start thread - pthreadcreate failed (EAGAIN) for attributes: stacksize: 1024k, guardsize: 0k, detached. Error: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.OutOfMemoryError: unable to create native thread: possibly out of memory or process/resource limits reached at java.base/java.lang.Thread.start0(Native Method) at java.base/java.lang.Thread.start(Thread.java:803) at java.base/jdk.internal.ref.CleanerImpl.start(CleanerImpl.java:118) at java.base/java.lang.ref.Cleaner.create(Cleaner.java:203) at java.base/jdk.internal.ref.CleanerFactory.(CleanerFactory.java:42) at java.base/java.util.zip.ZipFile$CleanableResource.(ZipFile.java:729) at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:849) at java.base/java.util.zip.ZipFile.(ZipFile.java:247) at java.base/java.util.zip.ZipFile.(ZipFile.java:177) at java.base/java.util.jar.JarFile.(JarFile.java:348) at java.base/java.util.jar.JarFile.(JarFile.java:319) at java.base/java.util.jar.JarFile.(JarFile.java:258) at java.base/sun.launcher.LauncherHelper.getMainClassFromJar(LauncherHelper.java:521) at java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:747) at java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:655)

JDK 8: InstanceID 3f4e4c05-4eb7-478b-aa8c-aebac5195d60 Last Executable /usr/lib/jvm/java-8-openjdk-amd64/bin/java

Error Exception in thread "main" java.lang.OutOfMemoryError: unable to create new native thread at java.lang.Thread.start0(Native Method) at java.lang.Thread.start(Thread.java:717) at java.util.concurrent.ForkJoinPool.createWorker(ForkJoinPool.java:1486) at java.util.concurrent.ForkJoinPool.tryAddWorker(ForkJoinPool.java:1517) at java.util.concurrent.ForkJoinPool.signalWork(ForkJoinPool.java:1634) at java.util.concurrent.ForkJoinPool.externalSubmit(ForkJoinPool.java:2367) at java.util.concurrent.ForkJoinPool.externalPush(ForkJoinPool.java:2419) at java.util.concurrent.ForkJoinPool.execute(ForkJoinPool.java:2648) at java.util.concurrent.CompletableFuture.asyncRunStage(CompletableFuture.java:1654) at java.util.concurrent.CompletableFuture.runAsync(CompletableFuture.java:1871) at com.mojang.datafixers.DataFixerBuilder.build(DataFixerBuilder.java:70) at agb.b(SourceFile:208) at agb.(SourceFile:203) at x.b(SourceFile:200) at x.a(SourceFile:193) at aqe$a.a(SourceFile:636) at aqe.a(SourceFile:148) at aqe.(SourceFile:154) at ckc.(SourceFile:27) at cjl.(SourceFile:62) at kh.(SourceFile:92) at hk.e(SourceFile:46) at hk.a(SourceFile:75) at java.util.LinkedHashMap.forEach(LinkedHashMap.java:684) at hk.(SourceFile:74) at gm.(SourceFile:237) at vm.a(SourceFile:42) at net.minecraft.server.Main.main(SourceFile:87)

draco2005 posted this 3 weeks ago

Dear team, sorry to buzzer you I still struggle to bring that MineCraft Server online with AMP. As said under a normal user it s working with even only the standard parameter: java -Xmx2048M -Xms1024M -jar minecraft_server.jar nogui or when using mor memory - Xmx4096M I go some error report that say: --------------- S Y S T E M ---------------

OS:DISTRIBID=Ubuntu DISTRIBRELEASE=18.04 DISTRIBCODENAME=bionic DISTRIBDESCRIPTION="Ubuntu 18.04.5 LTS"

uname:Linux 4.15.0 #1 SMP Tue Jun 9 12:58:54 MSK 2020 x86_64 libc:glibc 2.27 NPTL 2.27 rlimit: STACK 8192k, CORE 0k, NPROC 62987, NOFILE 1048576, AS infinity load average:0.03 0.06 0.10

/proc/meminfo: MemTotal: 8388608 kB

MemFree: 6175148 kB

MemAvailable: 7755032 kB

Cached: 1510548 kB

Buffers: 0 kB

Active: 1364280 kB

Inactive: 693816 kB

Active(anon): 496644 kB

Inactive(anon): 93656 kB

Active(file): 867636 kB

Inactive(file): 600160 kB

Unevictable: 0 kB

Mlocked: 0 kB

SwapTotal: 0 kB

SwapFree: 0 kB

Dirty: 8920 kB

Writeback: 0 kB

AnonPages: 590300 kB

Shmem: 42748 kB

Slab: 126360 kB

SReclaimable: 112088 kB

SUnreclaim: 14272 kB

container (cgroup) information:

container_type: cgroupv1

cpucpusetcpus: failed

cpumemorynodes: failed

activeprocessorcount: 4

cpu_quota: -2

cpu_period: -2

cpu_shares: -2

memorylimitin_bytes: -2

memoryandswaplimitin_bytes: -2

memorysoftlimitinbytes: -2

memoryusagein_bytes: -2

memorymaxusageinbytes: -2

When I look at the last lines, might it be possible that AMP can not fetch the right values?

Thank you very much for helping ... I have nearly 12 days until I can gave back the server otherwise I have to pay for a year. please help me ...

Mike posted this 3 weeks ago

Did you increase the open file handle limit?

draco2005 posted this 3 weeks ago

Hi Mike,

yes I did, do you have a recommendation to which value? I tried it with these values: amp soft nproc 10000 amp hard nproc 65535 amp soft nofile 100000 amp hard noflie 256000

Are they ok, or which do you use?

And a reboot do not solve it ...

With that settings I get this message:

23:20:11
Loaded ADSModule version 1.0.0.0 by CubeCoders Limited
Loaded FileManagerPlugin version 1.0.0.0 by CubeCoders Limited
Loaded EmailSenderPlugin version 1.0.0.0 by CubeCoders Limited
Loaded WebRequestPlugin version 1.0.0.0 by CubeCoders Limited
Loaded LocalFileBackupPlugin version 1.0.0.0 by CubeCoders Limited
Loaded CommonCorePlugin version 1.0.0.0 by CubeCoders Limited
ADSModule requests dependency InstanceManagerPlugin...
23:20:12
Loaded InstanceManagerPlugin version 1.0.0.0 by CubeCoders Limited
ADSModule requests dependency SystemUserManagerPlugin...
Loaded SystemUserManagerPlugin version 1.0.0.0 by CubeCoders Limited
Loaded steamcmdplugin version 1.0.0.0 by CubeCoders Limited
Metrics server started OK on port 12820
Using keypair with fingerprint 7fwD.....2TwFbVWA=
SFTP Server started on 0.0.0.0:2223
Websockets are enabled.
Webserver started on http://0.0.0.0:8080
RouterTimer@10Hz with 2 jobs started
Checking for AMP updates...
23:20:13
AMP is up-to-date.
23:21:03
Waiting for AMP instance to start...
AMP instance Minecraft01 is now running.
Managed remote instance Minecraft01 at http://127.0.0.1:8081/
Authentication token for mcadmin requested by ManageInstance on behalf of mcadmin
:Anonymous23:21:04
Failure to make API call to Minecraft01 (http://127.0.0.1:8081/) - retried 10 times : Connection refused
HttpRequestException
[0] (HttpRequestException) : Connection refused
at ADSModule.WebMethods.MakeInstanceRequest (m.Http.IHttpRequest request, String REQ_RAWJSON, String requesturi) at ADSModule.WebMethods.Servers (m.Http.IHttpRequest request, String id, String REQ_RAWJSON)
SocketException
[1] (SocketException) : Connection refused

###########################################

23:44:10
Environment: authHost='https://authserver.mojang.com', accountsHost='https://api.mojang.com', sessionHost='https://sessionserver.mojang.com', servicesHost='https://api.minecraftservices.com', name='PROD'
main/WARN23:44:11
Ambiguity 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/INFO23:44:11
Reloading ResourceManager: Default
Worker-Main-4/INFO23:44:13
Loaded 7 recipes
Loaded 927 advancements
main/INFO23:44:15
[STDERR]: java.lang.OutOfMemoryError: unable to create new native thread
[STDERR]: at java.lang.Thread.start0(Native Method)
[STDERR]: at java.lang.Thread.start(Thread.java:717)
[STDERR]: at java.util.Timer.<init>(Timer.java:176)
[STDERR]: at apc.<init>(SourceFile:27)
[STDERR]: at net.minecraft.server.MinecraftServer.<init>(SourceFile:183)
[STDERR]: at zg.<init>(SourceFile:80)
[STDERR]: at net.minecraft.server.Main.a(SourceFile:180)
[STDERR]: at net.minecraft.server.MinecraftServer.a(SourceFile:260)
[STDERR]: at net.minecraft.server.Main.main(SourceFile:179)</init></init></init></init>

Mike posted this 2 weeks ago

Put AMP into full debug mode and have it generate startup scripts for you: https://github.com/CubeCoders/AMP/wiki/Diagnosing-AMP-issues

See the "Diagnosing Application Startup Issues" section.

Close