Closed jd1378 closed 4 years ago
Show your code, please.
// community is `'steamcommunity'` instance and is logged in.
function confirmOffer(offerId) {
return new Promise((resolve, reject) => {
console.log(`Confirming Offer #${offerId}`);
community.acceptConfirmationForObject(
identitySecret,
offerId,
(confirmErr) => {
if (confirmErr) {
console.log(confirmErr);
return reject(confirmErr);
}
return resolve(true);
}
);
});
}
After Confirming Offer #${offerId}
being logged, the promise never resolves, so the only way it could happen is that the callback is never fired.
As I said it was working fine until recently and I haven't had make any changes to the code.
Also now i noticed that my bot is getting this error when getting active offers recently
{"code":"ESOCKETTIMEDOUT","connect":false}
// somewhere manager = new TradeOfferManager(...)
function getActiveOffersCountPromise() {
return new Promise((resolve, reject) => {
manager.getOffers(
EOfferFilter.ActiveOnly,
null,
(err, sentOffersByMe, receivedOffersByMe) => {
if (err) {
console.log(
`Error while counting active offers: ${JSON.stringify(err)}`
);
return reject(err);
}
return resolve(sentOffersByMe.length + receivedOffersByMe.length);
}
);
});
}
Tell me if more info is needed
Have you passed a timeout
option to the SteamCommunity constructor?
No, It's using the defaults but it takes forever instead of 50 seconds
I'm logging in to SteamCommunity using disableMobile: true
, does it have anything to do with this ?
Edit: Apparently not.
can it happen if steam has blacklisted our ip from using their apis ?
even node-steam-user is not logging in , and it does not raise any error ! I suspect there is a bug where under some special condition like this nothing happens with your packages, no event, no login, no error ....
@DoctorMcKay And I'm sure of it works on local dev env, but not on our specific server (which was working till some time ago)
Sounds like a problem with your server's network or something else. Such a big in both modules would be highly improbable, as they connect to Steam in completely different ways.
either way , why wouldn't the library dispatch error event on the case of network error ?
That's a good question, one I can't answer. I suspect something is weird in your OS and it isn't enforcing timeouts properly.
I did a bit of debugging and used 'debug' event to check if it is actually logging in or not
and it seems it does login successfully, but the webSession
event is never emitted, even if I use webLogOn()
manually on the node user (I am logging in using account name and password so there isn't any need for this, but I wanted to confirm)
Sounds like your server has some real problems with HTTP requests, at least to Steam. Web logons go through the Steam WebAPI (api.steampowered.com).
Thanks a lot for pointing out the domain name (api.steampowered.com) and possible problem with http, I just did a quick check on my server and the problem is indeed with the server's dns settings, It seems that somehow the dns servers it had was pointing to wrong ips. it was a really weird problem, but thanks for taking your time to answer, I couldn't figure it out without your help
Glad you got it sorted.
offers were getting confirmed quickly without any problem till recently ( like 3 days ago) then suddenly
community.acceptConfirmationForObject()
no longer calls the callback anymore on random trades occasionally and causes my bot to freeze completely