Jump to content
McKay Development

Error AlreadyLoggedInElsewhere after update to V5 from V4


pagep

Recommended Posts

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 by pagep
Link to comment
Share on other sites

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:

  1. Login to Steam
  2. Generate encryptedAppTicket
  3. 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. 
🙏


image.thumb.png.ca707a7841bbdb5e96387dfe5f7288f2.png

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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. 💰💸

 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...