klept0 / MS-Rewards-Farmer

A simple bot that uses Selenium to farm M$ Rewards in Python
MIT License
236 stars 48 forks source link

[BUG] Preferences file inflates to >2GB and script sticks on "cannot connect to chrome" #110

Closed Yarmash10 closed 4 months ago

Yarmash10 commented 4 months ago

Before submitting a bug report...

Title

Describe the bug

After 3-4 days of running the farmer, it stops working, getting stuck trying to "connect to chrome at 127.0.0.1:13021". Deleting the Sessions folder fixes this. But I noticed that the folder was over 2GB and this was due to an inflated Preferences file. When I delete only this file, the script runs ok again. One small issue with this is then Chrome gives me a pop up asking about "ad privacy feature", which if not manually dismissed, stops the script working properly. I think it gives an error about not finding an active window. Once I've dismissed it once, it stores this selection, presumably in the Preferences file. This works fine until the file corrupts again and I have to manually delete it and re-confirm the setting. This has been happening for many months and was also a problem with the original source farmer.

Copy and paste your error

2024-06-02 03:36:14,960 [INFO] ****@outlook.com**** 2024-06-02 03:36:20,506 [INFO] Using default request storage 2024-06-02 03:36:20,600 [INFO] Created proxy listening on 127.0.0.1:2022 2024-06-02 03:36:20,615 [INFO] Using undetected_chromedriver 2024-06-02 03:36:22,297 [INFO] patching driver executable C:\Users\FTP\appdata\roaming\undetected_chromedriver\undetected_chromedriver.exe 2024-06-02 03:37:54,876 [WARNING] Error occurred: Message: unknown error: cannot connect to chrome at 127.0.0.1:2025 from chrome not reachable Stacktrace: GetHandleVerifier [0x00BBB8E3+45827] (No symbol) [0x00B4DCC4] (No symbol) [0x00A4138D] (No symbol) [0x00A2FCEC] (No symbol) [0x00A73202] (No symbol) [0x00A6A420] (No symbol) [0x00A6A267] (No symbol) [0x00AAC9A2] (No symbol) [0x00AAC1CA] (No symbol) [0x00AA2B96] (No symbol) [0x00A76998] (No symbol) [0x00A7751D] GetHandleVerifier [0x00E74513+2899763] GetHandleVerifier [0x00EC793D+3240797] GetHandleVerifier [0x00C413B4+593364] GetHandleVerifier [0x00C482DC+621820] (No symbol) [0x00B570A4] (No symbol) [0x00B537A8] (No symbol) [0x00B53947] (No symbol) [0x00B459FE] BaseThreadInitThunk [0x75D97BA9+25] RtlInitializeExceptionChain [0x777FBE3B+107] RtlClearBits [0x777FBDBF+191] . Retrying... | @outlook.com 2024-06-02 03:38:04,973 [INFO] ****@outlook.com**** 2024-06-02 03:38:10,436 [INFO] Using default request storage 2024-06-02 03:38:10,483 [INFO] Created proxy listening on 127.0.0.1:2097 2024-06-02 03:38:10,483 [INFO] Using undetected_chromedriver 2024-06-02 03:38:12,094 [INFO] patching driver executable C:\Users\FTP\appdata\roaming\undetected_chromedriver\undetected_chromedriver.exe 2024-06-02 03:40:16,354 [WARNING] Error occurred: Message: unknown error: cannot connect to chrome at 127.0.0.1:2100 from chrome not reachable Stacktrace: GetHandleVerifier [0x00A2B8E3+45827] (No symbol) [0x009BDCC4] (No symbol) [0x008B138D] (No symbol) [0x0089FCEC] (No symbol) [0x008E3202] (No symbol) [0x008DA420] (No symbol) [0x008DA267] (No symbol) [0x0091C9A2] (No symbol) [0x0091C1CA] (No symbol) [0x00912B96] (No symbol) [0x008E6998] (No symbol) [0x008E751D] GetHandleVerifier [0x00CE4513+2899763] GetHandleVerifier [0x00D3793D+3240797] GetHandleVerifier [0x00AB13B4+593364] GetHandleVerifier [0x00AB82DC+621820] (No symbol) [0x009C70A4] (No symbol) [0x009C37A8] (No symbol) [0x009C3947] (No symbol) [0x009B59FE] BaseThreadInitThunk [0x75D97BA9+25] RtlInitializeExceptionChain [0x777FBE3B+107] RtlClearBits [0x777FBDBF+191] . Retrying... | @outlook.com 2024-06-02 03:40:26,519 [INFO] ****@outlook.com**** 2024-06-02 03:40:31,915 [INFO] Using default request storage 2024-06-02 03:40:31,962 [INFO] Created proxy listening on 127.0.0.1:2170 2024-06-02 03:40:31,962 [INFO] Using undetected_chromedriver 2024-06-02 03:40:33,650 [INFO] patching driver executable C:\Users\FTP\appdata\roaming\undetected_chromedriver\undetected_chromedriver.exe 2024-06-02 03:42:37,074 [ERROR] [CRITICAL] ⚠️ Error occurred after 3 attempts. Closing script!⚠️ | @outlook.com 2024-06-02 03:42:37,120 [INFO] [POINTS] Data saved for the next day.

Screenshots

2024-05-29 09_52_09-FTP - Remote Desktop Connection 2024-06-02 05_02_40-FTP - Remote Desktop Connection

Value of dashboard variable

var appDataModule = angular.module("rewardsDataModule", []);

    var areaConfig = {
        areaPrefix: "Rewards",
        serviceEndpointRoot: "/api/",
        templateRoot: "/Areas/Rewards/ScriptsOneUI/Components/",
        testHooksAllowed: false,
        testHookQueryParams: {},
        punchCardUrlFormat: "/dashboard/{0}",
        isMobileViewModeEnabled: true,
        showDebugInfo: false,            
        catalogItemImg: "//az15297.vo.msecnd.net/images/rewards/rc/{0}",
        pointsProgressImageUrl: "//az15297.vo.msecnd.net/images/rewards/membercenter/missions/Animated-Icons/Trophy.json",
        isVisualParityTest: false,
        useNewDBS: false,
        raDbsEnabled: true,
        redDotImageUrl: "//az15297.vo.msecnd.net/images/rewards/membercenter/missions/redDotImage.png",
        redDotOneDayInMilisecond: "86400000",
        redDotCoolDownNumberOfDays: "2",
    };
Guido30 commented 4 months ago

The current workaround is to disable the prompt using windows registry values I found a powershell script that does this for you or could manually edit the registry

klept0 commented 4 months ago

Just added in the flag to disable that in browser.py - try that out and see if it helps the issue after clearing out your sessions folder. You will have to login again but it will allow you to test it as you initially saw the issue.

Yarmash10 commented 4 months ago

@Guido30 thanks, for this. I now have the prompt disabled which means I can delete the Preferences file with a batch script every day without getting stuck at the Ad features prompt on the next run.

@klept0 I'm a bit dense. Which flag in browser.py do you suggest setting and what would this disable? Does it disable the Preferences file or something else?

klept0 commented 4 months ago

Yes I integrated the flag into the browser.py file now so if you grab updated files it is now included.