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

fix: file already in use error during unzip #695

Closed
wants to merge 1 commit into from
Closed

fix: file already in use error during unzip #695

wants to merge 1 commit into from

Conversation

heinzbeinz
Copy link

I got an error in Windows during 7zip invokation (The process cannot access the file because it is being used by another process). I changed the finish stream event to close to ensure that the file descriptor is closed after download.

@mention-bot
Copy link

@heinzbeinz, thanks for your PR! By analyzing the annotation information on this pull request, we identified @develar to be a potential reviewer

@develar
Copy link
Member

develar commented Aug 26, 2016

I am sure that finish should be used (e.g. it is used int the fs-extra to copy files). Could you please attach error stack trace?

@heinzbeinz
Copy link
Author

heinzbeinz commented Aug 26, 2016

Here is the stacktrace:

Extracting archive: C:\Users$user.cache\winCodeSign\530-156c59193f4-1.7z

Can't open as archive: 1
Files: 0
Size:       0
Compressed: 0

Error output:
ERROR: C:\Users\$user\.cache\winCodeSign\530-156c59193f4-1.7z
Can not open the file as archive

The process cannot access the file because it is being used by another process.

    at ChildProcess.childProcess.once.code (C:\projects\rl3\client\node_modules\electron-builder\src\util\util.ts:154:14)
    at ChildProcess.g (events.js:286:16)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:850:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:492:12)
From previous event:
    at Object.spawn (C:\projects\rl3\client\node_modules\electron-builder\src\util\util.ts:117:9)
    at C:\projects\rl3\client\node_modules\electron-builder\src\util\binDownload.ts:62:14
    at next (native)
    at emitNone (events.js:91:20)
    at WriteStream.emit (events.js:185:7)
    at finishMaybe (_stream_writable.js:488:14)
    at afterWrite (_stream_writable.js:362:3)
    at onwrite (_stream_writable.js:352:7)
    at WritableState.onwrite (_stream_writable.js:89:5)
    at fs.js:1866:5
    at FSReqWrap.wrapper [as oncomplete] (fs.js:741:5)
From previous event:
    at tsAwaiter (C:\projects\rl3\client\node_modules\electron-builder\src\util\awaiter.ts:10:47)
    at Object.build (C:\projects\rl3\client\node_modules\electron-builder\src\builder.ts:195:52)
    at Object.<anonymous> (C:\projects\rl3\client\node_modules\electron-builder\src\build-cli.ts:27:28)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:449:3
child process exited with code 4294967295

@develar
Copy link
Member

develar commented Aug 26, 2016

nugget also uses finish.... Hmm...

@develar
Copy link
Member

develar commented Aug 26, 2016

Do you get this error often or only once?

@heinzbeinz
Copy link
Author

I got the error repeatedly. But currently I dont't get it, but my coworker does.

@heinzbeinz
Copy link
Author

heinzbeinz commented Aug 26, 2016

If you think that finish is fine, then I close the PR.

@develar
Copy link
Member

develar commented Aug 27, 2016

Thanks for spotting.

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 this pull request may close these issues.

3 participants