Jump to content

  • Curse Sites
Become a Premium Member! Help
Latest News Article

Error: Failed to bind to port


  • Please log in to reply
27 replies to this topic

#1

kenn213
    kenn213

    Tree Puncher

  • Members
  • 14 posts

Posted 04 February 2011 - 04:25 PM

Hey Minecraft Forum,

I've been running a minecraft server on my linux box for some time now. I recently just ditched my old linux distro for Debian. I didn't touch my portmaps so those stayed the same. After doing a clean install of Debian, I made sure my java was installed and up to date, copied my minecraft server back to my linux server, tried to start it up, and I'm getting the "Failed to bind to port, address already in use" error.

After seeing this I tried running lsof -i :25565 to see what was running on that port and got:

java    3702 root   11u  IPv4  11305       TCP *:25565 (LISTEN)

This leads me to believe that java is listening on that port, but nothing is running.

I then tried running it on 25564 as well as a number of other ports and they all come up with the same result: the failed to bind to port error.

Is there any other reason for getting this error than the port being in use, or maybe have I overlooked something?

Edit: I should note that I'm doing everything the same way as I had it before which was working. I've also disabled my firewall for the moment while I try to figure this out. My router is forwarding the same ports as before and doesn't have firewall software in it.

Register or log in to remove.

#2

Joe.
    Joe.

    Zombie Killer

  • Members
  • 174 posts
  • Location: United Kingdom
  • Minecraft: Overcookedjoe

Posted 04 February 2011 - 04:40 PM

Im having the same problem, I've done all the port forwarding and everything...
Playing Minecraft Since September 12th 2010 - Alpha 1.1

#3

hexparrot
    hexparrot

    Lapis Lazuli Collector

  • Members
  • 1150 posts
  • Location: Phoenix, AZ
  • Minecraft: hexparrot

Posted 04 February 2011 - 04:48 PM

kenn213 said:

Hey Minecraft Forum,

I've been running a minecraft server on my linux box for some time now. I recently just ditched my old linux distro for Debian. I didn't touch my portmaps so those stayed the same. After doing a clean install of Debian, I made sure my java was installed and up to date, copied my minecraft server back to my linux server, tried to start it up, and I'm getting the "Failed to bind to port, address already in use" error.

After seeing this I tried running lsof -i :25565 to see what was running on that port and got:

java    3702 root   11u  IPv4  11305       TCP *:25565 (LISTEN)

This leads me to believe that java is listening on that port, but nothing is running.

I then tried running it on 25564 as well as a number of other ports and they all come up with the same result: the failed to bind to port error.

Is there any other reason for getting this error than the port being in use, or maybe have I overlooked something?

Edit: I should note that I'm doing everything the same way as I had it before which was working. I've also disabled my firewall for the moment while I try to figure this out. My router is forwarding the same ports as before and doesn't have firewall software in it.

provide more of the debug output from the server log and it'll be easier to diagnose.
Posted Image

#4

kenn213
    kenn213

    Tree Puncher

  • Members
  • 14 posts

Posted 04 February 2011 - 05:04 PM

Here is everything I'm getting from the console:

2011-02-04 11:53:25 [INFO] Starting minecraft server version Beta 1.2_01
2011-02-04 11:53:25 [INFO] Loading properties
2011-02-04 11:53:25 [INFO] Starting Minecraft server on *:25565
2011-02-04 11:53:25 [WARNING] **** FAILED TO BIND TO PORT!
2011-02-04 11:53:25 [WARNING] The exception was: java.net.BindException: Address already in use
2011-02-04 11:53:25 [WARNING] Perhaps a server is already running on that port?

Also I checked this post: viewtopic.php?f=1013&t=39541 which seems to indicate an issue with Debian trying to use ipv6 over ipv4 but their solution didn't work for me.

#5

hexparrot
    hexparrot

    Lapis Lazuli Collector

  • Members
  • 1150 posts
  • Location: Phoenix, AZ
  • Minecraft: hexparrot

Posted 04 February 2011 - 05:25 PM

kenn213 said:

Here is everything I'm getting from the console:

2011-02-04 11:53:25 [INFO] Starting minecraft server version Beta 1.2_01
2011-02-04 11:53:25 [INFO] Loading properties
2011-02-04 11:53:25 [INFO] Starting Minecraft server on *:25565
2011-02-04 11:53:25 [WARNING] **** FAILED TO BIND TO PORT!
2011-02-04 11:53:25 [WARNING] The exception was: java.net.BindException: Address already in use
2011-02-04 11:53:25 [WARNING] Perhaps a server is already running on that port?

Also I checked this post: viewtopic.php?f=1013&t=39541 which seems to indicate an issue with Debian trying to use ipv6 over ipv4 but their solution didn't work for me.

tried rebooting the computer?  it could be that a stale copy of the server is still running in the background (stale meaning, its up, bound to the port, but not accessible).  rebooting the server would solve this, or force closing any instances of java if youre comfy doing that.

**** FAILED TO BIND TO PORT! can be caused by a few things, but based on YOUR debug output, ^^ is the most likely cause.
Posted Image

#6

kenn213
    kenn213

    Tree Puncher

  • Members
  • 14 posts

Posted 04 February 2011 - 05:37 PM

hexparrot said:

tried rebooting the computer?  it could be that a stale copy of the server is still running in the background (stale meaning, its up, bound to the port, but not accessible).  rebooting the server would solve this, or force closing any instances of java if youre comfy doing that.

**** FAILED TO BIND TO PORT! can be caused by a few things, but based on YOUR debug output, ^^ is the most likely cause.

Way to make me look like a moron haha (cant believe that worked). Restarted my linux server and my minecraft server started up but with errors.

Now I'm getting:
SEVERE: Can't load library: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/xawt/libmawt.so (Is it up to date?)
java.lang.UnsatisfiedLinkError: Can't load library: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/xawt/libmawt.so
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1666)
	at java.lang.Runtime.load0(Runtime.java:787)
	at java.lang.System.load(System.java:1022)
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1767)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1684)
	at java.lang.Runtime.loadLibrary0(Runtime.java:840)
	at java.lang.System.loadLibrary(System.java:1047)
	at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:67)
	at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:47)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.Toolkit.loadLibraries(Toolkit.java:1614)
	at java.awt.Toolkit.(Toolkit.java:1636)
	at java.awt.Color.(Color.java:279)
	at org.dynmap.kzedmap.KzedMap.loadColorSet(KzedMap.java:351)
	at org.dynmap.kzedmap.KzedMap.(KzedMap.java:40)
	at org.dynmap.MapManager.(MapManager.java:60)
	at org.dynmap.DynmapPlugin.onEnable(DynmapPlugin.java:45)
	at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:135)
	at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:294)
	at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:175)
	at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:64)
	at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:45)
	at net.minecraft.server.MinecraftServer.e(MinecraftServer.java:153)
	at net.minecraft.server.MinecraftServer.c(MinecraftServer.java:140)
	at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:104)
	at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:181)
	at net.minecraft.server.ThreadServerApplication.run(SourceFile:512)

I've tried running "apt-get install default-jre" and that's up to date. Anything else I'm missing?

#7

kenn213
    kenn213

    Tree Puncher

  • Members
  • 14 posts

Posted 04 February 2011 - 06:23 PM

Nevermind. Must be a plugin causing that error.

#8

Drizien
    Drizien

    Out of the Water

  • Curse Premium
  • Curse Premium
  • 6 posts

Posted 04 February 2011 - 06:26 PM

hmm, maybe your previous MC server didn't close correctly - try:
ps x
this willlist all your stuf on linux under your user, look for a process called JAVA or something similar, get the number that's next to it, then do:
kill -9 number
this will terminate the process and should clear the port

Also, try reinstalling java again

#9

zombiemann
    zombiemann

    Redstone Miner

  • Curse Premium
  • Curse Premium
  • 594 posts

Posted 04 February 2011 - 06:45 PM

99% of the time in my experience Failed to bind port means there is something already using said port.  

I know you posted you got it resolved, just leaving this here for others that might wander through with the same issue
zombiecraft.serverbeer.com - Permissions enabled home server, focusing on big builds

See what we are building here: http://zombiecraft.servebeer.com

#10

hexparrot
    hexparrot

    Lapis Lazuli Collector

  • Members
  • 1150 posts
  • Location: Phoenix, AZ
  • Minecraft: hexparrot

Posted 04 February 2011 - 06:47 PM

zombiemann said:

99% of the time in my experience Failed to bind port means there is something already using said port.  

I know you posted you got it resolved, just leaving this here for others that might wander through with the same issue

IMO, most problems arent that something is on the same port.  *IMO* most bind to port problems is people putting the server-ip in the server.properties file, which...shouldnt be there for *most* configurations.
Posted Image

#11

Relio
    Relio

    Iron Miner

  • Members
  • 251 posts

Posted 04 February 2011 - 07:14 PM

I wanted to chime in on this also:

You are correct in most general non-Minecraft cases, zombiemann.  If another application or instance of an application is using the port, you won't be able to bind to the port.

But in many cases as I've seen in the forums, it's caused by someone putting an IP in the server-ip field of their server.properties file.  Putting an IP in this field will tell the server to listen to all packets directed TO that IP.  This is used when/if you have a server on a computer with multiple IPs, and you want to limit the Minecraft server to a single IP.

Most people will put their external IP here causing the server to give an error because the computer does not own the external IP.

#12

Mattrhorn

Posted 03 March 2011 - 11:50 PM

Hey  im doin this on mac and this is the error i get


2011-03-03 18:41:49 [INFO] Starting minecraft server version Beta 1.3
2011-03-03 18:41:49 [INFO] Loading properties
2011-03-03 18:41:49 [INFO] Starting Minecraft server on 173.33.98.169:25565
2011-03-03 18:41:49 [WARNING] **** FAILED TO BIND TO PORT!
2011-03-03 18:41:49 [WARNING] The exception was: java.net.BindException: Can't assign requested address
2011-03-03 18:41:49 [WARNING] Perhaps a server is already running on that port?


please help me

Posted Image


#13

Orcworm
    Orcworm

    Ghast Hunter

  • Members
  • 2731 posts
  • Location: Britain
  • Minecraft: Orcworm

Posted 03 March 2011 - 11:52 PM

Leave the server-ip section in server.properties blank. Other players will still be able to connect using your external IP if you're port forwarded correctly.
Posted Image

#14

Mattrhorn

Posted 03 March 2011 - 11:54 PM

when i tried to do port forwarding i couldnt connect to the internet  is there an easy way on portforwarding (i tried portmap and couldnt get it working) same isue with binding ports

Posted Image


#15

gunzmaster95
  • Location: NJ U.S.A.
  • Minecraft: gunzmaster95

Posted 22 March 2011 - 12:28 AM

Relio said:

I wanted to chime in on this also:

You are correct in most general non-Minecraft cases, zombiemann.  If another application or instance of an application is using the port, you won't be able to bind to the port.

But in many cases as I've seen in the forums, it's caused by someone putting an IP in the server-ip field of their server.properties file.  Putting an IP in this field will tell the server to listen to all packets directed TO that IP.  This is used when/if you have a server on a computer with multiple IPs, and you want to limit the Minecraft server to a single IP.

Most people will put their external IP here causing the server to give an error because the computer does not own the external IP.


~~~~OMFG!!!!!!!!!!!!!! IT ACTUALLY WORKED HOURS OF RESEARCH AND THIS SIMPLE SOLUTION WORKED!! THNX I HEART U!! :SSSS:  :SSSS:~~~~~~NVM it worked for about a minute, then now its not working anymore!! GRRRR. :VV:  :VV:  :VV:  :VV:  :Zombie:  :VV:  :VV:  :VV:  :VV:

#16

Celicam
    Celicam

    Void Walker

  • Members
  • 1673 posts
  • Location: Lookin at all the cool people's animated gif's
  • Minecraft: Camtheman16

Posted 25 April 2011 - 05:55 PM

Lool thank you I love you guys  :Skeleton:  :Zombie:  :Diamond:  :SSSS:  :)  :Diamond:  :Diamond:  :Diamond:  :Diamond:  :Diamond:  :Diamond:  :Diamond: for you!
So....who am I? I am the night, I am justice....Wait, wrong intro.

#17

IDKANYTHING

Posted 05 May 2011 - 11:48 PM

I have the exact same problem. I've done everything on this page and it doesn't work! Anyother ideas? I've turned off and restarted all my computers and then try to run it and it still  says that.

#18

IDKANYTHING

Posted 05 May 2011 - 11:49 PM

oh and im on a mac too

#19

landryland

Posted 07 May 2011 - 05:44 PM

You need to go into ur router by typing in the internet 192.168.1.1 (Thats with most routers) and add a port fowording of 25565.

#20

andrewkc
    andrewkc

    Newly Spawned

  • Members
  • 1 posts

Posted 26 July 2011 - 07:45 AM

I had this exact same "FAILED TO BIND TO PORT" problem and my solution had nothing to do with port forwarding in the end I just uninstalled Lowerping a WoW tunneling problem so everyone who is running programs like wowtunnels, smoothping etc should probably try the same.