HttpListenerException (0x5): Access is denied (Support #148)


Added by Gert-Jan Naaktgeboren almost 3 years ago. Updated almost 3 years ago.


Status:Assigned Start date:07/30/2014
Priority:Normal Due date:
Assignee:Daniel Nauck % Done:

0%

Category:-
Target version:-

Description

Hi,

I've downloaded the license manager from github (https://github.com/dnauck/License.Manager) opened the solution in VS2013 and was able to build it.
Next I deployed it to our webserver (Windows 2008 R2, IIS7).

When I now go to the site I get the error HttpListenerException (0x5): Access is denied.

[HttpListenerException (0x5): Access is denied]
System.Net.HttpListener.AddAllPrefixes() +335
System.Net.HttpListener.Start() +680
Raven.Database.Server.HttpServer.StartListening() +1058
Raven.Client.Embedded.EmbeddableDocumentStore.InitializeInternal() +1250
Raven.Client.Document.DocumentStore.Initialize() +1055
License.Manager.Core.AppHost.ConfigureRavenDb(Container container) +144
License.Manager.Core.AppHost.Configure(Container container) +850
ServiceStack.WebHost.Endpoints.AppHostBase.Init() +304
License.Manager.Global.Application_Start(Object sender, EventArgs e) +87

[HttpException (0x80004005): Access is denied]
System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +12951237
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +175
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +304
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +404
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +475

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

What am I doing wrong.


History

Updated by Gert-Jan Naaktgeboren almost 3 years ago

I've found the solution.

The code in AppHost.cs method ConfigureRavenDb, i've changed the UseEmbeddedHttpServer from true to false.
Is that the way to go?

public void ConfigureRavenDb(Container container)
       {
//NonAdminHttp.EnsureCanListenToWhenInNonAdminContext(8080);
var documentStore =
new Raven.Client.Embedded.EmbeddableDocumentStore() {
UseEmbeddedHttpServer = false
}
.Initialize();
IndexCreation.CreateIndexes(GetType().Assembly, documentStore);
container.Register(documentStore);
container.Register(c => c.Resolve<IDocumentStore>().OpenSession())
.ReusedWithin(ReuseScope.Request);
}

Updated by Daniel Nauck almost 3 years ago

Hi,

yes RavenDb wants to open a port for its internal HTTP WebInterface .. that needs admin rights. Its not needed for the license manager at all.

  • Status changed from New to Assigned
  • Assignee set to Daniel Nauck

Also available in: Atom PDF