Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unhandled promise rejection when trying to install non-existent browser version #487

Open
thw0rted opened this issue Mar 17, 2021 · 2 comments · May be fixed by #488
Open

Unhandled promise rejection when trying to install non-existent browser version #487

thw0rted opened this issue Mar 17, 2021 · 2 comments · May be fixed by #488

Comments

@thw0rted
Copy link

This is a different issue from #393, in spite of the similar title. The resolution for that issue was to check that a full semver was passed as an argument, but I'm talking about user error where a Chrome version is specified that isn't present in the index (XML) downloaded from the server.

Try running webdriver-manager update --versions.chrome=88.77.66.55 (or any a non-existent version). You'll wind up with output like

[12:37:38] E/downloader - options.uri is a required argument
[12:37:38] I/update - chromedriver: file exists ...\node_modules\webdriver-manager\selenium\chromedriver_88.77.66.55.zip
[12:37:38] I/update - chromedriver: unzipping chromedriver_88.77.66.55.zip
(node:19840) UnhandledPromiseRejectionWarning: Error: Invalid filename: ...\node_modules\webdriver-manager\selenium\chromedriver_88.77.66.55.zip
    at unzip (...\node_modules\webdriver-manager\built\lib\cmds\update.js:232:19)
    at ...\node_modules\webdriver-manager\built\lib\cmds\update.js:205:13
    at async Promise.all (index 1)
(node:19840) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:19840) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Failure to handle this error also means that the script's exit code is zero, so it's impossible to use webdriver-manager update in a script and fail gracefully when it doesn't actually install the chromedriver.

@thw0rted thw0rted linked a pull request Mar 17, 2021 that will close this issue
@kwisatz
Copy link

kwisatz commented Aug 9, 2023

~$ webdriver-manager update --versions.chrome=$(chromium --version | cut -d ' ' -f 2)
webdriver-manager: using global installed version 12.1.9
[14:49:41] I/config_source - curl -o/home/kwisatz/.nvm/versions/node/v18.16.0/lib/node_modules/webdriver-manager/selenium/standalone-response.xml https://selenium-release.storage.googleapis.com/
[14:49:41] I/config_source - curl -o/home/kwisatz/.nvm/versions/node/v18.16.0/lib/node_modules/webdriver-manager/selenium/chrome-response.xml https://chromedriver.storage.googleapis.com/
[14:49:41] I/config_source - curl -o/home/kwisatz/.nvm/versions/node/v18.16.0/lib/node_modules/webdriver-manager/selenium/gecko-response.json https://api.github.com/repos/mozilla/geckodriver/releases
[14:49:41] E/downloader - options.uri is a required argument
[14:49:41] I/update - chromedriver: file exists /home/kwisatz/.nvm/versions/node/v18.16.0/lib/node_modules/webdriver-manager/selenium/chromedriver_115.0.5790.170.zip
[14:49:41] I/update - chromedriver: unzipping chromedriver_115.0.5790.170.zip
/home/kwisatz/.nvm/versions/node/v18.16.0/lib/node_modules/webdriver-manager/built/lib/cmds/update.js:232
            throw new Error(`Invalid filename: ${path.resolve(outputDir, fileName)}`);
                  ^

Error: Invalid filename: /home/kwisatz/.nvm/versions/node/v18.16.0/lib/node_modules/webdriver-manager/selenium/chromedriver_115.0.5790.170.zip
    at unzip (/home/kwisatz/.nvm/versions/node/v18.16.0/lib/node_modules/webdriver-manager/built/lib/cmds/update.js:232:19)
    at /home/kwisatz/.nvm/versions/node/v18.16.0/lib/node_modules/webdriver-manager/built/lib/cmds/update.js:205:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Promise.all (index 1)

@thw0rted
Copy link
Author

I believe that this project, like Protractor, has reached end-of-life. They haven't gone through and closed out old issues (or updated the README...) but Google has dropped support for the framework.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants