Error: EPERM, operation not permitted with Node.js and Etherpad Lite
Asked Answered
C

5

10

I'm attempting to get an Etherpad Lite site up and running with IIS on my computer before I upload it to Azure for Web Sites, but I get this error when I try (http://pastebin.com/4rZWbqix):

iisnode encountered an error when processing the request. HRESULT: 0x2 HTTP status: 500 HTTP reason: Internal Server Error

You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.

In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.

The last 64k of the output generated by the node.exe process to stdout and stderr is shown below: fs.js:520 return

      binding.lstat(pathModule._makeLong(path));
              ^ Error: EPERM, operation not permitted 'C:\Users\Matthew'
at Object.fs.lstatSync (fs.js:520:18)
at Object.realpathSync (fs.js:1047:21)
at tryFile (module.js:142:15)
at Function.Module._findPath (module.js:181:18)
at Function.Module._resolveFilename (module.js:336:25)
at Function.Module._load (module.js:280:25)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

There is no fs.js file in Etherpad's directory, so I would assume that it's some part of Node.js that's having a problem. I'm new to Node.js, so any help would be appreciated.

EDIT 1: I'm currently looking into alternatives to Azure, and granting permissions to C:\Users\Matthew. But would it be possible to somehow modify fs.js to put a try/catch around binding.lstat?

EDIT 2: After playing around with it a little (adding the permissions worked!), I've gotten it to work. But now loading 127.0.0.1:81 returns:

iisnode encountered an error when processing the request. HRESULT: 0x2 HTTP status: 500 HTTP reason: Internal Server Error

You are receiving this HTTP 200 response because system.webServer/iisnode/@devErrorsEnabled configuration setting is 'true'.

In addition to the log of stdout and stderr of the node.exe process, consider using debugging and ETW traces to further diagnose the problem.

The last 64k of the output generated by the node.exe process to stdout and stderr is shown below:

[x1B][33m[2012-10-03 20:28:13.587] [WARN] console - [x1B][39mNo settings file found. Continuing using defaults!

[x1B][32m[2012-10-03 20:28:14.338] [INFO] console - [x1B][39mInstalled plugins:

It would seem like this isn't an error, since what's outputted is what's expected, but it seems to stop at plugins.formatPlugins().

Cistaceous answered 3/10, 2012 at 23:50 Comment(2)
What did you end up doing to fix this? I have my files in C:\Users\langdonx\Documents\WebStorm Projects\x, but the error says 'C:\Users\langdonx'. I dont want to grant IIS_IUSRS access to my whole users directory. What am I missing?Blakeley
Unfortunately, I never found a workaround :\Cistaceous
B
9

Make sure the user identity associated with the IIS application pool running your node.js application has appropriate filesystem permissions to the location where you deployed your application (looks like c:\users\matthew in this case).

If you are running your app within the Default App Pool and using default IIS user, you should be able to grant necessary permissions with:

%systemdrive%\windows\system32\icacls.exe c:\users\matthew /grant IIS_IUSRS:(OI)(CI)F

Blankly answered 4/10, 2012 at 2:36 Comment(2)
I just ran into this error. I have my files in C:\Users\langdonx\Documents\WebStorm Projects\x, giving full access to Everyone, but the error still cites operation not permitted 'C:\Users\langdonx'. I dont want to grant IIS_IUSRS access to my whole users directory. What am I missing?Blakeley
Double check the folder noted after "operation not permitted". I had a web site in a well nested folder, with it's own local node_modules and received this error, and it turned out that node recurses up the folder tree looking for node_modules folders and it made it's way up to c:\users\bob\node_modules and that's where I had terrible trouble giving access. For dev purposes, I just set the app pool identity to "LocalService" and that worked. Giving the app pool permission to the folder c:\users\bob did not work.Incommodity
W
1

Case

Error: EPERM, operation not permitted 'C:\Users\Matthew'

This error occour because the user IIS_IUSRS, does not have access to this folder C:\Users\Matthew

Resolution

You can put your application on a 'public folder', example: 'C:\Test\[yourapplication]' and gives access to user IIS_IUSRS only to this folder.

Wigeon answered 26/8, 2021 at 11:24 Comment(0)
E
0

It is about permission on the folder 'C:\Users\Matthew'. Take ownership and give modify permissions.

Electrotonus answered 16/1, 2014 at 12:42 Comment(0)
B
0

I had the same issue, and when I tried to use the latest node version via nvm use [some node version 10.12.0 in my case] it output that it succeed but when I run node -v it showed to me that actually I'm on a node of 8.

I solved that by login as second windows user (although they both admins and node installed on C:/) and there I use the nvm use 10.12.0 to replace the node version, and when I back login with current user it worked.

Blandina answered 3/12, 2020 at 19:58 Comment(0)
C
-3

I wouldn't recommend Azure for hosting Etherpad Lite, we don't optimize for Microsoft's services, this includes Microsoft Windows. If it's an option please use linux to host your node instances, you will be much happier in my experience.

Countercharge answered 4/10, 2012 at 2:18 Comment(2)
which node.js host would you recommend? Most of the other ones I've come across don't play very nicely with Windows, which is why I had settled on Azure.Cistaceous
In the documentation, installation part starts with Windows. github.com/ether/etherpad-lite lolAlonzoaloof

© 2022 - 2024 — McMap. All rights reserved.