Deploying embedded Raven to prod: access is denied

930 views
Skip to first unread message

Simone Chiaretta

unread,
Jun 25, 2012, 7:40:28 AM6/25/12
to rav...@googlegroups.com
Hi,
after having solved the problem with the language id (now running on 2022) I pushed everything to production, all the files inside the data folder are created, but after that I get an access is denied error.

Is there any permission I have to set?
Also, where should I've to browse to see the management studio? On my local dev machine I go to localhost:8080 but it doesn't seem to work on the server, not using the ip address, and neither using the hostname of the IIS site the embedded ravendb runs inside.

Thx
Simone

Server Error in '/' Application.

Access is denied

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Net.HttpListenerException: Access is denied

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace: 

[HttpListenerException (0x5): Access is denied]
   System.Net.HttpListener.AddAllPrefixes() +335
   System.Net.HttpListener.Start() +883
   Raven.Database.Server.HttpServer.StartListening() in c:\Builds\RavenDB-Unstable-v1.2\Raven.Database\Server\HttpServer.cs:242
   Raven.Client.Embedded.EmbeddableDocumentStore.InitializeInternal() in c:\Builds\RavenDB-Unstable-v1.2\Raven.Client.Embedded\EmbeddableDocumentStore.cs:148
   Raven.Client.Document.DocumentStore.Initialize() in c:\Builds\RavenDB-Unstable-v1.2\Raven.Client.Lightweight\Document\DocumentStore.cs:405
   webnetconf.website.MvcApplication.Application_Start() in C:\Projects\webnetconf\webnetconf.website\Global.asax.cs:60

[HttpException (0x80004005): Access is denied]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +3988565
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +191
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +325
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +407
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +375

[HttpException (0x80004005): Access is denied]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +11529072
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +141
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +4784373


Mauro Servienti

unread,
Jun 25, 2012, 7:43:25 AM6/25/12
to rav...@googlegroups.com

Hi Simone,

 

have set write permission, for the user running the application pool, to the data folder?

 

.m

Simone Chiaretta

unread,
Jun 25, 2012, 7:56:52 AM6/25/12
to rav...@googlegroups.com
Yep,
all files and folders have been created by the app itself.
Looks more like permission for opening the port on which to listen to.
Will try removing the listentohttp option to see if that's the problem

Thx
Simo

Simone Chiaretta

unread,
Jun 25, 2012, 8:11:25 AM6/25/12
to rav...@googlegroups.com
Without the UseEmbeddedHttpServer = true it works.
So now I have to understand why the process is denied listening to port 8080 on the server

Simone 

Mauro Servienti

unread,
Jun 25, 2012, 8:13:20 AM6/25/12
to rav...@googlegroups.com

The process is not running as admin so cannot reserve url acl, I suppose.

http://msdn.microsoft.com/en-us/library/ms733768(v=vs.90)

 

.m

Simone Chiaretta

unread,
Jun 25, 2012, 8:36:27 AM6/25/12
to rav...@googlegroups.com

Looks like using RavenDb as embedded and expose it over Http to see what's inside is more complicate than running it as service (or inside IIS).

I guess I'll change the deployement mode :)

Thx

Simone

Simone Chiaretta

unread,
Jun 26, 2012, 3:57:21 AM6/26/12
to rav...@googlegroups.com
Thx
Will try that
Simone

On Tuesday, June 26, 2012 12:20:16 AM UTC+2, Jonas Jämtberg wrote:
Run this command on your admin user:
netsh http add urlacl url=http://+:8080/ user=DOMAIN\user

Change DOMAIN\user to the app-pool user for your site and you should be fine.

Simone Chiaretta

unread,
Jun 27, 2012, 10:17:12 AM6/27/12
to rav...@googlegroups.com
Thanks,
now the site starts and eveything seems to work fine.
But I cannot access the studio via http://domain.com:8080/

also locally on the server using localhost:8080 doesn't work

Anything else I need to configure?

Thx
Simone

Oren Eini (Ayende Rahien)

unread,
Jun 27, 2012, 10:29:19 AM6/27/12
to rav...@googlegroups.com
I assume that you have set the permissions correctly and you have UseEmbeddedServer, right?

For remote, I would suspect the firewall blocking you.
For local, maybe you forgot UseEmbeddedServer ?

Simone Chiaretta

unread,
Jun 27, 2012, 10:45:26 AM6/27/12
to rav...@googlegroups.com
Yep, all set.
Before setting the permissions  netsh http add urlacl url=http://+:8080/ user=DOMAIN\user  I was getting an access denied.
Then I added the permissions, restarted the server and now I can save and read data.
And yes, it is: UseEmbeddedHttpServer = true

Actually the problem is not that it never works... sometimes it does, sometimes it doesn't

Simone

Oren Eini (Ayende Rahien)

unread,
Jun 27, 2012, 10:48:50 AM6/27/12
to rav...@googlegroups.com
Is the app part of IIS?
Is it possible that when it doesn't work, the app is down (compiled, iis shut down for inactivity, etc)

Simone Chiaretta

unread,
Jun 27, 2012, 10:52:39 AM6/27/12
to rav...@googlegroups.com
It's a normal app on IIS.
I was browsing the site and saving/loading data when I was trying to access the Studio... so I rule out that situation :)


On Wednesday, June 27, 2012 4:48:50 PM UTC+2, Oren Eini wrote:
Is the app part of IIS?
Is it possible that when it doesn't work, the app is down (compiled, iis shut down for inactivity, etc)

Simone Chiaretta

unread,
Jun 27, 2012, 11:09:09 AM6/27/12
to rav...@googlegroups.com
And, in addition, is there a way to protect the access of the Studio in the embedded mode?

Kijana Woodard

unread,
Jun 27, 2012, 11:28:23 AM6/27/12
to rav...@googlegroups.com

Long shot, what type is on the left side when you create your embedded server? I was getting funky results assigning to an IDocumentStore our DocumentStore. Assigning to EmbeddedDocumentStore cleared up my problems.

Purge things to try:
Make sure nothing else is on 8080. I've got raven for nsb and a regular server instance on 8080, so I made the embedded 8085.

Try pulling it up in ie, could be silverlight install.

Oren Eini (Ayende Rahien)

unread,
Jun 27, 2012, 3:32:41 PM6/27/12
to rav...@googlegroups.com
Same as standard server.
Reply all
Reply to author
Forward
0 new messages