Repository navigation
spawn EXTBSY error #224
Description
Activity
Still the same. It seems there is a lack of support from browserstack which is not great.
It seems the logic in Nodejs changed a bit in the latest version(s).
This finally works for us: https://github.com/foundation/foundation-sites/blob/develop/patches/browserstack-runner%2B0.9.2.patchdiff --git a/node_modules/browserstack-runner/lib/local.js b/node_modules/browserstack-runner/lib/local.js index 15b147c..4f15a49 100644 --- a/node_modules/browserstack-runner/lib/local.js +++ b/node_modules/browserstack-runner/lib/local.js @@ -180,16 +180,16 @@ var Tunnel = function Tunnel(key, port, uniqueIdentifier, config, callback) { } logger.debug('Downloading BrowserStack Local to "%s"', localBinary); - var file = fs.createWriteStream(localBinary); + var file = fs.createWriteStream(localBinary, {emitClose: true}); https.get('https://s3.amazonaws.com/browserStack/browserstack-local/BrowserStackLocal' + (windows ? '.exe' : '-' + process.platform + '-' + process.arch), function(response) { response.pipe(file); response.on('end', function() { - fs.chmodSync(localBinary, 0700); - setTimeout(function() { + file.on('close', function () { + fs.chmodSync(localBinary, 0700); tunnelLauncher(); - }, 100); + }) }).on('error', function(e) { logger.info('Got error while downloading binary: ' + e.message); throw new Error('Got error while downloading binary: ' + e.message);
Getting this too. 😅 Does it work with older node versions or something?
I tried applying @DanielRuf 's patch but I'm still getting the error.
This is with node v12.16.2 and browserstack-runner 0.9.3 (with and without the patch)
Error: ETXTBSY: text file is busy, open '/home/mauve/programming/sodium-javascript/node_modules/browserstack-runner/lib/BrowserStackLocal' Emitted 'error' event on WriteStream instance at: at internal/fs/streams.js:321:12 at FSReqCallback.oncomplete (fs.js:155:23) { errno: -26, code: 'ETXTBSY', syscall: 'open', path: '/home/mauve/programming/sodium-javascript/node_modules/browserstack-runner/lib/BrowserStackLocal' }@DanielRuf Was there a particular version that worked for you?
I found that deleting the BrowserLocal binary before running the tests helped. (though this seems a bit inefficient).
We use browsertack-runner 0.9.2 and Node 14.7.0
Closing as there seems to be no further interest to resolve this.
Hey, your statement on 2nd Aug mentions that the issue was resolved using the latest version of NodeJS, are you still facing any errors?
@wati123321 it works with my own patch / changes.
that the issue was resolved using the latest version of NodeJS
No, not in the original project without the patch by me.
It broke on newer Node versions.I was able to resolve this by deleting package-lock.json prior to running
npm i.You can see it failing here with the above error.
But then passing here when i add the
run: rm package-lock.jsonstep prior tonpm i.I'm still curious as to why removing package-lock should work. Since browserstack-runner works on Mac locally perhaps some post install operations of the dependencies install something architecture specific.
- added 2 commits that reference this issue
on Apr 11, 2021 - added a commit that references this issue
on Apr 19, 2021
We are getting the following error:
Related: browserstack/browserstack-local-nodejs#19