csgo icon indicating copy to clipboard operation
csgo copied to clipboard

Cant connect to server created with docker-compose

Open Henroks opened this issue 5 years ago • 9 comments

This is my docker-compose.yml:

version: "3"
networks:
  csgo:
    external: true

services:
    dedicated:
        networks:
          - default
          - csgo
        image: kmallea/csgo
        privileged: true
        ports:
          - "27015:27015/tcp"
          - "27015:27015/udp"
          - "27020:27020/tcp"
          - "27020:27020/udp"
        volumes:
          - ./:/home/steam/csgo
        environment:
            STEAM_ACCOUNT: TOKEN
            SERVER_PASSWORD: hehe
            SERVER_HOSTNAME: asdasd
            RCON_PASSWORD: pw123
            IP: 0.0.0.0
            PORT: 27015
            LAN: 1
        tty: true

I can see it in Local Network (LAN) in csgo, but cant connect, any idea?

Henroks avatar Jun 25 '20 23:06 Henroks

Any logs in the container or in the CSGO console?

0BuRner avatar Jun 26 '20 13:06 0BuRner

Only this: image

Henroks avatar Jun 26 '20 15:06 Henroks

Is this the logs after you tried to connect in the game? Did you try to connect from local network computer with public IP mentioned in the logs? And with local IP?

0BuRner avatar Jun 27 '20 08:06 0BuRner

Nothing is mentioned in the logs. Tried to connect with my local network ip, container ip, 127.0.0.1 and public ip (same as in the logs), still nothing in the logs.

Henroks avatar Jun 27 '20 16:06 Henroks

@Henroks did you ever get this working? Your config is telling the container to join an existing network named csgo. How is that network accessible?

I would try using the host network configuration if possible. See this example here: https://github.com/kaimallea/csgo/blob/master/docker-compose.yaml#L38

kaimallea avatar Aug 31 '20 19:08 kaimallea

@kaimallea I'm seeing similar issue and have tried all combinations of network configurations, port forwards etc.

Strangely I got it working one time, but didn't set my steam ID in SOURCEMOD_ADMINS, restarted it to do that and haven't been able to get back in for 2 days now.

Tried these combinations

network_mode: "host"
    network_mode: "host"
    ports:
      - "27015:27015/tcp"
      - "27015:27015/udp"
      - "27020:27020/tcp"
      - "27020:27020/udp"
    ports:
      - "27015:27015/tcp"
      - "27015:27015/udp"
      - "27020:27020/tcp"
      - "27020:27020/udp"
networks:
  csgo:

    networks:
      - csgo

    ports:
      - "27015:27015/tcp"
      - "27015:27015/udp"
      - "27020:27020/tcp"
      - "27020:27020/udp"

Pretty sure the one that I magically had working was the second with just ports defined, but many restarts, rebuilds later, no luck.

Not sure what I'm doing wrong here, especially given I see the game in Lan server browser, but it shows Not responding, and if I manually try to connect to 0.0.0.0 or 0.0.0.0:27015 or 127.0.0.1 or my public IP etc nothing works.

The one time it did work these things were absolutely true:

  • I had no steam API or account ID
  • default values for most environment vars except maybe LAN. Most still said changeme as I wasn't concerned about them locally for testing.
  • It was a 172 address that connected to, I'm guessing one assigned by docker via a bridge adapter?

I'm using Docker for Windows and use containers regularly with localhost ports auto forwarded usually.

In this case I've even forwarded incoming & outgoing ports for UDP & TCP as well though I didn't think it should matter locally.

danieliser avatar Oct 29 '20 05:10 danieliser

Also should add, the server logs never show a connection attempt and if I manually try to connect it just shows retrying...

The one time I got it the server logs came alive.

danieliser avatar Oct 29 '20 05:10 danieliser

@danieliser I'll try creating a new server this weekend and update. The last time I created it was working all fine (on Linux server)

whopavan avatar Oct 30 '20 03:10 whopavan

may help.may not: im using the host setup without assigning ports on a debian server, LAN env variable disabled but port env to 27015 and tv_port to 27020 on an exposed host router setup. works as long as steam does not release an update,then i have to restart the server.

ghost avatar Aug 20 '21 08:08 ghost