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

MatthewSot picture MatthewSot · Oct 4, 2012 · Viewed 9.2k times · Source

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().

Answer

Tomasz Janczuk picture Tomasz Janczuk · Oct 4, 2012

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