opserver / Opserver

Stack Exchange's Monitoring System
https://opserver.github.io/Opserver/
MIT License
4.51k stars 827 forks source link

Help getting Opserver deployed #263

Open HBollah opened 7 years ago

HBollah commented 7 years ago

I must be a bit of a thicko here and not that familiar with VS. I have downloaded the code, opened the solution in VS, made changes to the security and added some SQL servers.

If I run this in debug mode, it all opens up fine and can browse the servers, databases etc.. But when I go to deploy to IIS (on my laptop for testing deployment) it seems half the files are missing and the site doesn't load. No problem, I'll just rebuild the solution and copy to the IIS folder, but when I browse the localhost url , I'm getting a http 500 error and nothing on the page to help identify what the issue is, even though the detailed information is on.

Any pointers would be greatly appreciated.

Thanks.

HBollah commented 7 years ago

Well, not sure what the issue with IIS is on my laptop, but copied the files to a server and it is working fine there, so please feel free to close this non issue :-)

itssimple commented 7 years ago

You could always check the Event Viewer for warnings/errors from ASP.NET. :)

mqbk commented 7 years ago

I know this is an old post, but I have the same issue deploying the application to a localhost. Any ideas would be greatly appreciated.

marcosfreccia commented 6 years ago

I am running into the same problem. I am not an expert, but with IIS Express, I can get it running, but when deploying to IIS, I get HTTP 500.

Anyone would be able to give me some hints on where to check?

HBollah commented 6 years ago

The difference I found was when you have the files added into Visual Studio you need to complete a build of the project, then deploy the files to the server.

marcosfreccia commented 6 years ago

So.. I have deployed the website and still can't get it wrong.. I might be missing something really simple.

image

This is what looks like in the Server image

And under config I have included the config files.

image

and this what I have in the advanced settings. image

ghost commented 5 years ago

Having the same issue here. Looks like I will have to give up on OpServer. After deployment all I get its Error 500. :-( Did you ever get it working Marcos?

zacatkogan commented 5 years ago

If you folks turn on friendly Error Messages, what do you get?

Add these tags in the appropriate places to your web.config:

<configuration>
    <system.webServer>
        <httpErrors errorMode="Detailed" />
    </system.webServer>
    <system.web>
        <customErrors mode="Off" />
        <compilation debug="true" />
    </system.web>
</configuration>
ghost commented 5 years ago

I made that change and refreshed and this is what I get now.

image

I am taking a look at the following article now to see if that might help.

https://docs.microsoft.com/en-us/iis/get-started/planning-for-security/how-to-use-locking-in-iis-configuration

ghost commented 5 years ago

I found that I did not have Windows Authentication installed in IIS. One that was installed I now get the following:

[ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.] System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) +0 System.Reflection.Assembly.GetTypes() +112 System.Linq.d__172.MoveNext() +262 System.Linq.WhereEnumerableIterator1.MoveNext() +245 StackExchange.Opserver.Models.TopTabs.ReloadTabs() +545 StackExchange.Opserver.Models.TopTabs..cctor() +15

[TypeInitializationException: The type initializer for 'StackExchange.Opserver.Models.TopTabs' threw an exception.] StackExchange.Opserver.Models.TopTabs.SetCurrent(Type type) +0 StackExchange.Opserver.Controllers.StatusController.OnActionExecuting(ActionExecutingContext filterContext) +126 System.Web.Mvc.Async.AsyncInvocationWithFilters.InvokeActionMethodFilterAsynchronouslyRecursive(Int32 filterIndex) +249 System.Web.Mvc.Async.<>cDisplayClass7_0.b0(AsyncCallback asyncCallback, Object asyncState) +100 System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +163 System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeActionMethodWithFilters(ControllerContext controllerContext, IList1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters, AsyncCallback callback, Object state) +303 System.Web.Mvc.Async.<>cDisplayClass3_1.b0(AsyncCallback asyncCallback, Object asyncState) +1082 System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +163 System.Web.Mvc.Async.AsyncControllerActionInvoker.BeginInvokeAction(ControllerContext controllerContext, String actionName, AsyncCallback callback, Object state) +463 System.Web.Mvc.<>c.<BeginExecuteCore>b__152_0(AsyncCallback asyncCallback, Object asyncState, ExecuteCoreState innerState) +45 System.Web.Mvc.Async.WrappedAsyncVoid1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +73 System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +163 System.Web.Mvc.Controller.BeginExecuteCore(AsyncCallback callback, Object state) +789 System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +163 System.Web.Mvc.Controller.BeginExecute(RequestContext requestContext, AsyncCallback callback, Object state) +633 System.Web.Mvc.<>c.b__20_0(AsyncCallback asyncCallback, Object asyncState, ProcessRequestState innerState) +99 System.Web.Mvc.Async.WrappedAsyncVoid1.CallBeginDelegate(AsyncCallback callback, Object callbackState) +73 System.Web.Mvc.Async.WrappedAsyncResultBase1.Begin(AsyncCallback callback, Object state, Int32 timeout) +163 System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state) +524 System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +1122 System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +213 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +131

zacatkogan commented 5 years ago

Fittingly, this SO post has some suggestions as to what the problem may be, and how to fix it. Aside from that, you could put some Exception Handling code around the GetTypes call, which is where the exception is occurring.

MHotton commented 5 years ago

I finally got it working after experiencing the HTML 500 error for few hours.

Make sure you have on ISS (Add Features):

If you can get the deployment working within Visual studios on IIS express then it's most likely to do ASP compiling issues (with production IIS).