balena-io-modules / drivelist

List all connected drives in your computer, in all major operating systems
Apache License 2.0
242 stars 90 forks source link

Confusing ETXTBSY error, drivelist 5.1.8 #372

Open pamuz opened 4 years ago

pamuz commented 4 years ago

We saw an error in our application and it seems to involve this module. The exact error we saw is:

internal/child_process.js:407
    throw errnoException(err, 'spawn');
    ^
Error: spawn ETXTBSY
    at ChildProcess.spawn (internal/child_process.js:407:11)
    at spawn (child_process.js:548:9)
    at Object.execFile (child_process.js:232:17)
    at executeScript (/root/workspace/edge1-app/server/node_modules/drivelist/lib/execute.js:101:16)
    at /root/workspace/edge1-app/server/node_modules/drivelist/lib/execute.js:167:5
    at /root/workspace/edge1-app/server/node_modules/drivelist/lib/execute.js:81:5
    at /root/workspace/edge1-app/server/node_modules/graceful-fs/graceful-fs.js:61:14
    at FSReqCallback.oncomplete (fs.js:156:23) {
  errno: 'ETXTBSY',
  code: 'ETXTBSY',
  syscall: 'spawn'
}

This is with version 5.1.8 of the module.

The usage of the module in our code is limited to:

    Drivelist.list((err, drives) => {
      if (err) {
        ErrorReporter.log(err)
      } else {
        this.data.scanningDrives = false
        this._gotDrives(drives)
      }
    })

Do you have any insights if this is actually from the drivelist module?

lurch commented 4 years ago

This is a complete-stab-in-the-dark (I don't work on drivelist), but is it possible that you're calling the drivelist command "too often"?

Although looking at https://github.com/balena-io-modules/drivelist/blob/master/CHANGELOG.md it seems that 5.1.8 is a very old version?