2.6.0 cannot spawn a server

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
Post Reply
Alcamtar
Posts: 7
Joined: Sat Jun 10, 2017 10:22 pm

2.6.0 cannot spawn a server

Post by Alcamtar »

I just installed Freeciv 2.6.0 on Arch (Manjaro) linux. I launched the GTK client and clicked Start New Game, but it wouldn't start. At the bottom of the window, the following four messages were displayed in sequence:
freeciv-gtk wrote: Starting local server
Couldn't connect to the server...
We probably couldn't start it from here
You'll have to start one manually. Sorry...
Every time I try Start New Game, the same four messages are displayed.

When launched the client from the command line got this:
bash wrote:$ freeciv-gtk
(freeciv-gtk3:27155): Gtk-WARNING **: 21:30:48.612: Theme parsing error: gtk.css:244:33: The :insensitive pseudo-class is deprecated. Use :disabled instead.
1: Failed to connect to spawned server!
With -d 3 I got this:
bash wrote:$ freeciv-gtk -d 3
(freeciv-gtk3:27403): Gtk-WARNING **: 21:37:46.607: Theme parsing error: gtk.css:244:33: The :insensitive pseudo-class is deprecated. Use :disabled instead.
3: Reading registry
3: Metaserver says latest 'stable' version is '2.6.0'; we have '2.6.0'
3: Arguments to spawned server: -p 5557 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none
1: Failed to connect to spawned server!
Next I tried launching the server with the same command line:
bash wrote:$ freeciv-server -p 5557 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none
This is the server for Freeciv version 2.6.0
You can learn a lot about Freeciv at http://www.freeciv.org/
This freeciv-server program has player authentication support, but it's currently not in use.
0: bind failure: Address already in use (3 failed)
2: Host: 127.0.0.1, Port: 5557 (IPv4)
Not sure where to go from here. What else uses port 5557? I have no other freeciv running, this was a fresh install.
madmax
Veteran
Posts: 56
Joined: Sun Mar 26, 2017 5:34 pm

Re: 2.6.0 cannot spawn a server

Post by madmax »

You may see what's running there with any of:
fuser 5557/tcp
lsof -i :5557
netstat -ltp

Have you tried manually launching the server on another port, and if that works, telling the client to connect to that one?
Alcamtar
Posts: 7
Joined: Sat Jun 10, 2017 10:22 pm

Re: 2.6.0 cannot spawn a server

Post by Alcamtar »

Thanks.

Here are the results:
bash wrote:$ sudo fuser 5557/tcp

$ sudo lsof -i :5557

$ sudo netstat -ltp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 localhost:27060 0.0.0.0:* LISTEN 28542/steam
tcp 0 0 0.0.0.0:57621 0.0.0.0:* LISTEN 28097/spotify --for
tcp 0 0 0.0.0.0:ssh 0.0.0.0:* LISTEN 622/sshd
tcp 0 0 localhost:ipps 0.0.0.0:* LISTEN 623/cupsd
tcp 0 0 0.0.0.0:27036 0.0.0.0:* LISTEN 28542/steam
tcp 0 0 localhost:57343 0.0.0.0:* LISTEN 28542/steam
tcp 0 0 0.0.0.0:35239 0.0.0.0:* LISTEN 28097/spotify --for
tcp6 0 0 [::]:ssh [::]:* LISTEN 622/sshd
tcp6 0 0 localhost:ipps [::]:* LISTEN 623/cupsd

$ freeciv-server -p 5556 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none
This is the server for Freeciv version 2.6.0
You can learn a lot about Freeciv at http://www.freeciv.org/
This freeciv-server program has player authentication support, but it's currently not in use.
0: bind failure: Address already in use (3 failed)
2: Host: 127.0.0.1, Port: 5556 (IPv4)

$ freeciv-server -p 5557 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none
This is the server for Freeciv version 2.6.0
You can learn a lot about Freeciv at http://www.freeciv.org/
This freeciv-server program has player authentication support, but it's currently not in use.
0: bind failure: Address already in use (3 failed)
2: Host: 127.0.0.1, Port: 5557 (IPv4)

$ freeciv-server -p 5558 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none
This is the server for Freeciv version 2.6.0
You can learn a lot about Freeciv at http://www.freeciv.org/
This freeciv-server program has player authentication support, but it's currently not in use.
0: bind failure: Address already in use (3 failed)
2: Host: 127.0.0.1, Port: 5558 (IPv4)

$ freeciv-server -p 5559 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none
This is the server for Freeciv version 2.6.0
You can learn a lot about Freeciv at http://www.freeciv.org/
This freeciv-server program has player authentication support, but it's currently not in use.
0: bind failure: Address already in use (3 failed)
2: Host: 127.0.0.1, Port: 5559 (IPv4)

$ freeciv-server -p 5560 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none
This is the server for Freeciv version 2.6.0
You can learn a lot about Freeciv at http://www.freeciv.org/
This freeciv-server program has player authentication support, but it's currently not in use.
0: bind failure: Address already in use (3 failed)
2: Host: 127.0.0.1, Port: 5560 (IPv4)
None of these ports appear to be in use. I have tried a fair number of other ports as well, all gives the same result.
madmax
Veteran
Posts: 56
Joined: Sun Mar 26, 2017 5:34 pm

Re: 2.6.0 cannot spawn a server

Post by madmax »

Any of the three commands shows the port is not in use. And then no matter what port you pass to the server, it says it cannot bind to it because the address is in use. :?
I've installed Manjaro (18.0.4 XFCE edition, though the DE shouldn't matter) in a VM, updated the system, installed freeciv (2.6.0-3) and... it works. I've even tried monkey playing with firewall settings and I haven't managed to accidentally make it not work.
dimi
Posts: 1
Joined: Mon Jul 01, 2019 1:01 pm

Re: 2.6.0 cannot spawn a server

Post by dimi »

EDIT: I managed to fix this. There were double entries in /etc/hosts for localhost. Removing duplicates solves this to me.

I experience exactly the same problem, but I run Debian. Client cannot spawn a server, and if I try to run a server, with parameters client tries to use, I get

Code: Select all

3: Server attempting to listen on localhost:5557
0: bind failure: Address already in use (4 failed)
2: Host: ::1, Port: 5557 (IPv6)
But if I change --bind option from "localhost" to "127.0.0.1", or just remove it, server starts without a complain. May be something is broken with loopback interface.

How can I help to debug this?
Alcamtar
Posts: 7
Joined: Sat Jun 10, 2017 10:22 pm

Re: 2.6.0 cannot spawn a server

Post by Alcamtar »

Wow thanks dimi!

I know this is a super late response but I had given up and have not tried playing for a year and a half. Tried it again today (using 2.8.2) and it failed again so the issue still exists. But after running across my old question online and reading dimi's post, I found my /etc/hosts also had two entries for localhost. Removing one of them fixed it.

It's odd because there are actually three entries. Two for 127.0.0.1 and one ::1 entry for IPv6. Removing one of the 127.0.0.1 entries resolved it, but the IPv6 entry seems not to cause a problem.

I haven't had any other issues in the last 18 months, only with freeciv. Anyway that was indeed the problem.
Post Reply