Microsoft -LightSwitch – Error – “Request Failed with Status Code ‘500’ and Status Text ‘Internal Status Error.'”

Background

From within Visual Studio, launched an application that I am developing using LightSwitch and received one of those hard to decipher error.

Error Message

Image

requestfailedwithstatuscode500

Text

Request failed with status code ‘500’ and status text ‘Internal Server Error’.

TroubleShooting

As I know so little about LightSwitch, I get petrified anytime I see an error.

Event Viewer

Took to the system’s event viewer and found the obvious problem.

Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult – System.ServiceModel.ServiceActivationException

Image

taskcategory_webhost_2017021_0445pm-cropped-up

Textual

WebHost failed to process a request.
Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/35567111
Exception: System.ServiceModel.ServiceActivationException: The service ‘/DBDiagData.svc’ cannot be activated due to an exception during compilation. The exception message is: Memory gates checking failed because the free memory (196927488 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.. —> System.InsufficientMemoryException: Memory gates checking failed because the free memory (196927488 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
— End of inner exception stack trace —
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End(IAsyncResult result)
Process Name: iisexpress
Process ID: 2756

Tabulate

Product Version File Version
 Log Name Application
 Source System.ServiceModel 4.0.0.0
 Event ID  3
 Task Category  WebHost
 Level  Error
 Process Name  iisexpress

 

 

ASP.NET 4.0.30319.0 –  InsufficientMemoryException

Image

taskcategory_aspnet_2017021_0616pm-croppedup

Textual

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 2/21/2017 4:15:03 PM
Event time (UTC): 2/22/2017 12:15:03 AM
Event ID: a9e5abe2978940499d84b3ed7b2bc5a1
Event sequence: 34
Event occurrence: 1
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/2/ROOT-1-131321960967478001
Trust level: Full
Application Virtual Path: /
Application Path: C:\EDiag\bin\Debug\
Machine name: DADENIJI

Process information:
Process ID: 2756
Process name: iisexpress.exe
Account name: dadeniji

Exception information:
Exception type: InsufficientMemoryException
Exception message: Memory gates checking failed because the free memory (179412992 bytes) is less than 5% of total memory. As a result, the service will not be available for incoming requests. To resolve this, either reduce the load on the machine or adjust the value of minFreeMemoryPercentageToActivateService on the serviceHostingEnvironment config element.
at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

Request information:
Request URL: http://localhost:62496/Services/Microsoft-LightSwitch-Security-ServerGenerated-Implementation-AuthenticationService.svc/binary/GetAuthenticationInfo
Request path: /Services/Microsoft-LightSwitch-Security-ServerGenerated-Implementation-AuthenticationService.svc/binary/GetAuthenticationInfo
User host address: 127.0.0.1
User: dadeniji
Is authenticated: True
Authentication Type: Negotiate
Thread account name: dadeniji

Thread information:
Thread ID: 11
Thread account name: dadeniji
Is impersonating: False
Stack trace: at System.ServiceModel.Activation.ServiceMemoryGates.Check(Int32 minFreeMemoryPercentage, Boolean throwOnLowMemory, UInt64& availableMemoryBytes)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CheckMemoryCloseIdleServices(EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)

 

Tabulate

Product Version File Version
 Log Name Application
 Source ASP.NET 4.0.30319.0
 Event ID  1309
 Task Category  Web Event
 Level  Warning
 Process Name  iisexpress.exe

 

 

Remediation

Using Microsoft’s Task Manager close some of the Applications and Processes that are sagging memory.

Our target is to get more than 5% memory available.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s