Error after upgrade to 4.1 - "Request is not available

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
richtebb
Posts: 18
Joined: Thu Jun 01, 2006 5:53 am

Error after upgrade to 4.1 - "Request is not available

Post by richtebb » Sun Feb 24, 2008 10:20 am

I upgraded to the 4.1 server and now I get the following error when accessing the Web site (I haven't tried to access via the client):

Code: Select all

[HttpException (0x80004005): Request is not available in this context]
   System.Web.HttpContext.get_Request() +3465845
   VaultService.Global.Application_Start(Object sender, EventArgs e) +428

[HttpException (0x80004005): Request is not available in this context]
   System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +3384766
   System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +125
   System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +182
   System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +259
   System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +245

[HttpException (0x80004005): Request is not available in this context]
   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +3465427
   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +69
   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +675
The upgrade seemed to go fine, but when the licence page was launched it displayed an error message. I changed customErrors to Off in Web.config and the above message was displayed.

Server is W2K8 RC1 with IIS7. It ran Vault 4.0.6 fine. Any suggestions?

richtebb
Posts: 18
Joined: Thu Jun 01, 2006 5:53 am

Post by richtebb » Sun Feb 24, 2008 10:59 am

OK, I've resolved the problem myself, so I thought I'd post in case anyone else sees it. Also, you might want to review the installer in case it's causing the problem (see below).

IIS7 has a new "Integrated Pipeline" which significantly changes the way that Web requests are handled. Specifically, the Application_Start event is fired earlier in the pipeline, before the Request and Response objects have been created. By default, new Application Pools are created in Integrated mode. The error call stack above implies that the HttpContext.Request property is used during Vault's Application_Start method.

The fix is to change the Vault application pool to Classic mode, which works like IIS6. In Classic mode, Vault works just fine. You can change the app pool pipeline settings in IIS Manager, under Basic settings.

I don't understand how 4.0.6 was working fine - I don't remember having to change this setting when I installed Vault on my new server last month. Maybe this got broken because I uninstalled 4.0.6 first before installing 4.1 (as recommended in another SG post). I guess this deleted the app pool, so when it was recreated in the 4.1 install it used the default (Integrated) app pool settings. Or maybe there was a code change in 4.1 that added some code to Application_Start that wasn't in 4.0.6?

Anyway, I suggest that the Vault Server installer needs to be reviewed to ensure that the Vault app pool is always configured in Classic mode, to avoid seeing this problem.

Post Reply