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

local.js crashes process if binarypath option is specified and there's an error launching proxy #119

Open
rwproctor opened this issue Jan 14, 2021 · 2 comments

Comments

@rwproctor
Copy link

The start function in the local.js code will attempt to unlink and delete the executable and then re-download a new version of the proxy even if a binarypath is specified. If a binarypath is specified, then the caller is indicating that they do not want to run off a downloaded (and potentially newer version) of the proxy and hence the binary should not be deleted. In our case on Windows, the unlink operation causes an EPERM error that causes the process to exit.

Expected Behavior

If a binaryPath is specified, then the code should not try to unlink or delete it.

Actual Behavior

The code is attempting to delete it which could cause an error.

Steps to Reproduce the Problem

  1. Specify a binarypath for the proxy executable
  2. Force the launch of the proxy to fail (bad key or no network)

browserstack local arguments

{ 'key': '', 'forceLocal': 'true', 'binarypath': config.proxyPath, 'local-identifier': 'UNK', 'logfile': 'proxy.log', 'parallel-runs': 2, 'verbose': '1', 'use-ca-certificate': 'certs.pem', 'exclude-hosts': '.*\.gvt1.com .*\.apple.com .*\.google.com .*\.cloudfront.net .*\.googleapis.com .*\.microsoft.com .*\.digicert.com .*\.cloudfront.net .*\.cloudfront.com' };

Platform details

  1. browserstack-local-nodejs version: [email protected]
  2. node version: v14.15.1
  3. os type and version: Windows NT 6.2

Details

This is causing our server that manages proxies for 14 teams on this server to crash whenever there is an issue connecting to the browserstack server. We recycle our keys frequently for security reasons and everytime the keys get recycled we must restart the proxies. Here's a sample of the issue occurring.

Screen Shot 2021-01-14 at 10 42 02 AM

The suggested code fix in local.js would be...

Screen Shot 2021-01-14 at 11 07 37 AM

@bipul21
Copy link
Collaborator

bipul21 commented Feb 11, 2021

We are looking into this.

@SDETQATestAutomation
Copy link

Any Update on this issue, i am getting same error.

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

No branches or pull requests

3 participants