kgregor98 / grass

A Docker Image for getgrass.io
GNU General Public License v3.0
71 stars 54 forks source link

HTTP 500 no such element #3

Closed ThomasHoutrique closed 6 months ago

ThomasHoutrique commented 7 months ago

Hey, I'm getting an error 500 when i try to access the / endpoint :

here are the logs :

Downloading extension...
Downloaded! Installing extension and driver manager...
Installed! Starting...
Started! Logging in...
Logging in...
Logging in...
Logged in! Waiting for connection...
Loading connection...
Connected! Starting API...
 * Serving Flask app 'main'
 * Debug mode: off
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on all addresses (0.0.0.0)
 * Running on http://127.0.0.1:80
 * Running on http://172.18.0.3:80
Press CTRL+C to quit
[2024-02-04 17:44:51,344] ERROR in app: Exception on / [GET]
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/flask/app.py", line 1463, in wsgi_app
    response = self.full_dispatch_request()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/flask/app.py", line 872, in full_dispatch_request
    rv = self.handle_user_exception(e)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/flask/app.py", line 870, in full_dispatch_request
    rv = self.dispatch_request()
         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/flask/app.py", line 855, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)  # type: ignore[no-any-return]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/app/./main.py", line 135, in get
    lifetime_earnings = driver.find_element('xpath', '//*[contains(text(), "Lifetime earnings")]')
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 741, in find_element
    return self.execute(Command.FIND_ELEMENT, {"using": by, "value": value})["value"]
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 347, in execute
    self.error_handler.check_response(response)
  File "/usr/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"//*[contains(text(), "Lifetime earnings")]"}
  (Session info: chrome=121.0.6167.85); For documentation on this error, please visit: https://www.selenium.dev/documentation/webdriver/troubleshooting/errors#no-such-element-exception

192.168.1.51 - - [04/Feb/2024 17:44:51] "GET / HTTP/1.1" 500 -

Thanks :)

kgregor98 commented 7 months ago

Hi! Does the node show up as online on your Grass Dashboard? I'll take a look at the error as soon as I can.

ThomasHoutrique commented 7 months ago

Hi, yep it does, i can farm points. But the endpoint is broken.

kgregor98 commented 6 months ago

New version coming up any minute now. I've added some error handling and corrected the paths in the code, so it should display correctly without errors. If you are still getting errors, try to set ALLOW_DEBUG=True in env variables and send me a screenshot

kgregor98 commented 6 months ago

Closed due to inactivity. If this persists - open a new issue :)