Greatness7 / nexusmods_file_updater

Automate the process of updating your (nexusmods.com) files.
2 stars 0 forks source link

Stopped working #1

Open hmlendea opened 2 years ago

hmlendea commented 2 years ago

It stopped working sometime last month, due to not being able to locate a page element anymore:

  File "/home/runner/work/_actions/greatness7/nexusmods_file_updater/v2/action.py", line 204, in <module>
    action.login(driver)
  File "/home/runner/work/_actions/greatness7/nexusmods_file_updater/v2/action.py", line 89, in login
    user_login = driver.find_element(By.ID, "user_login")
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 1248, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 425, in execute
    self.error_handler.check_response(response)
  File "/opt/hostedtoolcache/Python/3.9.12/x64/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: [id="user_login"]
Stacktrace:
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:183:5
NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:395:5
element.find/</<@chrome://remote/content/marionette/element.js:300:16
Greatness7 commented 2 years ago

I've taken a look at the webpage and the elements are still there and with the correct id. Might be the page was temporarily broken on NexusMods' side.

At the time of this comment the action ran successfully on the OAAB repository.

hmlendea commented 2 years ago

Hi. I can confirm it works now.

I don't know exactly when it started working again, but 8 out of 9 uploads succeded yesterday for more-cultural-names.

Greatness7 commented 2 years ago

I added a more lenient (30s) timeout for finding elements. Hopefully that helps.

hmlendea commented 2 years ago

Seems to be causing issues again

I get the following error for multiple mods for multiple games. I noticed it yesterday and is still happening today, I don't know if it became an issue earlier or not.

Run greatness7/nexusmods_file_updater@v2
  with:
    username: ***
    password: ***
    game_domain_name: crusaderkings2
    mod_id: 70
    file_name: more-cultural-names
    file_version: v22.202.0
    update_version: true
    new_existing_version: true
    original_file: more-cultural-names.*
    file_description: Changelog: https://github.com/hmlendea/more-cultural-names/releases/v22.202.0
    file_path: CK2.zip
    file_category: Main Files
    remove_old_version: false
    remove_nmm_button: false
    set_as_main_nmm: false
    requirements_pop_up: true
Run actions/setup-python@v2
  with:
    python-version: 3.9
    token: ***
Successfully setup CPython (3.9.13)
Run pip install selenium
  pip install selenium
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.9.13/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.13/x64/lib
Collecting selenium
  Downloading selenium-4.3.0-py3-none-any.whl (981 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 981.4/981.4 kB 12.7 MB/s eta 0:00:00
Collecting trio-websocket~=0.9
  Downloading trio_websocket-0.9.2-py3-none-any.whl (16 kB)
Collecting trio~=0.17
  Downloading trio-0.21.0-py3-none-any.whl (358 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 359.0/359.0 kB 22.1 MB/s eta 0:00:00
Collecting urllib3[secure,socks]~=1.26
  Downloading urllib3-1.26.10-py2.py3-none-any.whl (139 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 139.2/139.2 kB 10.0 MB/s eta 0:00:00
Collecting outcome
  Downloading outcome-1.2.0-py2.py3-none-any.whl (9.7 kB)
Collecting async-generator>=1.9
  Downloading async_generator-1.10-py3-none-any.whl (18 kB)
Collecting sniffio
  Downloading sniffio-1.2.0-py3-none-any.whl (10 kB)
Collecting sortedcontainers
  Downloading sortedcontainers-2.4.0-py2.py3-none-any.whl (29 kB)
Collecting idna
  Downloading idna-3.3-py3-none-any.whl (61 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 3.4 MB/s eta 0:00:00
Collecting attrs>=19.2.0
  Downloading attrs-21.4.0-py2.py3-none-any.whl (60 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.6/60.6 kB 3.8 MB/s eta 0:00:00
Collecting wsproto>=0.14
  Downloading wsproto-1.1.0-py3-none-any.whl (24 kB)
Collecting pyOpenSSL>=0.14
  Downloading pyOpenSSL-22.0.0-py2.py3-none-any.whl (55 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.8/55.8 kB 3.7 MB/s eta 0:00:00
Collecting cryptography>=1.3.4
  Downloading cryptography-37.0.4-cp36-abi3-manylinux_2_24_x86_64.whl (4.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.1/4.1 MB 54.2 MB/s eta 0:00:00
Collecting certifi
  Downloading certifi-2022.6.15-py3-none-any.whl (160 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.2/160.2 kB 13.2 MB/s eta 0:00:00
Collecting PySocks!=1.5.7,<2.0,>=1.5.6
  Downloading PySocks-1.7.1-py3-none-any.whl (16 kB)
Collecting cffi>=1.12
  Downloading cffi-1.15.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 441.2/441.2 kB 25.0 MB/s eta 0:00:00
Collecting h11<1,>=0.9.0
  Downloading h11-0.13.0-py3-none-any.whl (58 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 58.2/58.2 kB 4.5 MB/s eta 0:00:00
Collecting pycparser
  Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 7.0 MB/s eta 0:00:00
Installing collected packages: sortedcontainers, urllib3, sniffio, PySocks, pycparser, idna, h11, certifi, attrs, async-generator, wsproto, outcome, cffi, trio, cryptography, trio-websocket, pyOpenSSL, selenium
Successfully installed PySocks-1.7.1 async-generator-1.10 attrs-21.4.0 certifi-2022.6.15 cffi-1.15.1 cryptography-37.0.4 h11-0.13.0 idna-3.3 outcome-1.2.0 pyOpenSSL-22.0.0 pycparser-2.21 selenium-4.3.0 sniffio-1.2.0 sortedcontainers-2.4.0 trio-0.21.0 trio-websocket-0.9.2 urllib3-1.26.10 wsproto-1.1.0
Notice:  A new release of pip available: 22.1.2 -> 22.2
Notice:  To update, run: pip install --upgrade pip
Run browser-actions/setup-firefox@latest
  with:
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.9.13/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.13/x64/lib
Setup firefox latest (en-US)
Attempting to download firefox latest...
Acquiring latest from https://download.mozilla.org/?product=firefox-latest&os=linux64&lang=en-US
Extracting Firefox...
/usr/bin/tar xj --strip-components=1 --warning=no-unknown-keyword --overwrite -C /home/runner/work/_temp/4ad9f9a9-da2b-4f73-9904-071a1fa306a6 -f /home/runner/work/_temp/0161fcb1-448e-4eda-8ce9-672868ef9d35
Successfully extracted firefox latest to /home/runner/work/_temp/4ad9f9a9-da2b-4f73-9904-071a1fa306a6
Adding to the cache ...
Successfully cached firefox latest to /opt/hostedtoolcache/firefox/latest/x64
Successfully setup firefox version latest
/opt/hostedtoolcache/firefox/latest/x64/firefox --version
Mozilla Firefox 102.0.1
Run browser-actions/setup-geckodriver@latest
  with:
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.9.13/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.13/x64/lib
Setup geckodriver 0.31.0
Downloading geckodriver 0.31.0 from https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz
Extracting /home/runner/work/_temp/4359d841-da92-4412-afde-c05973cafd61
/usr/bin/tar xz --warning=no-unknown-keyword -C /home/runner/work/_temp/350600e0-d8d2-4bc9-934f-5b1ae5b245c9 -f /home/runner/work/_temp/4359d841-da92-4412-afde-c05973cafd61
Successfully cached geckodriver 0.31.0 to /opt/hostedtoolcache/geckodriver/0.31.0/x64
Successfully setup geckodriver version 0.31.0
/opt/hostedtoolcache/geckodriver/0.31.0/x64/geckodriver --version
geckodriver 0.31.0 (b617178ef491 2022-04-06 11:57 +0000)
The source code of this program is available from
testing/geckodriver in https://hg.mozilla.org/mozilla-central.
This program is subject to the terms of the Mozilla Public License 2.0.
You can obtain a copy of the license at [https://mozilla.org/MPL/2.0/.](https://mozilla.org/MPL/2.0/)
Run python /home/runner/work/_actions/greatness7/nexusmods_file_updater/v2/action.py
  python /home/runner/work/_actions/greatness7/nexusmods_file_updater/v2/action.py
  shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.9.13/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.13/x64/lib
    USERNAME: ***
    PASSWORD: ***
    GAME_DOMAIN_NAME: crusaderkings2
    MOD_ID: 70
    FILE_NAME: more-cultural-names
    FILE_VERSION: v22.202.0
    UPDATE_VERSION: true
    FILE_CATEGORY: Main Files
    NEW_EXISTING_VERSION: true
    ORIGINAL_FILE: more-cultural-names.*
    REMOVE_OLD_VERSION: false
    FILE_DESCRIPTION: Changelog: https://github.com/hmlendea/more-cultural-names/releases/v22.202.0
    REMOVE_NMM_BUTTON: false
    SET_AS_MAIN_NMM: false
    REQUIREMENTS_POP_UP: true
    FILE_PATH: CK2.zip
Traceback (most recent call last):
  File "/home/runner/work/_actions/greatness7/nexusmods_file_updater/v2/action.py", line 205, in <module>
    action.login(driver)
  File "/home/runner/work/_actions/greatness7/nexusmods_file_updater/v2/action.py", line 89, in login
    user_login = driver.find_element(By.ID, "user_login")
  File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 857, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 435, in execute
    self.error_handler.check_response(response)
  File "/opt/hostedtoolcache/Python/3.9.13/x64/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: AbortError: Actor 'MarionetteCommands' destroyed before query 'MarionetteCommandsParent:findElement' was resolved
Validating input parameters...
Configuring webdriver options...
Starting webdriver...
Logging in...
Error: Process completed with exit code 1.
hmlendea commented 2 years ago

Also, I'm pretty sure you need to release v3 for your previous change (the increased timeout) to take effect in the repos that use this GH Action