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

[Windows] File locking errors #4204

Closed
WoLfulus opened this issue Nov 18, 2015 · 9 comments
Closed

[Windows] File locking errors #4204

WoLfulus opened this issue Nov 18, 2015 · 9 comments
Labels
Platform: Windows Building on Windows. Resolution: Locked This issue was locked by the bot.

Comments

@WoLfulus
Copy link

I have experienced a lot of errors in the packager (that literally crashes it) everytime I'm developing.

The crash seems to occur here:

if (error.code === 'EADDRINUSE') {

Because error seems to be undefined.

Everytime the crash occurs, there's an error before
capture
with random files.

Process Monitor logs "file locked" on those files when the error occurs.

I managed to stop the server from crashing by adding a check for undefined error and returning if it occurs, but that doesn't seems to be a real fix for me. I don't understand why error callback fires with undefined errors too.

Also, removing react.gradle from the gradle project and making a custom build script (downloading from the packager to the right dest with curl) helped.

Project "Rebuild" also triggers some of these errors (at least i think its related) but this time inside gradle... I'll try to get a stacktrace for this one.

Also... its the default project structure/files (from react-native init)

Any ideas?

@WoLfulus
Copy link
Author

This is what I've added to the exception handler:

if (typeof error === 'undefined') {
    reject();
    return;
}

to void crashing:

capture

@ide ide added Packager Platform: Windows Building on Windows. labels Nov 18, 2015
@kwaak
Copy link

kwaak commented Nov 26, 2015

Yeah, I'm having the same issue, particulary with .idea or .hg directories.
The exception:

ERROR  EPERM: operation not permitted, lstat '...\.hg\wlock-2d06a916'
{"errno":-4048,"code":"EPERM","syscall":"lstat","path":"...\\.hg\\wlock-2d06a916"}
Error: EPERM: operation not permitted, lstat '....\.hg\wlock-2d06a916'
    at Error (native)

It's occuring so frequently that I've resorted to commenting the process.exit(1); line in the uncaughtException handler.
I'm going to dig a bit deeper into the file watching to see if I can dig something up.

@WoLfulus
Copy link
Author

@kwaak It's not only those folders... I've commented the process exit too. Impossible to use packager without it...

@BBLN
Copy link

BBLN commented Jan 9, 2016

I believe that's the same issue:
nodejs/node-v0.x-archive#4337

You can also use watchman

@jsierles
Copy link
Contributor

Closing this issue out for now, as some workarounds were provided here, including using watchman which is recommended on other platforms as well.

Feel free to reopen if this issue still persists!

@yanqiw
Copy link

yanqiw commented May 13, 2016

@WoLfulus where to add the exception handler?

@bcosynot
Copy link

@jsierles using watchman no longer helps

@codetony25
Copy link

+1

@GiacomoP
Copy link

This is still a bug.

@facebook facebook locked as resolved and limited conversation to collaborators Jul 20, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: Windows Building on Windows. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

10 participants