Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 464
MatthewSot Avatar asked Oct 03 '12 23:10

MatthewSot


2 Answers

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

like image 60
Tomasz Janczuk Avatar answered Sep 22 '22 00:09

Tomasz Janczuk


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.

like image 1
Lucas Avatar answered Sep 18 '22 00:09

Lucas