ArchiSteamFarm icon indicating copy to clipboard operation
ArchiSteamFarm copied to clipboard

ASF reconnect loop

Open JustArchi opened this issue 10 years ago • 26 comments

Usual log looks like this:

12/22/2015 10:47:39 AM [*] INFO: Start() <spoilbot2> Starting...
12/22/2015 10:47:44 AM [*] INFO: OnDisconnected() <spoilbot2> Disconnected from Steam, reconnecting...
12/22/2015 10:47:44 AM [*] INFO: OnConnected() <spoilbot2> Connected to Steam!
12/22/2015 10:47:44 AM [*] INFO: OnLoggedOn() <spoilbot2> Successfully logged on!
12/22/2015 10:47:46 AM [*] INFO: Init() <spoilbot2> Logging in to ISteamUserAuth...
12/22/2015 10:47:46 AM [*] INFO: Init() <spoilbot2> Success!
12/22/2015 10:47:47 AM [*] INFO: StartFarming() <spoilbot2> Checking possibility to farm...
12/22/2015 10:47:49 AM [*] INFO: OnDisconnected() <spoilbot2> Disconnected from Steam, reconnecting...
12/22/2015 10:47:49 AM [*] INFO: StopFarming() <spoilbot2> Sending signal to stop farming
12/22/2015 10:47:49 AM [*] INFO: StopFarming() <spoilbot2> Waiting for reaction...
12/22/2015 10:47:49 AM [*] INFO: OnConnected() <spoilbot2> Connected to Steam!
12/22/2015 10:47:49 AM [*] INFO: OnLoggedOn() <spoilbot2> Successfully logged on!
12/22/2015 10:47:50 AM [*] INFO: Init() <spoilbot2> Logging in to ISteamUserAuth...
12/22/2015 10:47:50 AM [*] INFO: StopFarming() <spoilbot2> Farming stopped!
12/22/2015 10:47:50 AM [*] INFO: Init() <spoilbot2> Success!
12/22/2015 10:47:50 AM [*] INFO: StartFarming() <spoilbot2> Checking possibility to farm...
12/22/2015 10:47:55 AM [*] INFO: OnDisconnected() <spoilbot2> Disconnected from Steam, reconnecting...

This issue happened to @Ryzhehvost as well as other people (KnSYS).

I can't reproduce it and I can't think of any explanation why it would happen to one account on very rare basis. It doesn't make sense to me for now.

I suspect it might be because of the PlayGames() request sent during the check, even if that doesn't make any sense, perhaps for some reason it makes Steam send Disconnect, so ASF tries to reconnect and so on.

I suggest everybody who notices that issue to update to latest pre-release and try hard to reproduce the bug, only if nobody succeeds after 2-3 days I will assume that this is the reason, because there is literally no way for me to check - random bugs with absolutely no logic are the worst ones.

JustArchi avatar Dec 22 '15 11:12 JustArchi

Also fixed a misc derp with pre1, pre2 should be fine for testing.

JustArchi avatar Dec 22 '15 11:12 JustArchi

Testing for a few days without my extra commands? Darn. Ok, I'll do this for Aiur.

Rudokhvist avatar Dec 22 '15 11:12 Rudokhvist

You can always compile yourself and add your extra bits. I do not release closed-source pre-releases. The objective is to find root cause.

JustArchi avatar Dec 22 '15 11:12 JustArchi

Of course I can. But then we'll never know if it's caused by my modifications.

Rudokhvist avatar Dec 22 '15 11:12 Rudokhvist

If KnSYS reproduced the issue on "vanilla" ASF, most likely your modifications don't have any negative impact.

I mean, 99% of "hard to explain" bugs are directly caused by volvo fuckups, the thing is to add workaround for them. This is how whole SteamKit2 works, and all projects based on that too.

JustArchi avatar Dec 22 '15 11:12 JustArchi

Also I still have your pull request in mind, I didn't forget about that. Maybe I'll add those bits even to 1.2, but ASF reconnect loop issue is definitely with highest priority, it literally fucks up things.

JustArchi avatar Dec 22 '15 11:12 JustArchi

I'm quite agree that this has highest priority, that's why I said I'll do it.

Rudokhvist avatar Dec 22 '15 11:12 Rudokhvist

It would be much easier if I could reproduce that issue myself, or at least find any logical explanation why it happens instead of assuming things out of the blue.

However, in this case most likely I'd fix that issue around V0.2 release, and not 1.2.

Therefore, the only thing I can do is provide everybody with 1.2 pre2 and suggest to try hard to reproduce the bug, because I'm literally blindly trying to fix thing I don't even know about.

JustArchi avatar Dec 22 '15 12:12 JustArchi

Maybe you should have added some extra logging to this release then?

Rudokhvist avatar Dec 22 '15 12:12 Rudokhvist

Got the same problem with several alts(always the same alts). Will test this too.

v3rg avatar Dec 22 '15 12:12 v3rg

Extra logging won't help. I need confirmation if my assumption is correct, nothing else.

JustArchi avatar Dec 22 '15 14:12 JustArchi

Please test pre3 instead - https://github.com/JustArchi/ArchiSteamFarm/releases/tag/1.2.0.0-pre3

I rewrote how cards farming module works now, which should potentially solve this and other issues.

Basically the most important fact is that if ASF issues SteamClient.Disconnect(), it doesn't try to reconnect in the callback, but if Steam issued Disconnect, it will try.

JustArchi avatar Dec 22 '15 15:12 JustArchi

Ok. May I ask, why !farm was removed?

Rudokhvist avatar Dec 22 '15 15:12 Rudokhvist

It was removed for two reasons

  • It directly affected cards farming module, and I don't want to do that anymore to make it more reliable
  • It is not necessary anymore, as ASF now automatically resumes farming if it's finished with no drops

JustArchi avatar Dec 22 '15 15:12 JustArchi

In other words, I see no use of that command anymore, ASF handles itself all possible problems, including resume of farming after some time if you e.g. activate gift, as well as handling steam network disconnects and other stuff. Having obsolete commands which serve no purpose is pointless.

JustArchi avatar Dec 22 '15 16:12 JustArchi

That would mean a delay upto 15 minutes after gift activation can occur. I'm okay with that, because I rarely buy gifts for bots, but someone who does can be annoyed by this delay.

Rudokhvist avatar Dec 22 '15 16:12 Rudokhvist

Someone who does can issue !stop and !start if he is in so much hurry that he can't wait 15 minutes.

Be realistic. If it was 1-day check I'd understand, but not 15 minutes.

JustArchi avatar Dec 22 '15 16:12 JustArchi

Also when https://github.com/JustArchi/ArchiSteamFarm/issues/18 is done, handling gifts will restart farming module as well.

JustArchi avatar Dec 22 '15 16:12 JustArchi

!stop+!start is even better. We need one command for this.

Rudokhvist avatar Dec 22 '15 16:12 Rudokhvist

Leaving it open for a few more days, if anybody reproduces with 1.2.1 let me know.

JustArchi avatar Dec 23 '15 09:12 JustArchi