LinuxGSM icon indicating copy to clipboard operation
LinuxGSM copied to clipboard

[Bug]: vhserver update error "[ FAIL ] Updating vhserver: Checking remote build: SteamCMD"

Open historical-theology opened this issue 1 year ago • 32 comments

User story

Fresh Valheim server installation with LinuxGSM in Debian 12. Running ./vhserver update yields this error message.

Game

Valheim

Linux distro

Debian 12

Command

command: update

Further information

This issue was just mentioned in a separate issue thread by @jaumebecks:

https://github.com/GameServerManagers/LinuxGSM/issues/4588#issuecomment-2514955795

It is not isolated to my own setup.

Relevant log output

[ FAIL ] Updating vhserver: Checking remote build: SteamCMD

Steps to reproduce

No response

historical-theology avatar Dec 09 '24 20:12 historical-theology

The same here. On Satisfactory Server. It is not necessarily the update function, as the check for update function is also affected and is certainly part of the update function. The Steam version cannot be accessed, it seems.

Aquato avatar Dec 10 '24 15:12 Aquato

Same for most of the servers I run (PW, PZ, VH, SDTD).

Simply run SteamCMD manually & seems to work as expected

steam_upd.sh

#!/usr/bin/env bash
/app/*server stop
steamcmd +runscript /data/steamcmd.txt
/app/*server start

steamcmd.txt

force_install_dir /data/serverfiles
login anonymous 

// https://steamdb.info/app/{Steam_Dedi_Id}
//app_update {Steam_Dedi_Id} validate //-beta latest_experimental //{depot_id}

quit

irobot73 avatar Dec 10 '24 20:12 irobot73

If you address the server with the parameter fu "force update" it also works manually. But it's all inconvenient and takes time.

Aquato avatar Dec 11 '24 09:12 Aquato

Same here for insurgency server

majorpdd avatar Dec 12 '24 21:12 majorpdd

It seems to me that steamcmd no longer provides the necessary information.

vhserver@gameserver:~$ steamcmd +login user password +app_info_update 1 +app_info_print 896660 +quit
Redirecting stderr to '/home/vhserver/.local/share/Steam/logs/stderr.txt'
Logging directory: '/home/vhserver/.local/share/Steam/logs'
[  0%] Checking for available updates...
[----] Verifying installation...
UpdateUI: skip show logoSteam Console Client (c) Valve Corporation - version 1733269577
-- type 'quit' to exit --
Loading Steam API...OK
Logging in using username/password.
Logging in user '15_tatsache' [U:1:123456789] to Steam Public...OK
Waiting for client config...OK
Waiting for user info...OK
No app info for AppID 896660 found, requesting...
vhserver@gameserver:~$

From lgsm/modules/core_steamcmd.sh // fn_update_steamcmd_remotebuild():

remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

From log/steam/appinfo_log.txt:

[2024-12-13 21:14:03] Client version: 1733269577
[2024-12-13 21:14:03] ThreadedReadFromDisk: loading appinfo cache from: /home/vhserver/.local/share/Steam/appcache/appinfo.vdf
[2024-12-13 21:14:03] ThreadedReadFromDisk: header version: 0x7564429
[2024-12-13 21:14:03] ThreadedReadFromDisk: apps updated: 181
[2024-12-13 21:14:03] CAppInfoCacheReadFromDiskThread took 5 milliseconds to initialize
[2024-12-13 21:14:05] RequestAppInfoUpdate: AppIDs 7
[2024-12-13 21:14:06] Change number 26635879->26635881, apps: 0/2, packages: 0/0
[2024-12-13 21:14:06] Requesting 2 apps, 0 packages (meta data, 1024 prev attempts, expected 0 KB)
[2024-12-13 21:14:06] GetValidPlatforms: skipping platform entry  macos for app 18010
[2024-12-13 21:14:06] Requested 1 app access tokens, 0 received, 1 denied
[2024-12-13 21:14:06] UpdatesJob: finished OK, apps updated 0 (0 KB), packages updated 0 (0 KB)

freaky-m0 avatar Dec 13 '24 20:12 freaky-m0

It seems to me that steamcmd no longer provides the necessary information.

We can confidently say that the old way does not work. I do not think you can blanketly judge "that steamcmd no longer provides the necessary information". Perhaps it changed, or perhaps the devloper need to come with an alternate way of doing this to fix the issue. For example we can see that this latest build id number is still publicly available here: https://steamdb.info/app/1690800/depots/?branch=public (I'm giving the satisfactory example, because this is the game server I have problems with) so it would be reasonable to assume there are working ways to retreive it.

AndrewSav avatar Dec 14 '24 18:12 AndrewSav

Related: https://github.com/ValveSoftware/steam-for-linux/issues/11521 FWIW, the app info steamcmd command does work with an authenticated account (if you jump through the steam guard / 2FA hoops) ~~and it does work with a game server token (you need to have the game registered to the account in question). The latter may be a practical way to fix this, but that requires lgsm code changes as it cannot authenticate via those tokens at the moment.~~ Turned out I got that last bit wrong and probably was using cached credentials instead when it worked.

AndrewSav avatar Dec 14 '24 19:12 AndrewSav

We were hoping that once they completed the updates to the various appid's it would settle down. Its appears that is not the case

dgibbs64 avatar Dec 14 '24 19:12 dgibbs64

...I do not think you can blanketly judge "that steamcmd no longer provides the necessary information". Perhaps it changed, or perhaps the devloper need to come with an alternate way of doing this to fix the issue...

I just wanted to say that this is the reason why it fails: An output from Steamcmd is missing. It is of course clear that there can be many reasons for this or different solutions. It should just help to understand/find the cause

Thanks for linking the related issue :)

freaky-m0 avatar Dec 14 '24 22:12 freaky-m0

I would rather not have to go down the route of LinuxGSM having to use logins to get the info moving forward. It is still not clear what the solution is moving forward. If anyone has any success getting appid info without requiring login please let us know

dgibbs64 avatar Dec 15 '24 00:12 dgibbs64

I poked around on this. My problem is with sfserver. It is the same problem, no app info returned from steamcmd.

While experimenting, I left off the +quit and entered app_info_print 1690800 interactively and got a response payload.

Then I went into core_steamcmd.sh and removed the passage which deletes appinfo.vdk at line 170.

sfserver update now runs successfully.

If I stack multiple app_info_print's on the command line I sometimes get an empty payload, like this:

AppID : 1690800, change number : 0/0, last change : Wed Dec 31 19:00:00 1969
"1690800"
{
}

I am still unable to reliably cause steamcmd to return a payload via a script without the step of doing this interactively.

svanegmond avatar Dec 15 '24 06:12 svanegmond

You probably could run steamcmd in backgroud, sleep a little and then kill it once the info is retreived. Terrible, I know. As a PoC:

docker run -it --rm --init --name steamcmd --entrypoint /bin/bash gameservermanagers/steamcmd:latest -c \
  "apt update && DEBIAN_FRONTEND='noninteractive' apt install screen -y && \
  rm -f /root/.local/share/Steam/appcache/appinfo.vdf && \
  screen -d -m -S steam steamcmd +login anonymous +app_info_print 1690800 && \
  while [ ! -f /root/.local/share/Steam/appcache/appinfo.vdf ]; do sleep 1; done && \
  sleep 5 && \
  screen -S steam -p 0 -X stuff "quit^M" && \
  steamcmd +login anonymous +app_info_print 1690800 +quit"

AndrewSav avatar Dec 15 '24 09:12 AndrewSav

Editing https://github.com/GameServerManagers/LinuxGSM/blob/master/lgsm/modules/core_steamcmd.sh#L186 with the solution presented in https://github.com/ValveSoftware/steam-for-linux/issues/9683#issuecomment-2515828207 (extra +app_info_request APPID + +login anonymous) worked for me for working around steamcmd's issue.

My full replaced line:

	remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

FlaminSarge avatar Dec 18 '24 01:12 FlaminSarge

Looks like it comes down to timing. If you cause the command to delay long enough to get the info before it quits you get the results. So padding it in any way to make it run longer seems to work.

AndrewSav avatar Dec 18 '24 03:12 AndrewSav

Looks like it comes down to timing. If you cause the command to delay long enough to get the info before it quits you get the results. So padding it in any way to make it run longer seems to work.

Right, but prior to some update, it would wait/block for app_info_print to finish before moving on to the next command, but not anymore, necessitating the extra commands to stall. If this isn't something that can be reverted, may be useful to add app_info_print_blocking or something to replicate old behavior. As it stands, though, app_info_print arbitrarily not printing anything despite the "requesting..." message seems like a bug, not a feature.

FlaminSarge avatar Dec 18 '24 03:12 FlaminSarge

That probably best to go somewhere where it can be actioned, e.g. https://github.com/ValveSoftware/steam-for-linux/issues/11521 linked above.

AndrewSav avatar Dec 18 '24 05:12 AndrewSav

Yeah, I suggest leaving comments on the steam-for-linux issues page. Upvote related issues as well. As currently this is something that Valve have broken and there is no decent workaround currently. Hopefully they sort it out soon. Until there is a reliable workaround we can use or a fix there isnt anything I can do currently.

dgibbs64 avatar Dec 18 '24 22:12 dgibbs64

Editing https://github.com/GameServerManagers/LinuxGSM/blob/master/lgsm/modules/core_steamcmd.sh#L186 with the solution presented in ValveSoftware/steam-for-linux#9683 (comment) (extra +app_info_request APPID + +login anonymous) worked for me for working around steamcmd's issue.

My full replaced line:

	remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

Just wanted to chime in here and say, this change worked for me with Satisfactory as well as Valheim.

Edit: It worked for ./server cu - but there's no updates at the moment so cant test update.

sahammer avatar Dec 18 '24 23:12 sahammer

This also worked for me to fix the command "l4d2server check-update" and the command "l4d2server update":

from: remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/"${branch}"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

to: remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/"${branch}"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

Thank you freaky-m0 and sahammer.

Mystik-Spiral avatar Dec 19 '24 01:12 Mystik-Spiral

This also worked for me to fix the command "l4d2server check-update" and the command "l4d2server update":

from: remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/"${branch}"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

to: remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/"${branch}"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

Thank you freaky-m0 and sahammer.

Some chars are missing here. Must be ... to: remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

the \ will be deleted if you do not mark the text as code. But then the code works again for me :) and the remote build can be accessed. Thx to all!

Aquato avatar Dec 19 '24 14:12 Aquato

Looks like we might have a workaround. I will do some testing with this suggestion to see how well it works. If successful I will get a hot fix out 😊

dgibbs64 avatar Dec 19 '24 15:12 dgibbs64

@Aquato Yes, you are correct. I posted without marking as code and it stripped the back slashes. Sorry about that and thank you for correcting! What you have is correct, but I am posting again as confirmation:

In: core_steamcmd.sh

from: remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

to: remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

Mystik-Spiral avatar Dec 19 '24 15:12 Mystik-Spiral

Any reason why we need +login twice?

edit: becuase it dont work without login twice 🙄

dgibbs64 avatar Dec 19 '24 21:12 dgibbs64

My opinion, is that anything that is running long enough to let the async call to get the information will work. So if you do not pad it with enough commands, such as login, it still sometimes not going to get the data. Of course it all depends on timing and therefore results may wary, but the longer it takes the more probability the data will be there.

AndrewSav avatar Dec 19 '24 21:12 AndrewSav

FWIW the above "fix" works most of the time but not all of the time during my testing. About 1 time out of ten on my box it still returms nothing.

AndrewSav avatar Dec 19 '24 22:12 AndrewSav

@AndrewSav Here is a very small change (added +logoff before +quit) and I am curious if it helps you go from 90% to 100% working:

remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_request "${appid}" +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +logoff +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]')

Mystik-Spiral avatar Dec 20 '24 02:12 Mystik-Spiral

@Mystik-Spiral I think I'll leave it where it is. I wrote an automation script to demonstrate the failures, but with the script it is not failing any more, only ocasionally fails when running manually from the command line. Probably comes down to some wierd timing and good enough.

AndrewSav avatar Dec 20 '24 04:12 AndrewSav

Yeah, sounds like the hotfix have reduced the problem but probably to got rid of it totally...which is a step in the right direction.

dgibbs64 avatar Dec 20 '24 14:12 dgibbs64

Any reason why we need +login twice?

The only purpose of the second login/etc is to stall for long enough that the app_info_request finishes and populates the temp vdf files, so that the followup app_info_print just reads from the vdf instead of fetching from remote again. The core issue is that they changed app_info_print to not block+wait for response, and instead made it print its info as a side-effect during execution if the info was available, or no-op while fetching the info if it was not available. This seems like a bug on steamcmd's end and we'll have to keep track of https://github.com/ValveSoftware/steam-for-linux/issues/9683 for when they eventually fix it. The other option is to loop, say, 10 times trying to fetch the info (without deleting local temp vdf) to see if app_info_print will eventually get it on its own, which may be a bit more deterministic than hoping that 2 logins is enough stall time for the request to finish.

FlaminSarge avatar Dec 21 '24 10:12 FlaminSarge

Just from today, after updating lgsm:

sfserver@satisfactory:~$ ./sfserver u
[ FAIL ] Updating sfserver: Checking remote build: SteamCMDsfserver@satisfactory:~$ ./sfserver u
[  OK  ] Updating sfserver: Checking for update: SteamCMD

No update available
* Local build: 16775547
* Remote build: 16775547
* Branch: public
https://steamdb.info/app/1690800/

sfserver@satisfactory:~$ 

As you can see failed the first time succeeded on the seccond attempt

AndrewSav avatar Dec 28 '24 21:12 AndrewSav