# Minecraft balena server not working

**URL:** <https://forums.balena.io/t/minecraft-balena-server-not-working/197836>\
**Category:** Product support\
**Created:** [October 13, 2020, 6:18am UTC](https://forums.balena.io/t/minecraft-balena-server-not-working/197836 "2020-10-13T06:18:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Unknown](https://avatars.discourse-cdn.com/v4/letter/u/4bbf92/32.png) [@Unknown](https://forums.balena.io/u/Unknown)\
**Post date:** [October 13, 2020, 6:18am UTC](https://forums.balena.io/t/minecraft-balena-server-not-working/197836/1 "2020-10-13T06:18:00Z")

</div>

Hi,  
I’ve recently used this tutorial: [https://www.balena.io/blog/how-to-create-a-minecraft-server-for-the-pi-4-with-balena/](https://www.balena.io/blog/how-to-create-a-minecraft-server-for-the-pi-4-with-balena/) to create a minecraft server on my raspberry pi 4 with 2gb of ram, however i can’t connect to it and get the below error:

 ![Image 13-10-20 at 11.56 AM](https://global.discourse-cdn.com/balena/original/2X/9/9acd74f21ae952fe09bd70f9d198f4b046c8d104.jpeg)

this is my output from the balena dashboard that i think is related to the problem

```auto
[04:10:59 INFO]: Starting GS4 status listener
[04:10:59 WARN]: Unable to determine local host IP, please set server-ip in server.properties
13.10.20 12:10:59 (+0800) mc-server java.net.UnknownHostException: balenaminecraftserver: balenaminecraftserver: No address associated with hostname
13.10.20 12:10:59 (+0800) mc-server at java.net.InetAddress.getLocalHost(InetAddress.java:1642) ~[?:?]
13.10.20 12:10:59 (+0800) mc-server at net.minecraft.server.v1_16_R2.RemoteStatusListener.<init>(SourceFile:67) ~[patched_1.16.3.jar:git-Paper-220]
13.10.20 12:10:59 (+0800) mc-server at net.minecraft.server.v1_16_R2.RemoteStatusListener.a(SourceFile:89) ~[patched_1.16.3.jar:git-Paper-220]
13.10.20 12:10:59 (+0800) mc-server at net.minecraft.server.v1_16_R2.DedicatedServer.init(DedicatedServer.java:248) ~[patched_1.16.3.jar:git-Paper-220]
13.10.20 12:10:59 (+0800) mc-server at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:939) ~[patched_1.16.3.jar:git-Paper-220]
13.10.20 12:10:59 (+0800) mc-server at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-220]
13.10.20 12:10:59 (+0800) mc-server at java.lang.Thread.run(Thread.java:834) [?:?]
13.10.20 12:10:59 (+0800) mc-server Caused by: java.net.UnknownHostException: balenaminecraftserver: No address associated with hostname
13.10.20 12:10:59 (+0800) mc-server at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]
13.10.20 12:10:59 (+0800) mc-server at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929) ~[?:?]
13.10.20 12:10:59 (+0800) mc-server at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1515) ~[?:?]
13.10.20 12:10:59 (+0800) mc-server at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848) ~[?:?]
13.10.20 12:10:59 (+0800) mc-server at java.net.InetAddress.getAllByName0(InetAddress.java:1505) ~[?:?]
13.10.20 12:10:59 (+0800) mc-server at java.net.InetAddress.getLocalHost(InetAddress.java:1637) ~[?:?]
13.10.20 12:10:59 (+0800) mc-server ... 6 more

```

---

<div class="post-metadata">

**Author:** ![anujdeshpande](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/anujdeshpande/32/3155_2.png) [@anujdeshpande](https://forums.balena.io/u/anujdeshpande)\
**Post date:** [October 13, 2020, 6:31am UTC](https://forums.balena.io/t/minecraft-balena-server-not-working/197836/7 "2020-10-13T06:31:51Z")

</div>

Hi

Are you setting this up for playing over the local network?

---

<div class="post-metadata">

**Author:** ![anujdeshpande](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/anujdeshpande/32/3155_2.png) [@anujdeshpande](https://forums.balena.io/u/anujdeshpande)\
**Post date:** [October 13, 2020, 6:34am UTC](https://forums.balena.io/t/minecraft-balena-server-not-working/197836/8 "2020-10-13T06:34:26Z")

</div>

Can you tell the detailed steps that you did to get here? I am guessing you flashed the pi, the device came online, and this is what you saw - is that right? Did you run any other commands?

---

<div class="post-metadata">

**Author:** ![Unknown](https://avatars.discourse-cdn.com/v4/letter/u/4bbf92/32.png) [@Unknown](https://forums.balena.io/u/Unknown)\
**Post date:** [October 13, 2020, 6:47am UTC](https://forums.balena.io/t/minecraft-balena-server-not-working/197836/12 "2020-10-13T06:47:48Z")

</div>

I’m trying to set it up for the local network - and have been messing around with it for about an hour trying to get it to work - i managed to fix the corrupt jarfile issue and get it to not come up with the error ‘could not connect’ but got stuck on this. I haven’t been able to access the server at any point throughout my debugging if that helps

---

<div class="post-metadata">

**Author:** ![mtoman](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/mtoman/32/3599_2.png) [@mtoman](https://forums.balena.io/u/mtoman)\
**Post date:** [October 13, 2020, 12:50pm UTC](https://forums.balena.io/t/minecraft-balena-server-not-working/197836/14 "2020-10-13T12:50:41Z")

</div>

Hi,

I have tried setting up the server and I can confirm that I am able to see the message you shared but it looks like a warning to me, below that I can see the server starting successfully:

```auto
[12:44:11 INFO]: Starting GS4 status listener
[12:44:11 WARN]: Unable to determine local host IP, please set server-ip in server.properties
13.10.20 14:44:11 (+0200) mc-server java.net.UnknownHostException: balenaminecraftserver: balenaminecraftserver: No address associated with hostname
13.10.20 14:44:11 (+0200) mc-server at java.net.InetAddress.getLocalHost(InetAddress.java:1642) ~[?:?]
13.10.20 14:44:11 (+0200) mc-server at net.minecraft.server.v1_16_R2.RemoteStatusListener.<init>(SourceFile:67) ~[patched_1.16.3.jar:git-Paper-228]
13.10.20 14:44:11 (+0200) mc-server at net.minecraft.server.v1_16_R2.RemoteStatusListener.a(SourceFile:89) ~[patched_1.16.3.jar:git-Paper-228]
13.10.20 14:44:11 (+0200) mc-server at net.minecraft.server.v1_16_R2.DedicatedServer.init(DedicatedServer.java:248) ~[patched_1.16.3.jar:git-Paper-228]
13.10.20 14:44:11 (+0200) mc-server at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:939) ~[patched_1.16.3.jar:git-Paper-228]
13.10.20 14:44:11 (+0200) mc-server at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.3.jar:git-Paper-228]
13.10.20 14:44:11 (+0200) mc-server at java.lang.Thread.run(Thread.java:834) [?:?]
13.10.20 14:44:11 (+0200) mc-server Caused by: java.net.UnknownHostException: balenaminecraftserver: No address associated with hostname
13.10.20 14:44:11 (+0200) mc-server at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) ~[?:?]
13.10.20 14:44:11 (+0200) mc-server at java.net.InetAddress$PlatformNameService.lookupAllHostAddr(InetAddress.java:929) ~[?:?]
13.10.20 14:44:11 (+0200) mc-server at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1515) ~[?:?]
13.10.20 14:44:11 (+0200) mc-server at java.net.InetAddress$NameServiceAddresses.get(InetAddress.java:848) ~[?:?]
13.10.20 14:44:11 (+0200) mc-server at java.net.InetAddress.getAllByName0(InetAddress.java:1505) ~[?:?]
13.10.20 14:44:11 (+0200) mc-server at java.net.InetAddress.getLocalHost(InetAddress.java:1637) ~[?:?]
13.10.20 14:44:11 (+0200) mc-server ... 6 more
[12:44:11 INFO]: Thread Query Listener started
[12:44:11 INFO]: Starting remote control listener
[12:44:11 INFO]: Query running on 0.0.0.0:25565
[12:44:11 INFO]: Thread RCON Listener started
[12:44:11 INFO]: RCON running on 0.0.0.0:25575
[12:44:11 INFO]: Running delayed init tasks
[12:44:11 INFO]: Done (17.407s)! For help, type "help"

```

Can you check whether you can see that as well? Or share the whole log from the `mc-server` service if you do not mind.  
Also, are you trying to connect using the `balenaminecraftserver` hostname to connect to the server? Could you try using the IP address to connect and see whether that works?

Thanks

---

<div class="post-metadata">

**Author:** ![Unknown](https://avatars.discourse-cdn.com/v4/letter/u/4bbf92/32.png) [@Unknown](https://forums.balena.io/u/Unknown)\
**Post date:** [October 14, 2020, 2:27am UTC](https://forums.balena.io/t/minecraft-balena-server-not-working/197836/16 "2020-10-14T02:27:55Z")

</div>

It seems to have started working when i turned on my pi this morning - i could successfully connect using the address balenaminecraftserver, which is weird because it wouldn’t work before. Thanks for your help and I’m sorry for any inconvenience caused.

---

<div class="post-metadata">

**Author:** ![daniel.crowe](https://avatars.discourse-cdn.com/v4/letter/d/dbc845/32.png) [@daniel.crowe](https://forums.balena.io/u/daniel.crowe)\
**Post date:** [August 25, 2021, 12:12am UTC](https://forums.balena.io/t/minecraft-balena-server-not-working/197836/19 "2021-08-25T00:12:19Z")

</div>

I came here for a different balena project that was failing due to the same exception. I eventually found the solution and I thought I’d post it here in case anyone else needs it.

To fix this error, you need to add an entry to `/etc/hosts` pointing the balena device name to `127.0.0.1`.  
See here for more info: [java - InetAddress.getLocalHost() throws UnknownHostException - Stack Overflow](https://stackoverflow.com/a/1881967)

My project was running some java code over SSH on a balena device. The call the `InetAddress.getLocalHost` works fine when run directly, but fails over SSH.

---

<div class="post-metadata">

**Author:** ![Lizzieepton](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/lizzieepton/32/5393_2.png) [@Lizzieepton](https://forums.balena.io/u/Lizzieepton)\
**Post date:** [August 25, 2021, 3:13pm UTC](https://forums.balena.io/t/minecraft-balena-server-not-working/197836/20 "2021-08-25T15:13:18Z")

</div>

Thanks for sharing @daniel-crowe!
