Derpitron / Discord-OTP-Forcer

Selenium based discord OTP forcer
GNU Affero General Public License v3.0
43 stars 12 forks source link

[Bug]: ElementNotInteractableException raised and program crash, when code submission button randomly becomes uninteractible. #95

Closed SMG54321 closed 7 months ago

SMG54321 commented 7 months ago

Description

Program crashes with NoSuchElementException after random uptime of running. Occurs independently of program mode. Cause: Code submission button on code entry page may randomly have an uninteractible state (appears as 3 pulsing "loading" dots) (probably due to a pending network request in the page). When the program attempts to click the button after the specified sleep timeout elapses, it tries to interact with the uninteractible button, raising ElementNotInteractableException. This then causes the rest of the program to collapse and crash.

When crashing, the program raises a bunch of other exceptions and prints random hex-code stack traces to the terminal.

Minimal Reproduction

Conditions for crash are random.

  1. Run the program normally.
  2. Either on a slow internet connection or after considerable time elapsed, wait for the code submission button to appear "loading".
  3. Program crashes if the button does not re-fix itself before the internal program timeout elapses.

Error

Redacted Images

Operating System Version

Widows 10

Python Version

3.11, 3.12

Program Version

d1a5b0359dcd793e3d17846c3fdfb63919b34f13

Any other information or context?

LuXeZs commented 7 months ago

I'm unable to recreate this issue so I will need more information. What happens with the Chrome window during all of this?

SMG54321 commented 7 months ago

I'm unable to recreate this issue so I will need more information. What happens with the Chrome window during all of this?

everything that you would expect it to do. go to the right screen and start punching in codes at randomly spaced out pulses. then suddenly, it doesnt do that and breaks. if you want i can try to figure out how to record one of my screens. maybe me clicking off the screen(s) was enough of a problem?

SMG54321 commented 7 months ago

I'm unable to recreate this issue so I will need more information. What happens with the Chrome window during all of this?

everything that you would expect it to do. go to the right screen and start punching in codes at randomly spaced out pulses. then suddenly, it doesnt do that and breaks. if you want i can try to figure out how to record one of my screens. maybe me clicking off the screen(s) was enough of a problem?

everything looks like its working fine on chrome's end i think.

SMG54321 commented 7 months ago

is this something on my end?

SMG54321 commented 7 months ago

i think its the correct code thats breaking it, can you try to extract it from the exceptions and give it to me? in like email or something?

SMG54321 commented 7 months ago

GetHandleVerifier [0x009572A3+45731] (No symbol) [0x008E2D51] (No symbol) [0x007D880D] (No symbol) [0x0080B940] (No symbol) [0x0080BE0B] (No symbol) [0x0083D1F2] (No symbol) [0x00828024] (No symbol) [0x0083B7A2] (No symbol) [0x00827DD6] (No symbol) [0x008031F6] (No symbol) [0x0080439D] GetHandleVerifier [0x00C60716+3229462] GetHandleVerifier [0x00CA84C8+3523784] GetHandleVerifier [0x00CA214C+3498316] GetHandleVerifier [0x009E1680+611968] (No symbol) [0x008ECCCC] (No symbol) [0x008E8DF8] (No symbol) [0x008E8F1D] (No symbol) [0x008DB2C7] BaseThreadInitThunk [0x75F1FCC9+25] RtlGetAppContainerNamedObjectPath [0x770F7C6E+286] RtlGetAppContainerNamedObjectPath [0x770F7C3E+238]

    GetHandleVerifier [0x009572A3+45731]
    (No symbol) [0x008E2D51]
    (No symbol) [0x007D86D0]
    (No symbol) [0x00808118]
    (No symbol) [0x0080774F]
    (No symbol) [0x00827FDC]
    (No symbol) [0x00804A4E]
    (No symbol) [0x00828254]
    (No symbol) [0x0083B7A2]
    (No symbol) [0x00827DD6]
    (No symbol) [0x008031F6]
    (No symbol) [0x0080439D]
    GetHandleVerifier [0x00C60716+3229462]
    GetHandleVerifier [0x00CA84C8+3523784]
    GetHandleVerifier [0x00CA214C+3498316]
    GetHandleVerifier [0x009E1680+611968]
    (No symbol) [0x008ECCCC]
    (No symbol) [0x008E8DF8]
    (No symbol) [0x008E8F1D]
    (No symbol) [0x008DB2C7]
    BaseThreadInitThunk [0x75F1FCC9+25]
    RtlGetAppContainerNamedObjectPath [0x770F7C6E+286]
    RtlGetAppContainerNamedObjectPath [0x770F7C3E+238]

its gotta be be one of these two! can you tell me the codes these alligned up to?

Derpitron commented 7 months ago

Man why are you creating so many issues, especially with weird ambiguous titles?

You've already made one issue before. Re-open that one, and put your other screenshots in it. Spamming this repo with issues will only make it harder for us to track each one.

SMG54321 commented 7 months ago

Man why are you creating so many issues, especially with weird ambiguous titles?

You've already made one issue before. Re-open that one, and put your other screenshots in it. Spamming this repo with issues will only make it harder for us to track each one.

i can do that?

SMG54321 commented 7 months ago

Man why are you creating so many issues, especially with weird ambiguous titles? You've already made one issue before. Re-open that one, and put your other screenshots in it. Spamming this repo with issues will only make it harder for us to track each one.

i can do that?

if you want an idea on how dumb i am, here it is!

Derpitron commented 7 months ago

@SMG54321 this might be too much of a time waste to ask.

But I think the only way we could find the cause of this bug is to literally monitor the program the entire time.

You could:

  1. Stare at your screen with the program and terminal open, and keep an eye on when and what conditions the program crashes (assuming it even does)
  2. Record your screen right when you start the program, keeping the Selenium window and the Terminal window open at the same time. Then stopping the recording if/when the program crashes. Then sending the recording to us/me.

I think this is the only way any of us can find the cause.

SMG54321 commented 7 months ago

by program/selenium window, you mean the chrome one right? i can do that! i have OBS!

Derpitron commented 7 months ago

I mean recording both the chrome window AND your command prompt at the same time. Do it if you're able to. Would be very helpful

SMG54321 commented 7 months ago

this link will let you download the vid that i recorded

SMG54321 commented 7 months ago

i did, posted it in the original bug report #92

On Sat, Nov 25, 2023 at 3:44 AM Derpitron @.***> wrote:

I mean recording both the chrome window AND your command prompt at the same time. Do it if you're able to. Would be very helpful

— Reply to this email directly, view it on GitHub https://github.com/Derpitron/Discord-OTP-Forcer/issues/95#issuecomment-1826278268, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMFYWNVXEHO5ONIJW7ILSNDYGHDXRAVCNFSM6AAAAAA7ZNO5CKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMRWGI3TQMRWHA . You are receiving this because you were mentioned.Message ID: @.***>

SMG54321 commented 7 months ago

this is the vid

On Sat, Nov 25, 2023 at 12:59 PM SMG 54321 @.***> wrote:

i did, posted it in the original bug report #92

On Sat, Nov 25, 2023 at 3:44 AM Derpitron @.***> wrote:

I mean recording both the chrome window AND your command prompt at the same time. Do it if you're able to. Would be very helpful

— Reply to this email directly, view it on GitHub https://github.com/Derpitron/Discord-OTP-Forcer/issues/95#issuecomment-1826278268, or unsubscribe https://github.com/notifications/unsubscribe-auth/ . You are receiving this because you were mentioned.Message ID: @.***>

Derpitron commented 7 months ago

Thanks for the video. Now I know what's going on!

It was not a problem with the CSS Class name.

This is the entire course of the glitch:

  1. The Discord website takes ~4 seconds to accept the code after the submit button is pressed, locking the submission button.
  2. But the program expected the submission button to be interactible after 4 seconds. I.e the program didn't wait for the page to finish loading.
  3. The program has no idea what to do, because the submit button isn't interactible.
  4. The program raises the error: selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable.
  5. Since the program has an error, the rest of it falls down and crashes painfully.

I think the solution to this problem is to somehow make the program "wait indefinitely" for the button to become interactible, without raising an exception.

LuXeZs commented 7 months ago

@SMG54321 I've implemented a check to see if the confirm button is clickable so hopefully this'll fix this issue.

SMG54321 commented 7 months ago

@SMG54321 I've implemented a check to see if the confirm button is clickable so hopefully this'll fix this issue.

ok, either me replacing the files of the last version broke the fix, or something else is going on!

i really dunno why.

Derpitron commented 7 months ago

Please manually pull the repo using git. Do not try to manually replace any files except for your own cfg.yml file.

In the future maybe I could implement some easy updater.

SMG54321 commented 7 months ago

THATS WAS THE PROBLEM!!!

Derpitron commented 7 months ago

Hey, please don't give vague descriptions like "this is weird" when you upload another screenshot/recording of the bug. Instead describe the issue in text (whatever you see/think is happening). Im not at my computer all day so am not able to check and watch the recordings all the time. Hope you can understand 🙂

Derpitron commented 7 months ago

@LuXeZs The fix you made should be applied in both normal and backup mode; You've mistakenly added it only for the backup mode.

https://github.com/Derpitron/Discord-OTP-Forcer/blob/3f2ce8e94f1c789439e61d6848c3e809e323c683/src/backend.py#L106-L116

I think I know the issue more clearly now, I may have misdiagnosed it before. It's not just the code submission button, but also the code entry field that becomes uninteractible.

image

See how the entry field (blue) is greyed out? That means it's uninteractible. I.e you can't click on it or type anything, which is what the program tries to do.

Meanwhile, the code submit button (red) merely shows the loading icon, is also uninteractible. I can't click on it when it's in the loading state.

@LuXeZs You implemented the fix only for the button, not for the field. https://github.com/Derpitron/Discord-OTP-Forcer/blob/3f2ce8e94f1c789439e61d6848c3e809e323c683/src/backend.py#L186

LuXeZs commented 7 months ago

Alright added checks to see if the submit button is active before submitting the code, as well I added a check to see if the text field is also interactable.

SMG54321 commented 7 months ago

Hey, please don't give vague descriptions like "this is weird" when you upload another screenshot/recording of the bug. Instead describe the issue in text (whatever you see/think is happening). Im not at my computer all day so am not able to check and watch the recordings all the time. Hope you can understand 🙂

FUCC, i keep doing that and wonder why i dont get any decent help. i am so sorry!

Derpitron commented 7 months ago

@SMG54321 program has been updated. Please redownload (with your cfg.yml as usual) and test away, no need to record this time.

Derpitron commented 7 months ago

image Seems to not work for me.

Derpitron commented 7 months ago

image This is the code working as intended believe it or not.

https://github.com/Derpitron/Discord-OTP-Forcer/blob/63891d78ca530dcf6f328d22cf2616671699214b/src/backend.py#L198

https://github.com/Derpitron/Discord-OTP-Forcer/blob/63891d78ca530dcf6f328d22cf2616671699214b/src/backend.py#L243

The program waits 10 seconds for the button to load. Since it didn't, it crashed. That's just how it works.

Derpitron commented 7 months ago

Should be guarded against in 2beb3ba48a6e34d6406e77f66cf2d7b8ca9b7593. This commit should hopefully fix the whole issue.

Derpitron commented 7 months ago

image Works for me! @SMG54321 try it out.

Derpitron commented 7 months ago

No crashing. Im considering this solved, and @SMG54321 I am deleting the videos you posted since they contain sensitive info.