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

rcedit.exe failed - unable to commit changes #590

Closed
hlfshell opened this issue Feb 17, 2017 · 48 comments
Closed

rcedit.exe failed - unable to commit changes #590

hlfshell opened this issue Feb 17, 2017 · 48 comments
Labels
blocked 🚫 Depends on another issue either in this project or a dependency's project bug 🐛 build-target:windows Bundling an Electron app specifically for Windows

Comments

@hlfshell
Copy link

I'm am using electron-packager 8.5.1 with Electron 1.4.13 (also tried using 1.2.2), attempting to build on Windows 10 for Windows.

I keep getting the following:

λ electron-packager . app --platform=win32 --arch=x64
Packaging app for platform win32 x64 using electron v1.4.13
rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes

While I'm aware that electron-packager comes with rcedit, I've downloaded rcedit from the electron/rcedit repos and placed it into my path to ensure I can execute rcedit and it isn't a pathing issue.

I can't find much through google or the issues of electron-packager or rcedit, so I was hoping someone would have an idea on what I can do from here.

@hlfshell
Copy link
Author

On a hunch I rolled back to electron-packager 7.0.0. The build works fine, though it errors out on an lstat, the resulting app.exe is still there with no performance issues. I will try and locate when this issue was initially brought in.

@hlfshell
Copy link
Author

The issue was introduced in release 7.7.0 - version 7.6.0 does the build fine as previously stated.

@malept
Copy link
Member

malept commented Feb 17, 2017

That doesn't make any sense to me. Here are the changes between 7.6.0 and 7.7.0: v7.6.0...v7.7.0

Here's the error message in the rcedit.exe source: https://github.com/electron/rcedit/blob/1c9920ac153e6d4cd2d63ddb4148a323e4b94d2e/src/main.cc#L107-L108

I am not a Windows dev, so I would suggest filing a bug in the rcedit issue tracker and seeing if someone responds.

@malept malept added blocked 🚫 Depends on another issue either in this project or a dependency's project bug 🐛 build-target:windows Bundling an Electron app specifically for Windows labels Feb 17, 2017
@hlfshell
Copy link
Author

Agreed, I was just looking through commits between tags 7.6.0 and 7.7.0 and it seems to be minimal changes. BUT I just removed 7.6.0 and re-installed 7.7.0 - same result, albeit different presentation than the latest version.

λ electron-packager . app --platform=win32 --arch=x64
Packaging app for platform win32 x64 using electron v1.4.13
Fatal error: Unable to commit changes
 undefined

rcedit is brought in through node-rcedit - is there a difference in the version being pulled down between 7.7.0 and 7.6.0 that I'm not seeing to narrow down the problem in rcedit?

@develar
Copy link
Contributor

develar commented Feb 17, 2017

Where is your project located? In your home directory? Have you tried to disable MS Defender or another antivirus?

@hlfshell
Copy link
Author

....and the answer is no, both request ^0.5.1.

My 7.7.0 install install and 7.6.0 install also have 0.5.1 rcedit in their node_modules, so its not a problem with versioning of rcedit. I've also confirmed that 7.6.0 will build where 7.7.0 does not. I'm at a loss.

@malept
Copy link
Member

malept commented Feb 17, 2017

@hlfshell I think I know what the problem is. Could you link a gist of your package.json file?

@hlfshell
Copy link
Author

hlfshell commented Feb 17, 2017

Where is your project located? In your home directory? Have you tried to disable MS Defender or another antivirus?

I'm on a company computer, so there is antivirus via Cylance. I can try building the project tonight on a personal computer without the antivirus to see if there's a difference.

I'm performing the build in C:\Users\myuser\project-folder\

@hlfshell I think I know what the problem is. Could you link a gist of your package.json file?

Here you go!

{
  "name": "radio-distance-tester",
  "version": "1.0.0",
  "description": "Tester app for featherwing LoRa radio devices",
  "main": "main.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": {
    "email": "my@email.com",
    "name": "my name"
  },
  "license": "Private",
  "dependencies": {
    "electron-prebuilt": "^1.4.13",
    "serialport": "^4.0.7"
  },
  "devDependencies": {
    "electron-rebuild": "^1.5.7"
  }
}

I HAVE done the electron-rebuild process for serialport, though not every time. Could that be a cause?

@malept
Copy link
Member

malept commented Feb 17, 2017

@hlfshell FYI, you should remove electron-prebuilt and put electron in your devDependencies. But that's not relevant to your issue.

Hmmm. So I figured the problem was that in 7.7.0, we started using version in package.json to set ProductVersion and FileVersion in the Windows app executable. I haven't tested this, but try setting --app-version= (blank) and see what happens.

@hlfshell
Copy link
Author

@malept Unfortunately that's a no-go. Re-installed v7.7.0:

λ electron-packager . app --platform=win32 --arch=x64 --app-version=0.0.1
Packaging app for platform win32 x64 using electron v1.4.13
Fatal error: Unable to commit changes
 undefined

@malept
Copy link
Member

malept commented Feb 17, 2017

@hlfshell oh, leave it as --app-version=, don't set a value if possible. It's probable that it might not actually work, though.

@hlfshell
Copy link
Author

Sorry, my mistake. Re-ran:

λ electron-packager . app --platform=win32 --arch=x64 --app-version=
Packaging app for platform win32 x64 using electron v1.4.13
Fatal error: Unable to commit changes
 undefined

Same result, I'm afraid.

@malept
Copy link
Member

malept commented Feb 17, 2017

@hlfshell Do you happen to have access to a different machine? It can have the same antivirus or whatever.

@hlfshell
Copy link
Author

Yes, I will try to build elsewhere and will report back. Searching for a difference or do you have an idea in mind?

@malept
Copy link
Member

malept commented Feb 17, 2017

Just searching for a difference. Also, If you have access to a Mac/Linux machine, I think that would solve your problem. (assuming you install Wine, etc.)

@hlfshell
Copy link
Author

Afraid the only Linux boxes I have are raspberry pis, so that would prove difficult to build from.

Will report back with a different machine in a bit.

@malept
Copy link
Member

malept commented Feb 17, 2017

I found this, it might be related: electron/node-rcedit#6 (comment)

@hlfshell
Copy link
Author

I found that earlier, and created a .ico using an online convereter in case it was as simple as not providing an icon. But let's give it a try with everything else we've done so far. Using v7.7.0:

Packaging app for platform win32 x64 using electron v1.4.13
Fatal error: Unable to commit changes
 undefined

No-go I'm afraid.

@malept
Copy link
Member

malept commented Feb 17, 2017

I was more referring to the comment that it supposedly doesn't work with Node, but does if you invoke rcedit directly.

@JAA17
Copy link

JAA17 commented Feb 19, 2017

I am having a similar problem. I have just started with electron-packager and am a new member here at Github. If this is different, let me know and I will start a new issue.

I sometimes get the error above, but also get the more frequent error:

ERR! Error: EPERM: operation not permitted, rmdir c:\Users\Jon\Desktop\Test\distwin32a\mytest1-win32-x64\resources\app\node_modues

My script is:

"build-win32": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform win32 --icon ./assets/icon.ico --out ./distwin32a --overwrite"

My package is:

    {
  "name": "mytest1",
  "version": "1.0.0",
  "description": "MyTest2",
  "main": "main.js",
  "scripts": {
    "start": "electron main.js",
	"build-all": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform all --icon ./assets/icon --out ./dist",
	"build-win32": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform win32 --icon ./assets/icon.ico --out ./distwin32a --overwrite",
	"build-linux": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform linux --icon ./assets/background.png --out ./distlinux --overwrite",
	"build-osx": "electron-packager . --electron-version 1.4.15 --tmpdir=false --platform darwin --icon ./assets/icon.icns --out ./distdarwin --overwrite"
  },
  "private": true,
  "build": {
    "appId": "mycomany.myproduct"
  },
  "keywords": [
    "Stuff",
    "Stuff"
  ],
  "author": "JAA17",
  "license": "SEE LICENSE IN LICENSE.TXT",
  "devDependencies": {
    "electron-packager": "^8.5.1"
  }
}

The only thing I have in the background is Visual Studio where I do my code editing.

@malept
Copy link
Member

malept commented Feb 19, 2017

@JAA17 The EPERM error is a different error, please file a different issue.

@dexo568
Copy link

dexo568 commented Apr 3, 2017

Just wanted to comment that I also encountered this error and rolling back also solved the issue for me. I work with @hlfshell and another, third coworker just ran into this problem, so at this point it's safe to say this has something to do with our dev setup. Cylance (network antivirus) seems like a likely culprit to me.

@malept
Copy link
Member

malept commented Apr 3, 2017

At this point I would suggest trying to use Electron Packager with the network shut off (assuming you already have prebuilt Electron cached on the machine), given your network antivirus comment.

@hlfshell
Copy link
Author

We've re-imaged our systems due to a company buyout, and the problem magically went away.

I've confirmed now on two other systems that this does not occur in Windows 10. This leads me to believe that something locally in our company caused the issue. Not sure why, since there was no difference in the rcedit executables between our versions.

Let's close this issue unless someone else ever runs into it.

Thanks for the help everyone!

@mikezila
Copy link

mikezila commented May 2, 2017

I'm having this same issue on macOS 10.12.4. I'm using wine v2.0.1 from homebrew, electron v1.6.6 and electron-packager v8.6.0 from npm.

pennies > electron-packager . pennies --platform=win32 --arch=x64
Packaging app for platform win32 x64 using electron v1.6.6
rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes

Building for macOS works fine. I tried the above suggestion of using --app-version= but the result is the same. There are no antivirus or security programs running to interfere.

@malept
Copy link
Member

malept commented May 2, 2017

@mikezila has it ever worked for you? Is it possible to try using a real Windows machine, a Windows VM, or an earlier version of Wine?

@mikezila
Copy link

mikezila commented May 2, 2017

Trying it on a Windows 7 vm with a 100% fresh install of node and friends seems to work fine.

I was previously using wine 2.0.1, when I used homebrew to swap to an earlier version (2.0) it seemed to work fine, but still failed once I swapped back to 2.0.1. Doing a brew info wine it looked like the latest version (2.0.1) was installed twice somehow. Doing brew uninstall --force wine to remove them all and then just doing brew install wine to get the latest again seems to have fixed it. If future internet travelers find this I suggest giving the above a try. Wine was otherwise working fine, but doing a forced uninstall and reinstall fixed it regardless.

Thanks for you reply.

@segsalerty2013
Copy link

@mikezila , how did you get to finally fix packaging win32 on your mac? I am facing this issue. packaging for macOS works fine. This used to work smoothly on my previous machine before i did a time-machine backup and restored into another mac just last week. I have tried out all tips i have found on the internet.
I ran a brew info wine after installing a fresh one. I noticed this:

==> Dependencies
Build: pkg-config ✘, cmake ✘, makedepend ✘

looks like these dependencies are missing. could this have caused my challenges packaging for windows ?

Pls, help. thanks.

@gangajj
Copy link

gangajj commented Jun 12, 2017

Just restart your machine. It is due to Windows permission issue. I tried to set permission for that folder. But I was not able to.

Then restarted machine The issue got resolved. :)

@ronnyek
Copy link

ronnyek commented May 30, 2018

I'm seeing this come up at least 3 times a day on my CI machines, where rebooting 3 times a day isn't really all that realistic. Can anyone clarify which files or folders windows is supposedly taking a lock on or having permissions problems with? Is there anything I can do to make the whole process a bit more robust so that I can have some dependable builds again?

@jremi
Copy link

jremi commented Jun 20, 2018

@ronnyek did u solve this? same thing here.

@merijnv
Copy link

merijnv commented Sep 11, 2018

I do experience the same thing, it worked once and after that it doesn't work. Removing the dist folder manually did not work either.

@navono
Copy link

navono commented Oct 15, 2018

+1.
Build multiple times, and error happens occasionally. Totally don't know why.

@garymcm
Copy link

garymcm commented Oct 22, 2018

Got the same error:

rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes

  • Disabled McAfee's real-time scanning and it worked.
  • Added rcedit.exe to McAfee's Excluded Files, re-enabled RT Scan and it worked.

Hope this helps someone.

@nihalmpatel
Copy link

Disabling the Antivirus worked for me!

@navono
Copy link

navono commented Oct 31, 2018

Disabling the Antivirus worked for me too!

@ilDon
Copy link

ilDon commented Jul 2, 2019

I was having the same issue, turns out it was due to the Windows Ransomware protection. Disabling it solved the issue for me.

@justsoloser
Copy link

rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes

禁用掉防病毒软件windows防火墙再打包就ok了!

@hilanmiao
Copy link

rcedit.exe failed with exit code 1. Fatal error: Unable to commit changes

禁用掉防病毒软件windows防火墙再打包就ok了!

呵呵哒,确实是这样,把所有的电脑管家和防火墙关了就ok了。

@alexbfree
Copy link

  • Disabled McAfee's real-time scanning and it worked.
  • Added rcedit.exe to McAfee's Excluded Files, re-enabled RT Scan and it worked.

Hope this helps someone.

Thank you so much. This solved my problem! The rcedit.exe to add to your exclude list is located within node_modules\rcedit\bin within your app directory.

@YvoneQY
Copy link

YvoneQY commented Feb 18, 2020

Thank you so much. This solved my problem

@russlamb
Copy link

russlamb commented Apr 1, 2020

is there any workaround for Cyclance security software? I'm having the same issue on Windows 10, version

electron-builder version=22.4.1 os=10.0.17763
platform=win32 arch=x64 electron=8.2.0 appOutDir=build\win-unpacked
arget=portable file=build\MY_APPLICATION.exe archs=x64

@CeamKrier
Copy link

For the ones that have the issue while using Windows OS and default antivirus (Defender) the steps below will resolve your issue.

@adreeeyan
Copy link

is there any workaround for Cyclance security software? I'm having the same issue on Windows 10, version

electron-builder version=22.4.1 os=10.0.17763
platform=win32 arch=x64 electron=8.2.0 appOutDir=build\win-unpacked
arget=portable file=build\MY_APPLICATION.exe archs=x64

What I did is I signed the rcedit executable.
image

The certificate that I use is EV. I found out that cylance likes EV signed assemblies.

@raf202
Copy link

raf202 commented Feb 13, 2021

Disabled Dropbox Sync and it worked. Apparently, external processes reading/locking files causes this problem.

@xammm
Copy link

xammm commented Mar 4, 2022

This issue caused me a lot of pain.

What I did today to overcome it, was to clone the rcedit repo, set up Visual Studio (and add all the VS components needed to compile C+ code such as Windows 10 SDK), and build the exe myself. I then replaced \node_modules\rcedit\bin\rcedit.exe with the one I built and since then no issue.

@SivertGullbergHansen
Copy link

SivertGullbergHansen commented Feb 3, 2023

For the ones that have the issue while using Windows OS and default antivirus (Defender) the steps below will resolve your issue.

This didn't resolve my issue. However, what DID resolve my issue was opening Task Manager and ending any process called 'electron.exe'.
Once these were gone I could successfully build 👍🏼

@john8329
Copy link

Happened to me when using Synology Drive (or probably any sync tool). Workaround: copy the project locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked 🚫 Depends on another issue either in this project or a dependency's project bug 🐛 build-target:windows Bundling an Electron app specifically for Windows
Projects
None yet
Development

No branches or pull requests