pagep Posted February 5, 2024 Report Posted February 5, 2024 (edited) Hi guys When I updated to the V5 all my code started failing due to error: Error: AlreadyLoggedInElsewhere at SteamUser._handleLogOnResponse (/workspace/node_modules/steam-user/components/09-logon.js:775:17) at SteamUser.<anonymous> (/workspace/node_modules/steam-user/components/09-logon.js:786:7) at /workspace/node_modules/steam-user/components/classes/HandlerManager.js:35:12 at Array.forEach (<anonymous>) at HandlerManager.emit (/workspace/node_modules/steam-user/components/classes/HandlerManager.js:34:12) at SteamUser._handleMessage (/workspace/node_modules/steam-user/components/03-messages.js:641:25) at SteamUser._handleNetMessage (/workspace/node_modules/steam-user/components/03-messages.js:562:8) at SteamUser._processMulti (/workspace/node_modules/steam-user/components/03-messages.js:693:9) { When I downgraded to V4, the error went away. No other code changes were necessary. The error might be correct - I am indeed logging in multiple times, however I am using this code for login: client.logOn({ accountName: STEAM_ACCOUNT_NAME, password: STEAM_PASSWORD, // logonID ensures that we can have multiple sessions running logonID: parseInt(`${Date.now()}${Math.floor(Math.random() * 100)}`) % 1000000000, }); The account doesn't have any Steam Guard enabled. Edited February 5, 2024 by pagep Quote
Dr. McKay Posted February 6, 2024 Report Posted February 6, 2024 I don't see anything wrong with your code, but I also can't reproduce the issue myself on the latest v5 version. Multiple sessions on the same account with differing logon IDs are working fine. Quote
pagep Posted February 6, 2024 Author Report Posted February 6, 2024 Hi Yeah you are right. I can't figure out the issue, it started when I did updated, went from Node 16 to Node 20 and from 4.24.6 to 5.0.8. I didn't have to touch anything else, the rest of the code is ~2y old. The steam part worked perfectly the whole time. I was getting about 60% failures with that error. I started working on a fix, but know the account is "locked" in a weird state. I get 100% failure rate `Error: AlreadyLoggedInElsewhere` . I went back to to Node 16 and 4.24.6, still the same error. My flow is: Login to Steam Generate encryptedAppTicket Logout from Steam The challenge is that I am running this in CloudFunctions, "stateless" environment with scaling. I have disabled the scaling. Now I am trying this: client = new SteamUser({autoRelogin: false, dataDirectory: null}); to avoid any conflicts but still the same issue. It seems like an issue on my side. Thank you for any insights you might have. 🙏 Quote
Dr. McKay Posted February 6, 2024 Report Posted February 6, 2024 There was a bug in 5.0.7 that made SteamUser automatically reconnect after you call logOff(). I suppose it's possible that this contributed to your issue. You might have a bunch of zombie processes running in your stateless environment. I don't know your environment, but see if there's some way to kill everything. Quote
pagep Posted February 6, 2024 Author Report Posted February 6, 2024 Awesome, thank you for the help. That was it! 🙏 It's GCP Cloud Function - and they do keep some state between the calls. I redeployed everything with old versions to wipe the states. And I no longer get the error. I believe 5.0.7 was the culprit, I traced a large amount of "log on" event logs when the functions were finishing executions and doing log off. Btw thank you for your great library. 💰💸 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.