BeepIsla / csgo-commend-bot

Commend/Report bot in NodeJS
GNU Affero General Public License v3.0
289 stars 144 forks source link

Getting error `Cannot read property 'accountid' of null` #578

Closed namanchikara closed 4 years ago

namanchikara commented 4 years ago

Detailed bug description I'm able to login to my account, but after that, I get the below-given error.

I've tried both SERVER and LOGIN method. Getting the same error. Account and fetcher are given the same details.

Privacy is set to the public. (You can check via target acc given in config if you want.)

Error

 Selected available server 90137752873812992
 Logging into fetcher account for commend count...
TypeError: Cannot read property 'accountid' of null
    at Target.get accountid [as accountid] (/home/ubuntu/csgo-commend-bot/helpers/Target.js:10:37)
    at /home/ubuntu/csgo-commend-bot/index.js:385:96
    at processTicksAndRejections (internal/process/task_queues.js:85:5) Promise {
  <rejected> TypeError: Cannot read property 'accountid' of null
      at Target.get accountid [as accountid] (/home/ubuntu/csgo-commend-bot/helpers/Target.js:10:37)
      at /home/ubuntu/csgo-commend-bot/index.js:385:96
      at processTicksAndRejections (internal/process/task_queues.js:85:5)
}

Config

{
    "commend": {
        "friendly": 300,
        "teaching": 300,
        "leader": 300
    },
    "report": {
        "aimbot": 10,
        "wallhack": 10,
        "speedhack": 10,
        "teamharm": 10,
        "abusive": 10
    },
    "account": {
        "username": "**SENSORED**",
        "password": "**SENSORED**",
        "sharedSecret": ""
    },
    "fetcher": {
        "username": "**SENSORED**",
        "password": "**SENSORED**",
        "sharedSecret": "",
        "maxTries": 10,
        "tryDelay": 2500,
        "askSteamGuard": true
    },
    "proxy": {
        "enabled": false,
        "file": "proxies.txt",
        "switchProxyEveryXaccounts": 20
    },
    "method": "LOGIN",
    "target": "https://steamcommunity.com/id/noightmare",
    "perChunk": 1,
    "steamWebAPIKey": "**SENSORED**",
    "type": "COMMEND",
    "serverID": "auto",
    "matchID": "0",
    "betweenChunks": 300000,
    "cooldown": 28800000,
    "showCommends": true,
    "autoReportOnMatchEnd": false,
    "switchServerAfterChunks": 5,
    "protocol": "Auto",
    "disableUpdateCheck": false
}

Version

namanchikara commented 4 years ago

I checked into commit f3c9cd3 and now I'm able to get past this. Although I'm now able to log into bot accounts, I'm getting timeout error in all commends.

Note that I'm using the same above-mentioned config. Also, I'm using AWS EC2 to do all this, hence bandwidth is not an issue.

[ACCOUNT_NAME] Failed to commend (20/20) {
  name: 'Error',
  message: 'Failed to send message: Timeout',
  stack: 'Error: Failed to send message: Timeout\n' +
    '    at Timeout._onTimeout (/home/ubuntu/commend-bot/helpers/GameCoordinator.js:161:12)\n' +
    '    at listOnTimeout (internal/timers.js:531:17)\n' +
    '    at processTimers (internal/timers.js:475:7)'
}
BeepIsla commented 4 years ago

TypeError: Cannot read property 'accountid' of null

This happens when the account successfully logs into Steam but then suddenly loses connection to Steam afterwards.

namanchikara commented 4 years ago

TypeError: Cannot read property 'accountid' of null

This happens when the account successfully logs into Steam but then suddenly loses connection to Steam afterwards.

@BeepIsla But then how am I able to get past it by checking out into f3c9cd3 this commit from Nov 23?

Also, How can I fix timeout issue?

BeepIsla commented 4 years ago

I don't know, but I know that 2.2.6 (f3c9cd3) causes timeout issues because Valve tried patching it which was then fixed in 2.8.0

namanchikara commented 4 years ago

So, I've tried like 10 times on latest commit but everytime I get TypeError: Cannot read property 'accountid' of null, Can please suggest a way or where/what I can look into to get going?

BeepIsla commented 4 years ago

Are fetcher and account/target the same account?

namanchikara commented 4 years ago

@BeepIsla Yes, both are same.

BeepIsla commented 4 years ago

That's your problem, one time it logs into the account as target, the other it logs into the account as fetcher, invalidating the previous session the bot had as target. You cannot have both the same, generate an account and put it as fetcher, all you need.

namanchikara commented 4 years ago

YES! That was it, this fixed it. Thanks a ton, man!