Skip to content
This repository has been archived by the owner on Jan 12, 2021. It is now read-only.

Bot No Longer Detects that the Game is Running. #138

Closed
MWEckert opened this issue Dec 3, 2019 · 25 comments
Closed

Bot No Longer Detects that the Game is Running. #138

MWEckert opened this issue Dec 3, 2019 · 25 comments
Labels
wontfix Sorry, but the dev team won't fix this one

Comments

@MWEckert
Copy link

MWEckert commented Dec 3, 2019

When I try to load the bot, I get the initial text,

21:01:44,898 INFO - BHBot v43 build on Mon Dec 02 20:59:31 MST 2019 started.
21:01:44,902 INFO - GIT commit id: b6d9a70 time: 2019-11-23T22:45:30+0100
21:01:45,484 INFO - Settings loaded from file
21:01:45,485 INFO - Character:
21:01:46,602 INFO - Bot started successfully!
Starting ChromeDriver 2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90) on port 19019
Only local connections are allowed.

And then nothing. I've tried everything but a complete reinstall of chromedriver/chromium. IT was happening sporadically in a previous version, but I would just type 'reset' and it would normally pick it back up. Now I get nothing.

@MWEckert
Copy link
Author

MWEckert commented Dec 3, 2019

Eventually, it times out and displays,

[1575346009.000][SEVERE]: Timed out receiving message from renderer: 299.226
[1575346009.001][SEVERE]: Timed out receiving message from renderer: -0.002
21:06:49,013 ERROR - Something went wrong with driver restart. Will retry in a few minutes... (sleeping)
org.openqa.selenium.TimeoutException: timeout
(Session info: chrome=69.0.3497.0)
(Driver info: chromedriver=2.44.609538 (b655c5a60b0b544917107a59d4153d4bf78e1b90),platform=Windows NT 10.0.17763 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 0 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: [deleted]
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.44.609538 (b655c5a60b0b54..., userDataDir: ./chrome_profile}, cssSelectorsEnabled: true, databaseEnabled: false, goog:chromeOptions: {debuggerAddress: localhost:51317}, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: XP, platformName: XP, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: ignore, unhandledPromptBehavior: ignore, version: 69.0.3497.0, webStorageEnabled: true}
Session ID: 5c7b2556850f651154e48911bf46bf7d
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[?:1.8.0_201]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_201]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) ~[?:1.8.0_201]
at java.lang.reflect.Constructor.newInstance(Unknown Source) ~[?:1.8.0_201]
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) ~[BHBot.jar:?]
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) ~[BHBot.jar:?]
at org.openqa.selenium.remote.http.JsonHttpResponseCodec.reconstructValue(JsonHttpResponseCodec.java:40) ~[BHBot.jar:?]
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80) ~[BHBot.jar:?]
at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44) ~[BHBot.jar:?]
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158) ~[BHBot.jar:?]
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83) ~[BHBot.jar:?]
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552) ~[BHBot.jar:?]
at org.openqa.selenium.remote.RemoteWebDriver.get(RemoteWebDriver.java:277) ~[BHBot.jar:?]
at org.openqa.selenium.remote.RemoteWebDriver$RemoteNavigation.to(RemoteWebDriver.java:857) ~[BHBot.jar:?]
at MainThread.restart(MainThread.java:830) [BHBot.jar:?]
at MainThread.run(MainThread.java:922) [BHBot.jar:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]

@MWEckert
Copy link
Author

MWEckert commented Dec 3, 2019

Oh, and sometimes it will find the game element, but doesn't actually do anything. Attempts to 'do raid' forces the raid with zero change. Then it just times out again.

@ilpersi
Copy link
Owner

ilpersi commented Dec 3, 2019

When this is happening, how many Chromium instances is the bot running? Can you check that it is only one?

@Fortigate
Copy link
Collaborator

By any chance does the window title have a 'Select' prefix?

image

@MWEckert
Copy link
Author

MWEckert commented Dec 3, 2019

ilpersi: Only one instance of Chromium is running on the desktop.
Fortigate: It does not.

@MWEckert
Copy link
Author

MWEckert commented Dec 3, 2019

I had a similar issue earlier and had the idea to delete the 'chrome_profile' folder. Reran init.bat, and now it seems to be working without issue.

@Fortigate
Copy link
Collaborator

Good to hear, I'll add that fix to the frequent issues list

@ilpersi
Copy link
Owner

ilpersi commented Dec 3, 2019

I am having similar issues and this is happening when Chrome crashes.

In those circumstances, the bot throws a timeout error and the Chromium windows become unresponsive, so when the bot tries to reboot two windows are present.

@MWEckert
Copy link
Author

MWEckert commented Dec 12, 2019

Recently I'm having a resurgence of this issue. The bot will crash, and appears to dissociate from chromium. So, I only have one (1) window, but it never recovers from what seems like frequent crashes.

java.lang.Thread.getStackTrace(Unknown Source)
Misc.getStackTrace(Misc.java:29)
MainThread.dumpCrashLog(MainThread.java:786)
MainThread.restart(MainThread.java:811)
MainThread.restart(MainThread.java:800)
MainThread.restart(MainThread.java:886)
MainThread.run(MainThread.java:922)
java.lang.Thread.run(Unknown Source)

@Fortigate
Copy link
Collaborator

I've had similar issue recently as I've been having internet issues, after a crash (due to no connection) and restart the bot doesn't reassociate with the open chrome session, and hangs.

@MWEckert
Copy link
Author

I think I've figured out what triggers the frequent crashes I was having. Any time the bot couldn't read a value, due to hover text from alerts/notifications/etc, it would be unable to recover and time-out. Then, when it attempted to restart, it couldn't re-associate with the new window.

@ilpersi
Copy link
Owner

ilpersi commented Dec 13, 2019

Timeout is exactly the issue and I've put some code to manage it but it seems it is not effective.

The issue is that when I timeout is triggered, it seems that the bound between the bot and Chrome is broken and there is no way to restore it.

One question: when you get this kind of error, the bot should create a screenshot with the error. What do you see in that screenshot? Is it just the bot window or the whole desktop?

Thank you.

@MWEckert
Copy link
Author

MWEckert commented Dec 13, 2019 via email

@ilpersi
Copy link
Owner

ilpersi commented Jan 2, 2020

@MWEckert The new v44pr1 has some improvements on this issue even if they can not be considered a final solution: can you have a test with it?

@MWEckert
Copy link
Author

MWEckert commented Jan 2, 2020 via email

@ilpersi ilpersi added the bug Huston, we have a problem. label Jan 17, 2020
@ilpersi
Copy link
Owner

ilpersi commented Jan 31, 2020

@MWEckert how is it going? This is not happening anymore for me lately

@MWEckert
Copy link
Author

MWEckert commented Jan 31, 2020 via email

@ilpersi
Copy link
Owner

ilpersi commented Jan 31, 2020

Can you please add the useDoNotShareURL 1 parameter to your settings.ini and try again?

It is not a fix, but it will run BH without the Kongregate interface consuming fewer resources. For me it seems to reduce the issues.

@MWEckert
Copy link
Author

MWEckert commented Jan 31, 2020 via email

@ilpersi
Copy link
Owner

ilpersi commented Feb 1, 2020

@MWEckert do you have any feedback on how it is going?

@MWEckert
Copy link
Author

MWEckert commented Feb 1, 2020 via email

@ilpersi ilpersi added wontfix Sorry, but the dev team won't fix this one and removed bug Huston, we have a problem. labels Feb 11, 2020
@ilpersi
Copy link
Owner

ilpersi commented Feb 11, 2020

I reviewed the code once more and at the moment there is nothing I am able to change to fix this so I will mark this as wont fix. I am sorry about this.

I can only say that the latest version is pretty stable for me: I have it running from more than a week with no issues so far

@MWEckert
Copy link
Author

MWEckert commented Feb 11, 2020 via email

@ilpersi ilpersi closed this as completed Mar 15, 2020
@ilpersi
Copy link
Owner

ilpersi commented Mar 20, 2020

@MWEckert I encourage you to update to the new v44.1 just released. If fixes a very long-standing memory leak issue in BHBot core.

Based on my findings, the issue reported in this thread, is affected by resource availability so this can be one more step to increased stability.

@MWEckert
Copy link
Author

MWEckert commented Mar 21, 2020 via email

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix Sorry, but the dev team won't fix this one
Projects
None yet
Development

No branches or pull requests

3 participants