V2.6, Linux, Error: Lost connection to server (read error)!

You can get help here if Freeciv doesn't start on your computer, or if you keep getting fatal errors while playing etc.
ppfreeciv
Posts: 7
Joined: Tue Nov 13, 2018 2:17 pm

V2.6, Linux, Error: Lost connection to server (read error)!

Post by ppfreeciv »

Hello there,

I compiled FreeCiv 2.6 from the source and installed it on Linux (L)ubuntu 16.04. No errors were shown compiling it. I started it in the compile folder using scrip fcgui. The GTK start screen is launched correctly. However, if I click on the buttons to start a new game, start a scenario or load a saved game, nothing happens and the terminal shows the error message:
Lost connection to server (read error)!

In the task viewer I see the freeciv server is started and terminated more or less immediately.

When I start server manually and then the client I can connect to server via by selecting "Connect to Network Game" and there 'localhost' as the server.

However, this does not help me as I cannot create a new game, I log into the default server game. I like to configure the game with the UI.

Any idea what is going wrong if I start the client directly?
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: V2.6, Linux, Error: Lost connection to server (read error)!

Post by cazfi »

Do you have another version of freeciv installed? Maybe it's finding wrong server binary to run.

If you run client with at least verbose output (commandline parameter: '-d 3'), it logs commandline arguments it gives for the server it launches. There's quite a lot of output with '-d 2' so you probably want to write the output to a file with '-l output.log'. Search for "Arguments to spawned server:" in the produced output.log.
You can then test if you can launch separate server also with those exact parameters.
ppfreeciv
Posts: 7
Joined: Tue Nov 13, 2018 2:17 pm

Re: V2.6, Linux, Error: Lost connection to server (read error)!

Post by ppfreeciv »

1st question:
I have another freeciv server installed (2.5.3), but I compiled 2.5.10 in the same way as I did now with 2.6.0 and 2.5.10 works in this way.

2nd question:
Output is:
3: Arguments to spawned server: -p 5557 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none

I can start the server with these settings, but then I cannot connect to it.
It is not even listed in the 'Local Area Network' list.

If I use arguments: -p 5557 --bind localhost -q 1 -e
then it is listed in 'Local Area Network' list, but I still cannot connect to it.

I just compared with working 2.5.10 release. Output -p 5557 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none is exactly the same.
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: V2.6, Linux, Error: Lost connection to server (read error)!

Post by cazfi »

ppfreeciv wrote:3: Arguments to spawned server: -p 5557 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none

It is not even listed in the 'Local Area Network' list.
That's as expected, "-A none" is there to stop announcing it as public server. You still should be able to connect it with 'localhost' as server and '5557' as port.
ppfreeciv
Posts: 7
Joined: Tue Nov 13, 2018 2:17 pm

Re: V2.6, Linux, Error: Lost connection to server (read error)!

Post by ppfreeciv »

Update to last post:
If I start server with settings -p 5557 --bind localhost -q 1 -e --saves ~/.freeciv/saves --scenarios ~/.freeciv/scenarios -A none
the server is not visible in 'Local Area Network' list, BUT I can connect to it, when I press 'connect' (sorry for wrong description above).

It seems that only servers with port 5556 are visible, but even if they are visible sometimes it is not possible to connect (as described above). It is weird that I can connect to a server, that is not visible.
ppfreeciv
Posts: 7
Joined: Tue Nov 13, 2018 2:17 pm

Re: V2.6, Linux, Error: Lost connection to server (read error)!

Post by ppfreeciv »

OK, you give explanation while I still trying to test something. Option -A none describes the 'weird' behaviour.
So problems remains, why I cannot start and connect to server from the client GUI.
Last edited by ppfreeciv on Tue Nov 13, 2018 6:31 pm, edited 1 time in total.
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: V2.6, Linux, Error: Lost connection to server (read error)!

Post by cazfi »

ppfreeciv wrote:1st question:
I have another freeciv server installed (2.5.3), but I compiled 2.5.10 in the same way as I did now with 2.6.0 and 2.5.10 works in this way.
So it's a possibility that it finds the installed 2.5.3 server. It's compatible with 2.5.x, but not with 2.6.x.
ppfreeciv
Posts: 7
Joined: Tue Nov 13, 2018 2:17 pm

Re: V2.6, Linux, Error: Lost connection to server (read error)!

Post by ppfreeciv »

OK, it seems you are on the right track. I renamed the installed 2.5.3 server and now the output is as follows:
1: Failed to connect to spawned server!

Question is, why GUI does not use local server in its folder but tries to start installed server. I am not really familliar with Linux internals.
ppfreeciv
Posts: 7
Joined: Tue Nov 13, 2018 2:17 pm

Re: V2.6, Linux, Error: Lost connection to server (read error)!

Post by ppfreeciv »

Maybe I misunderstood the Install documentation completely.
It says: "It's perfectly feasible to play Freeciv in this directory, without installing it. If you do this, the "fcgui" and "fcser" scripts may be useful, although they are not as necessary as they used to be."

So with old 2.5.10 compilation I started fcgui and I thought it was using the compiled server, but it used the 2.5.3 server.
Maybe a better description for fcgui and fcser is necessary for dummies like me.
Maybe you can tell me how I should use it or is a full installation advisable?
cazfi
Elite
Posts: 3093
Joined: Tue Jan 29, 2013 6:54 pm

Re: V2.6, Linux, Error: Lost connection to server (read error)!

Post by cazfi »

ppfreeciv wrote:OK, it seems you are on the right track. I renamed the installed 2.5.3 server and now the output is as follows:
1: Failed to connect to spawned server!
So far I've been thinking this to be some sort of problem in the order in which different directories are searched for the server, but it can't find server from the build directory at all. My guess would be that you have not configured with "--enable-debug".
By default we don't support launching server from the current directory (whatever that is), but only from the defined installation directory, for security reasons. Otherwise bad guys could trick you to launch their program just named as "freeciv-server" that they have managed to get to whatever non-secured directory you are at. This restriction is lifted on debug builds ("--enable-debug").
Post Reply