protonscr

SteamCMD taking upwards of 1 minute to reach prompt

steamclosed SteamCMD
ValveSoftware/steam-for-linux#9282 · opened 2023-03-20 by andygello555 · updated 2023-04-20 · 2 comments · github
Aandygello555 2023-03-20 github

Your system information

  • Steam client version (build number or date): Steam Console Client (c) Valve Corporation - version 1679113398
  • Distribution (e.g. Ubuntu): Debian 11
  • Opted into Steam client beta?: No
  • Have you checked for system updates?: Yes

Please describe your issue in as much detail as possible:

I'm calling steamcmd as a subprocess within a Go program. This program uses app_info_print to scrape the metadata of certain apps from Steam. In Go I use:

  • The exec package to create a subprocess for steamcmd
  • The https://github.com/Netflix/go-expect package to listen for the Steam> prompt and input commands over tty
  • I wait for EOF after sending the quit command but I have to kill the subprocess in order to avoid zombie processes
  • Multiple steamcmd subprocesses are allowed to run at the same time

When calling steamcmd from the command line, or as a subprocess from within a Go program, it sometimes takes 1 to 3 minutes to reach the Steam> prompt. After reaching the prompt and quitting/killing steamcmd the issue won't occur for a while of scraping (~10-20 mins).

Is this due to not terminating the steamcmd subprocess cleanly? Or is it maybe a rate limiting/throttling issue? I've been running this scrape procedure for a while and only started seeing this issue occur over the weekend.

Here is a timed example when calling steamcmd from the command line:

$ time steamcmd +quit
debugger = :  /home/<USER>/.local/share/Steam/steamcmd/linux32/steamcmd +quit
WARNING: setlocale('en_US.UTF-8') failed, using locale: 'C'. International characters may not work.
Redirecting stderr to '/home/<USER>/Steam/logs/stderr.txt'
Looks like steam didn't shutdown cleanly, scheduling immediate update check
[  0%] Checking for available updates...
[----] Verifying installation...
Steam Console Client (c) Valve Corporation - version 1679113398
-- type 'quit' to exit --
Loading Steam API...OK

Connecting anonymously to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK

real	2m26.852s
user	0m27.195s
sys	0m24.536s

As you can see this particular time it took around two and a half minutes to connect to reach the prompt, and then quit.

When checking Steam/logs/connection_log.txt I see a lot of TIMEOUT errors occurring for the IPv6 HTTP/UDP connectivity tests:

[2023-03-20 16:21:28] IPv6 HTTP connectivity test (ipv6check-http.steamserver.net / [2a01:bc80:5:111::7]:80 ([2a01:bc80:5:111::7]:80)) - TIMEOUT
...
[2023-03-20 16:21:28] IPv6 HTTP connectivity test (ipv6check-http.steamserver.net / [2a01:bc80:1:103::a2fe:c60e]:80 ([2a01:bc80:1:103::a2fe:c60e]:80)) - TIMEOUT
...
[2023-03-20 16:21:30] IPv6 UDP connectivity test (ipv6check-udp.steamserver.net / 2a01:bc80:5:111::5) - TIMEOUT
...
[2023-03-20 16:21:30] IPv6 HTTP connectivity test (ipv6check-http.steamserver.net / [2a01:bc80:5:111::5]:80 ([2a01:bc80:5:111::5]:80)) - TIMEOUT
[2023-03-20 16:21:30] Connectivity test: OK!
[2023-03-20 16:21:30] Connectivity test: result=Connected (since 0.0s ago), prev=Unknown, in progress=0
[2023-03-20 16:21:30] IPv6 UDP connectivity test (ipv6check-udp.steamserver.net / 2a01:bc80:a:100::b919:b604) - TIMEOUT
...

Steps for reproducing this issue:

  1. Call steamcmd from the command line, it doesn't matter if I provide a login command +login anonymous or +login <username> <password>
  2. It takes 1 to 3 minutes to reach the Steam> prompt
  3. Once the prompt has been reached once this issue won't occur for a while (maybe 10-20 minutes)
Aandygello555 2023-03-27 github

After fixing a bug in my code which meant that every steamcmd process was sigkill-ed instead of gracefully exited using the quit command, and turning off the scrape procedure for 2 days, it seems like things have returned back to normal.

Not sure whether this issue should be closed or still requires further investigation, as I'm not sure which fix actually helped.

Aandygello555 2023-04-20 github

The bug was being caused by appcache inflating to a very large size. After implementing a cron to purge appcache things started to work smoothly again

Nothing extracted yet.