Jumoo / Our.Umbraco.MaintenanceMode

Put Umbraco Into Maintenance Mode - While you do things
14 stars 8 forks source link

Not working unless running locally in VS #16

Closed huwred closed 2 years ago

huwred commented 3 years ago

In Umbraco 8.10.1 you only get the maintenance page when running in VS, when turning on maintenance mode on the webserver you just get 'The service is unavailable.'

So not very useful

huwred commented 3 years ago

In the RenderMVCController the code does the following if (Response != null) Response.StatusCode = (int)HttpStatusCode.ServiceUnavailable;

Which is what I assume is the reason for the error, any idea why? And what is the purpose of that check?

huwred commented 3 years ago

Ok, I believe this is happenining when CustomErrors are ON, any idea how to get around this?

huwred commented 3 years ago

just need to add the following custom error in web.config, so I don't think it is a code issue, happy for you to close this

PSinke commented 2 years ago

just need to add the following custom error in web.config, so I don't think it is a code issue, happy for you to close this

I'm now running into the same issue. 'The following custom error' seems to be missing from your post. Could you tell me what custom error it is?

KevinJump commented 2 years ago

hi it looks like (from the source of the comment) the fix was

<error statusCode="503"  redirect="/MaintenancePage" />

@huwred might be able to confirm.

PSinke commented 2 years ago

Thanks @KevinJump Unfortunately that still results the 'service is unavailable' notice for me. Even when turning off the custom errors. I'll keep trying other things. If I find out what caused it, I will update here.

huwred commented 2 years ago

Sorry for the delay, just realised thee were getting dumped in a spam folder. That is what I added to get it working, but it has stopped now for a completely different reason will take a look.

huwred commented 2 years ago

I sorted the error I was getting, so can confirm it is working for me. The settings I have are as I below. I have two error nodes, one in system.web and 1 in sytem.webservers, not sure if you need both but suspect you do because it is a 503 status.

system.web `

  <error statusCode="500" redirect="/Error500" />
  <error statusCode="503" redirect="/UnderMaintenance" />
</customErrors>`

system.webServer `

  <remove statusCode="404" />
  <remove statusCode="500" />
  <error statusCode="403" prefixLanguageFilePath="" path="/Forbidden" responseMode="ExecuteURL" />
  <error statusCode="404" prefixLanguageFilePath="" path="/error404" responseMode="ExecuteURL" />
  <error statusCode="500" prefixLanguageFilePath="" path="/error500" responseMode="ExecuteURL" />
  <error statusCode="503" prefixLanguageFilePath="" path="/UnderMaintenance" responseMode="ExecuteURL" />
</httpErrors>`
huwred commented 2 years ago

UnderMaintenance is my custom template based on the original