Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Can't connect to the server #65

Closed
Gryfenfer97 opened this issue Jan 24, 2022 · 19 comments
Closed

Can't connect to the server #65

Gryfenfer97 opened this issue Jan 24, 2022 · 19 comments
Assignees
Labels
question Further information is requested wontfix This will not be worked on

Comments

@Gryfenfer97
Copy link

Hello,

I have the same issue than the #56 . I can't connect to the server in local. I've used docker run -d --net=host -v $(pwd)/csgo-data:/home/steam/csgo-dedicated/ --name=csgo-dedicated cm2network/csgo to connect (I haven't set SRCDS_TOKEN because everything is on the same computer).

I am running the container on ArchLinux and the logs seems normal :

sv_camera_fly_enabled - missing cvar specified in bspconvar_whitelist.txt
Executing dedicated server config file
Unknown command "sm_cvar"
Unknown command "sv_unlag"
Unknown command "tv_allow_camera_man"
maxplayers set to 64
Console: "> ESL GOTV Config loaded - 14.01.2016 <"
Unknown command "sm_cvar"
Unknown command "sv_unlag"
Unknown command "tv_allow_camera_man"
maxplayers set to 64
Console: "> ESL GOTV Config loaded - 14.01.2016 <"
exec: couldn't exec gamemode_competitive_server.cfg
PrecacheScriptSound 'Survival.VO.Taunt4a' failed, no such sound script entry
PrecacheScriptSound 'Snowball.Bounce' failed, no such sound script entry
CHostage::Precache: missing hostage models for map de_dust2. Adding the default models.
PrecacheScriptSound 'balkan_epic_blank' failed, no such sound script entry
Commentary: Could not find commentary data file 'maps/de_dust2_commentary.txt'. 
Error parsing BotProfile.db - unknown attribute 'Rank'
Error parsing BotProfile.db - unknown attribute 'Rank'
[S_API] SteamAPI_Init(): SteamAPI_IsSteamRunning() did not locate a running instance of Steam.
[S_API] SteamAPI_Init(): Loaded '/home/steam/.steam/sdk32/steamclient.so' OK.
CAppInfoCacheReadFromDiskThread took 1 milliseconds to initialize
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit
SteamInternal_SetMinidumpSteamID:  Caching Steam ID:  76561198247692264 [API loaded yes]
SteamInternal_SetMinidumpSteamID:  Setting Steam ID:  76561198247692264
Setting breakpad minidump AppID = 740

Do you have any idea ? I probably haven't setup docker correctly, that's my first time using it.

Thank's.

@Gryfenfer97
Copy link
Author

I just tested the official nginx docker image and it worked perfectly. I was able to connect to the server, so I think the problem doesn't come from my docker install.

@Gryfenfer97
Copy link
Author

The server appears correctly in the list of community servers (LAN tab) but I still can't connect to it: connection failed after 30 retries.

@CM2Walki CM2Walki self-assigned this Jan 25, 2022
@CM2Walki CM2Walki added the question Further information is requested label Jan 25, 2022
@CM2Walki
Copy link
Owner

The server appears correctly in the list of community servers (LAN tab) but I still can't connect to it: connection failed after 30 retries.

How are you trying to connect? Via console?

@Gryfenfer97
Copy link
Author

Gryfenfer97 commented Jan 26, 2022

I tested the both way, the console and the gui.
I have the same error in both cases

@CM2Walki
Copy link
Owner

Are you behind a NAT? Also did you use your private or public IP to connect via the console?

I haven't operated a csgo server in a local network, yet. But I have developed games with Steamworks before. The connection via the GUI will likely fail because Steam will publish your public IP (there is no way to overwrite this behavior) and without port forwarding on the router, you will fail to connect.

Connection via console should work if you utilize your PC's private IP.

@Gryfenfer97
Copy link
Author

As the docker is on the same machine as csgo, I use connect 127.0.0.1 to connect to the server

@CM2Walki
Copy link
Owner

Could try your local IP? It could be that this:
https://github.com/CM2Walki/CSGO/blob/master/etc/entry.sh#L70-L71
Only listens to your private IP and not your loopback interface. Technically it should listen to both, but you never know 🤷.

@Gryfenfer97
Copy link
Author

I've set my local ip (192.xx.xx.xx) for the variables SRCDS_NET_PUBLIC_ADDRESS and SRCDS_IP and it didn't change anything.

@Gryfenfer97
Copy link
Author

Gryfenfer97 commented Jan 26, 2022

I actually managed to successfully connect to the server. The main point of the solution is to edit the value of sv_lan in the csgo/cfg/server.cfg file from 0 to 1.
Note that adding +sv_lan 1 as argument doesn't work.

Here is the full line I used to launch the server: docker run -d --net=host -v $(pwd)/csgo-data:/home/steam/csgo-dedicated/ -e SRCDS_PORT=27016 -e SRCDS_IP="0.0.0.0" -e SRCDS_PW="" --name=csgo-dedicated cm2network/csgo

Then to connect you must use the local address of your machine (not 127.0.0.1).

Last point for those who are using the same PC for the server and the game: the port 27015 seems to be already used (but I am not 100% sure about that ) so I used the port 27016.

@CM2Walki
Copy link
Owner

CM2Walki commented Feb 6, 2022

See cb5a890, I removed sv_lan 0 from the config and added it to the environment variables instead. This should make it overwritable. Can you try again @Gryfenfer97?

@Gryfenfer97
Copy link
Author

Gryfenfer97 commented Feb 6, 2022

I don't really understand why but it doesn't change anything when it should work.
The +sv_lan should overwrite the one in the config so I'm surprised that it doesn't work.

Changing it directly in the config still work however.

Edit: This is the command I used to start the container:

docker run -d --net=host \
        -v $(pwd)/${volume_name}:/home/steam/csgo-dedicated/ \
        -e SRCDS_PORT="$port" \
	-e SRCDS_TV_PORT="$tvport" \
        -e SRCDS_IP="$ip" \
        -e SRCDS_PW=""  \
        -e SRCDS_LAN=1 \
	--name=$1 \
        cm2network/csgo:sourcemod   

@CM2Walki
Copy link
Owner

CM2Walki commented Feb 6, 2022

So just to clarify. You did remove it from your server.cfg and pulled the latest version of the image that passes it as a command line variable?

Unfortunately, I don't have a system where I can test local network things like this. So sorry for asking such trivial things.

@Dezainer
Copy link

Dezainer commented Feb 7, 2022

Hey, i'm also trying to get a local server up and can't seem to be able to connect to it even tho they are on the same machine.
I'm using WSL on windows btw, don't know if that may have something to do with it, but other images are working fine, as @Gryfenfer97 also said.

I'm using a compose file to structure the setup:

version: '3'
services:
  csgo:
    image: cm2network/csgo
    container_name: csgo
    environment:
      - SRCDS_LAN="1"
      - SRDCS_IP="0.0.0.0"
      - SRCDS_PORT=27016
      - SRCDS_PW=""
    network_mode: host

Also, I've just tried deleting and pulling the lastet version of the image, and the SV_LAN option did not work as @CM2Walki said it should on the last pull request, I had to manually change it on the server.cfg file, but still couldn't connect.

@Gryfenfer97
Copy link
Author

So just to clarify. You did remove it from your server.cfg and pulled the latest version of the image that passes it as a command line variable?

Unfortunately, I don't have a system where I can test local network things like this. So sorry for asking such trivial things.

No I didn't delete it from the server.cfg because the +sv_lan 1 should overwrite the variable in the server.cfg file. I just edited the variable in the server.cfg to make it work.
However I will test this soon.

@michihupf
Copy link

michihupf commented Feb 20, 2022

I actually managed to successfully connect to the server. The main point of the solution is to edit the value of sv_lan in the csgo/cfg/server.cfg file from 0 to 1.

This did not work for me. Had the issue that I could not connect to the server as:
Server only accepting connections from game lobby was returned.

Already tried restarting the server and my game multiple times. I had used port 27015. Using another port doesn't seem to even give me any response from the server.

EDIT: (i got it to work through the server browser)
I just used the server browser and although this was the command to start the server:
podman run -d --net=host -v (pwd)/server:/home/steam/csgo-dedicated/ --name=csgo-ds3 -e SRCDS_RCONPW="testing" -e SRCDS_LAN="1" -e SRCDS_PORT=27016 -e SRCDS_IP="0.0.0.0" -e SRCDS_PW="" 689e0a485abc
the server uses port 27017. This seems really weird.

@Gryfenfer97
Copy link
Author

@michihupf check that you don't have another container running at the same time that is using the port ( docker container ls)
If you try to start a server on the port n while another one is running on that same port, the server will start on the port n+1

@teotwaki
Copy link

A few notes:

  • I had to manually edit server.cfg to set sv_lan to 1. Without this, the error "only accepting connections from game lobby" kept popping up.
  • It appears that maybe the EXPOSE lines in the Dockerfile conflict with docker-compose? I saw weird behaviour with additional ports being forwarded even when I didn't include them in my ports configuration. I built a local version of the image without the EXPOSE statements, which appears to work fine.
  • I'm not sure it makes sense to use EXPOSE (which is supposed to be for documentation purposes only), considering that the actual ports in use depend on environment variables.
  • Host networking is not required for this to work.
  • I'm still trying to figure out which ports are required to forward so that the server shows up in the server browser. Not entirely sure this is possible as the process can't bind to a LAN address when running with container networking, and thus probably wouldn't know what IP to provide to the server browser.

@michihupf
Copy link

michihupf commented Feb 23, 2022

@michihupf check that you don't have another container running at the same time that is using the port ( docker container ls) If you try to start a server on the port n while another one is running on that same port, the server will start on the port n+1

I do not even have another container stopped which is the weird part. The only running container is this csgo container.

I had to manually edit server.cfg to set sv_lan to 1. Without this, the error "only accepting connections from game lobby" kept popping up.

I had the same issue this fixed it for me as well.

Edit:
Some additional info with a really weird behaviour:
So basically I had the game open and connected to the server (it had used 27017 instead of 27016 - maybe the game used it or something?). After that I forgot about the server and went into a Dangerzone match with a friend. I got kicked because my files were not matching the game files of the Dangerzone server. I then closed my game but to my surprise Steam thought that I had the game running still until I shut down my local server container and restarted Steam.

This was actually caused by some launch paramenters that I had set on CS:GO. This was not an issue with this repository.

@kamild1996
Copy link

Can confirm this is still an issue as of the writing of this comment. Despite SRCDS_LAN set to 1, I have to manually set sv_lan to 1 in server.cfg to connect.

@CM2Walki CM2Walki added the wontfix This will not be worked on label Oct 3, 2023
@CM2Walki CM2Walki closed this as completed Oct 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

6 participants