ApplicationRequestRouting can't connect to URL but the server's browser can - iis

I use ApplicationRequestRouting and UrlRewrite v7.1.1980 in IIS to create a reverse-proxy to our backend, but it returns 502.3 Bad Gateway:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>3</Level>
<Opcode>16</Opcode>
<Keywords>0x100</Keywords>
<TimeCreated SystemTime="2022-10-24T10:16:29.431Z"/>
<Correlation ActivityID="{80000011-0002-F900-B63F-84710C7967BB}"/>
<Execution ProcessID="6684" ThreadID="4080"/>
<Computer>Computer1</Computer>
</System>
<EventData>
<Data Name="ContextId">{80000011-0002-F900-B63F-84710C7967BB}</Data>
<Data Name="ModuleName">ApplicationRequestRouting</Data>
<Data Name="Notification">128</Data>
<Data Name="HttpStatus">502</Data>
<Data Name="HttpReason">Bad Gateway</Data>
<Data Name="HttpSubStatus">3</Data>
<Data Name="ErrorCode">2147954429</Data>
<Data Name="ConfigExceptionInfo"/>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>MODULE_SET_RESPONSE_ERROR_STATUS</Opcode>
<Keywords>
<Keyword>RequestNotifications</Keyword>
</Keywords>
<freb:Description Data="Notification">EXECUTE_REQUEST_HANDLER</freb:Description>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{002E91E3-E7AE-44AB-8E07-99230FFA6ADE}</EventGuid>
</ExtendedTracingInfo>
</Event>
However, when I log into the server with Remote Desktop and open our URL in the server's browser, it opens fine - so there is connectivity between our server and backend.
How can the browser "see" the URL but IIS claims it has no connection?

We found the issue. Inside of our ARR Cache config we had added a proxy server which had stopped responding. After removing the proxy server, it works again.

Related

Is there a way to reduce a dynamic links list on the same intent-filter on Android Manifest

So I'm using dynamic links in my app and I have made that one activity handles several dynamic links, but the list is getting long and literally is just the last parameter that changes, which are numbers. So is there a way to reduce the list or I will have to just keep on adding more?
<activity
android:name="com.example.app.main.HNSPS1"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<!--Drinks-CoffeeShops-->
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/1/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/2/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/3/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/4/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/5/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/6/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/7/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/8/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/9/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/10/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/11/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/12/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/13/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/14/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/15/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/16/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/17/" />
<data android:host="myapp.page.link" android:scheme="https" android:path="/DrinksCoffeeShops/18/" />
...
</intent-filter>
</activity>
This is my android manifest and as you can see is just the last parameter "/1/" that changes for all the links. I'm planning on adding till like 50.
I finally figure it out and I will post what I did If someone is having the same question as me.
So since all the dynamic links have the same path just different numbers at the end, what I did was use android:pathPrefix instead of android:path and that way all the incoming links with the prefix /DrinksCoffeeShops/ will open the same activity regarless of the suffix, in this case the numbers at the end /#/
At the end my manifest look this way:
<activity
android:name="com.example.app.main.HNSPS1"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<!--Drinks-CoffeeShops-->
<data android:host="myapp.page.link" android:scheme="https" android:pathPrefix="/DrinksCoffeeShops/" />
...
</intent-filter>
</activity>
As you guys can see my manifest is much smaller and using more dynamic links is more convinient. Hope this helps.

reverse proxy doesn't work with .svc url?

here's my attempt to do a reverse proxy using url rewrite in IIS from mysubdomaintarget.mytargetdomain.com to mysubdomainreal.myrealdomain.com
<configuration>
<system.webServer>
<tracing>
<traceFailedRequests>
<add path="*">
<traceAreas>
<add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
<add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,FastCGI,WebSocket,Rewrite,RequestRouting" verbosity="Verbose" />
</traceAreas>
<failureDefinitions statusCodes="400-999" />
</add>
</traceFailedRequests>
</tracing>
<rewrite>
<rules>
<rule name="ReverseProxyInboundRule1" stopProcessing="true">
<match url="(.*)" />
<action type="Rewrite" url="https://mysubdomainreal.myrealdomain.com/{R:1}" />
<serverVariables>
<set name="HTTP_X_ORIGINAL_ACCEPT_ENCODING" value="{HTTP_ACCEPT_ENCODING}" />
<set name="HTTP_ACCEPT_ENCODING" value="" />
</serverVariables>
</rule>
</rules>
<outboundRules>
<rule name="ReverseProxyOutboundRule1" preCondition="ResponseIsHtml1">
<match filterByTags="A, Form, Img" pattern="^http(s)?://mysubdomainreal.myrealdomain.com/(.*)" />
<action type="Rewrite" value="http{R:1}://mysubdomainreal.myrealdomain.com/{R:2}" />
</rule>
<rule name="RestoreAcceptEncoding" preCondition="NeedsRestoringAcceptEncoding">
<match serverVariable="HTTP_ACCEPT_ENCODING" pattern="^(.*)" />
<action type="Rewrite" value="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" />
</rule>
<preConditions>
<preCondition name="ResponseIsHtml1">
<add input="{RESPONSE_CONTENT_TYPE}" pattern="^text/html" />
</preCondition>
<preCondition name="NeedsRestoringAcceptEncoding">
<add input="{HTTP_X_ORIGINAL_ACCEPT_ENCODING}" pattern=".+" />
</preCondition>
</preConditions>
</outboundRules>
</rewrite>
</system.webServer>
</configuration>
If I call website using mysubdomaintarget.mytargetdomain.com/myApp it works (render the page/etc). But if I call mysubdomaintarget.mytargetdomain.com/myApp.svc I got an 404.
Why? Where am I wrong on this configuration?
EDIT
Here's the failedRequest tag's attribute:
<failedRequest url="http://mysubdomaintarget.mytargetdomain.com/myApp.svc"
siteId="6"
appPoolId="services"
processId="2192"
verb="GET"
remoteUserName=""
userName=""
tokenUserName="NT AUTHORITY\IUSR"
authenticationType="anonymous"
activityId="{8000002B-0000-9900-B63F-84710C7967BB}"
failureReason="STATUS_CODE"
statusCode="404"
triggerStatusCode="404"
timeTaken="141"
xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb"
>
EDIT2
Here's the last event I got from failed request tracking:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>2</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2021-05-11T09:26:41.979Z"/>
<Correlation ActivityID="{80000549-1000-FB00-B63F-84710C7967BB}"/>
<Execution ProcessID="2192" ThreadID="2264"/>
<Computer>MyPC</Computer>
</System>
<EventData>
<Data Name="ContextId">{80000549-1000-FB00-B63F-84710C7967BB}</Data>
<Data Name="BytesSent">2180</Data>
<Data Name="BytesReceived">993</Data>
<Data Name="HttpStatus">404</Data>
<Data Name="HttpSubStatus">0</Data>
</EventData>
<RenderingInfo Culture="en-US">
<Opcode>GENERAL_REQUEST_END</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
its not "talking" at all. Where do I see any error from this last Event?
EDIT3
xml opened by browser:
In order to allow WCF to use multiple domain you should set multipleSiteBindingsEnabled to true.
The following configuration should fix your issue.
<system.serviceModel>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
multipleSiteBindingsEnabled
A Boolean value that specifies whether multiple IIS bindings per site is enabled.
IIS consists of web sites, which are containers for virtual applications containing virtual directories. The application in a site can be accessed through one or more IIS binding. An IIS binding provides two pieces of information: a binding protocol and binding information. Binding protocol defines the scheme over which communication occurs, and binding information is the information used to access the site. An example of a binding protocol can be HTTP, whereas binding information can contain an IP address, Port, host header, etc.
IIS supports specifying multiple IIS bindings per site, which results in multiple base addresses per scheme. However, a Windows Communication Foundation (WCF) service hosted under a site allows binding to only one baseAddress per scheme.
To enable multiple IIS bindings per site for a Windows Communication Foundation (WCF) service, set this attribute to true. Notice that multiple site binding is supported only for the HTTP protocol. The address of endpoints in the configuration file needs to be a complete URI.

ASP.NET Core 3 and 500.30 In-Process Startup Failure

My service targets the following frameworks:
Microsoft.AspNetCore.App 3.0.0
Microsoft.NETCore.App 3.0.0
Everything runs fine locally. When I deploy to an App Service in Azure, I experience the following error:
500.30 In-Process Startup Failure
Reading the documentation tells me perhaps these frameworks are not on the machine hosting my service. However I checked what frameworks are installed on the machine by running dotnet --info on the App Service's console, giving me the following results:
.NET Core SDK (reflecting any global.json):
Version: 2.2.109
Commit: 586f23c400
Runtime Environment:
OS Name: Windows
OS Version: 10.0.14393
OS Platform: Windows
RID: win10-x86
Base Path: D:\Program Files (x86)\dotnet\sdk\2.2.109\
Host (useful for support):
Version: 3.0.0
Commit: 7d57652f33
.NET Core SDKs installed:
1.1.14 [D:\Program Files (x86)\dotnet\sdk]
2.1.509 [D:\Program Files (x86)\dotnet\sdk]
2.1.701 [D:\Program Files (x86)\dotnet\sdk]
2.2.108 [D:\Program Files (x86)\dotnet\sdk]
2.2.109 [D:\Program Files (x86)\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.12 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.6 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.2.7 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.12 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.6 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.2.7 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.0.0 [D:\Program Files (x86)\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 1.0.16 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 1.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.0.9 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.12 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.6 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.2.7 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.0.0 [D:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Clearly both my targeted frameworks exist on the machine.
Here is (partial) proof my files are deployed:
Here is my start up file (nothing unusual):
public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
}
public IConfiguration Configuration { get; }
public void ConfigureServices(IServiceCollection services)
{
services.AddCors();
services.AddControllers();
}
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
else
{
app.UseExceptionHandler("/Error");
app.UseHsts();
}
app.UseHttpsRedirection();
app.UseCors();
app.UseRouting();
app.UseEndpoints(endpoints => {
endpoints.MapControllers();
});
}
}
What am I doing wrong? Why am I getting this error?
Here are some event logs if they help:
<Events>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T10:18:07Z"/>
<EventRecordID>622276312</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=050F22D8 [TID 2092] [PID 5816]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="ZipFS"/>
<EventID>0</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T10:18:15Z"/>
<EventRecordID>622284390</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>Failed to open siteversion.txt. ZipFS setup failed. Error: 0x80070003</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T10:18:22Z"/>
<EventRecordID>622291296</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=0596E698 [TID 3800] [PID 5152]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="IIS AspNetCore Module V2"/>
<EventID>1018</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T10:20:13Z"/>
<EventRecordID>622401953</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.</Data>
<Data>Process Id: 5988.</Data>
<Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="IIS AspNetCore Module V2"/>
<EventID>1007</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T10:20:13Z"/>
<EventRecordID>622401968</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' failed to load clr and managed application. CLR worker thread exited prematurely</Data>
<Data>Process Id: 5988.</Data>
<Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T10:21:17Z"/>
<EventRecordID>622466890</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=04F7E110 [TID 6744] [PID 5988]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T10:21:19Z"/>
<EventRecordID>622467953</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=05CBC280 [TID 12796] [PID 12656]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="IIS AspNetCore Module V2"/>
<EventID>1018</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T10:21:42Z"/>
<EventRecordID>622491921</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.</Data>
<Data>Process Id: 2940.</Data>
<Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="IIS AspNetCore Module V2"/>
<EventID>1007</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T10:21:42Z"/>
<EventRecordID>622491937</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' failed to load clr and managed application. CLR worker thread exited prematurely</Data>
<Data>Process Id: 2940.</Data>
<Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T11:06:27Z"/>
<EventRecordID>625176281</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=055FA240 [TID 12556] [PID 7444]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T11:07:41Z"/>
<EventRecordID>625250078</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=059F8DE0 [TID 12108] [PID 2940]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="IIS AspNetCore Module V2"/>
<EventID>1018</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:27:39Z"/>
<EventRecordID>630047968</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.</Data>
<Data>Process Id: 13184.</Data>
<Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="IIS AspNetCore Module V2"/>
<EventID>1007</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:27:39Z"/>
<EventRecordID>630047968</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' failed to load clr and managed application. CLR worker thread exited prematurely</Data>
<Data>Process Id: 13184.</Data>
<Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:28:20Z"/>
<EventRecordID>630089140</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=05284660 [TID 7644] [PID 13184]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="IIS AspNetCore Module V2"/>
<EventID>1018</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:28:35Z"/>
<EventRecordID>630104687</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' hit unexpected managed exception, exception code = '0xe0434352'. Please check the stderr logs for more information.</Data>
<Data>Process Id: 5864.</Data>
<Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="IIS AspNetCore Module V2"/>
<EventID>1007</EventID>
<Level>1</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:28:35Z"/>
<EventRecordID>630104703</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>Application '/LM/W3SVC/1682960519/ROOT' with physical root 'D:\home\site\wwwroot\' failed to load clr and managed application. CLR worker thread exited prematurely</Data>
<Data>Process Id: 5864.</Data>
<Data>File Version: 12.2.18316.0. Description: IIS ASP.NET Core Module V2 Request Handler. Commit: ce8cf65589734f82b0536c543aba5bd60d0a5a98</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:37:24Z"/>
<EventRecordID>630633328</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=058C0638 [TID 12688] [PID 6308]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:37:24Z"/>
<EventRecordID>630633515</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=04F81128 [TID 12484] [PID 5864]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:41:31Z"/>
<EventRecordID>630880156</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=051807A0 [TID 12196] [PID 11416]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:41:31Z"/>
<EventRecordID>630880734</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=05841840 [TID 10740] [PID 2296]</Data>
</EventData>
</Event>
<Event>
<System>
<Provider Name="HttpPlatformHandler"/>
<EventID>2000</EventID>
<Level>4</Level>
<Task>0</Task>
<Keywords>Keywords</Keywords>
<TimeCreated SystemTime="2019-10-15T12:41:45Z"/>
<EventRecordID>630894312</EventRecordID>
<Channel>Application</Channel>
<Computer>RD281878C98595</Computer>
<Security/>
</System>
<EventData>
<Data>APPLICATION_MANAGER::~APPLICATION_MANAGER | this=05C64508 [TID 4484] [PID 7868]</Data>
</EventData>
</Event>
...more events here
</Events>
Running the app from Kudu cmd console usually outputs startup errors. Try dotnet MyApp.dll.
Source: https://learn.microsoft.com/en-us/aspnet/core/test/troubleshoot-azure-iis?view=aspnetcore-3.0#run-the-app-in-the-kudu-console
Turns out I was also referencing Microsoft.AspNet 2.2 NuGet package, which doesn't play well with ASP.NET Core 3.0. Removing that dependency resolved my issue.

IIS 8.5 Internal error 500.19

I have Basic Auth enabled for the specific folder and anonymous disabled. I also have created users, however I get a "The page cannot be displayed because an internal server error has occurred." message on the browser. Here is the log from the failed request tracing. I have been looking at this for hours but not been able to solve it.
The same error triggers when I access any non existing page, for example http://144.144.144.144/adas
<failedRequest url="http://144.144.144.144:80/adas"
siteId="1"
appPoolId="DefaultAppPool"
processId="824"
verb="GET"
remoteUserName=""
userName=""
tokenUserName="NT AUTHORITY\IUSR"
authenticationType="anonymous"
activityId="{80000068-0002-FF00-B63F-84710C7967BB}"
failureReason="STATUS_CODE"
statusCode="500.19"
triggerStatusCode="500.19"
timeTaken="0"
xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb"
>
the log for the basic auth:
<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type='text/xsl' href='freb.xsl'?>
<!-- saved from url=(0014)about:internet -->
<failedRequest url="http://144.144.144.144:80/admin/"
siteId="1"
appPoolId="DefaultAppPool"
processId="820"
verb="GET"
authenticationType="NOT_AVAILABLE" activityId="{8000000E-0002-FF00-B63F-84710C7967BB}"
failureReason="STATUS_CODE"
statusCode="500.19"
triggerStatusCode="500.19"
timeTaken="0"
xmlns:freb="http://schemas.microsoft.com/win/2006/06/iis/freb"
>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>1</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2016-09-29T15:24:04.662Z"/>
<Correlation ActivityID="{8000000E-0002-FF00-B63F-84710C7967BB}"/>
<Execution ProcessID="820" ThreadID="3756"/>
<Computer>OWNEROR-9DTV6I9</Computer>
</System>
<EventData>
<Data Name="ContextId">{8000000E-0002-FF00-B63F-84710C7967BB}</Data>
<Data Name="SiteId">1</Data>
<Data Name="AppPoolId">DefaultAppPool</Data>
<Data Name="ConnId">1610612749</Data>
<Data Name="RawConnId">0</Data>
<Data Name="RequestURL">http://144.144.144.144:80/admin/</Data>
<Data Name="RequestVerb">GET</Data>
</EventData>
<RenderingInfo Culture="el-GR">
<Opcode>GENERAL_REQUEST_START</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>33</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2016-09-29T15:24:04.662Z"/>
<Correlation ActivityID="{8000000E-0002-FF00-B63F-84710C7967BB}"/>
<Execution ProcessID="820" ThreadID="3756"/>
<Computer>OWNEROR-9DTV6I9</Computer>
</System>
<EventData>
<Data Name="ContextId">{8000000E-0002-FF00-B63F-84710C7967BB}</Data>
<Data Name="HttpStatus">500</Data>
<Data Name="HttpSubStatus">19</Data>
<Data Name="FileNameOrURL"></Data>
</EventData>
<RenderingInfo Culture="el-GR">
<Opcode>GENERAL_SEND_CUSTOM_ERROR</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="WWW Server" Guid="{3A2A4E84-4C21-4981-AE10-3FDA0D9B0F83}"/>
<EventID>0</EventID>
<Version>1</Version>
<Level>0</Level>
<Opcode>2</Opcode>
<Keywords>0x0</Keywords>
<TimeCreated SystemTime="2016-09-29T15:24:04.662Z"/>
<Correlation ActivityID="{8000000E-0002-FF00-B63F-84710C7967BB}"/>
<Execution ProcessID="820" ThreadID="3756"/>
<Computer>OWNEROR-9DTV6I9</Computer>
</System>
<EventData>
<Data Name="ContextId">{8000000E-0002-FF00-B63F-84710C7967BB}</Data>
<Data Name="BytesSent">222</Data>
<Data Name="BytesReceived">466</Data>
<Data Name="HttpStatus">500</Data>
<Data Name="HttpSubStatus">19</Data>
</EventData>
<RenderingInfo Culture="el-GR">
<Opcode>GENERAL_REQUEST_END</Opcode>
</RenderingInfo>
<ExtendedTracingInfo xmlns="http://schemas.microsoft.com/win/2004/08/events/trace">
<EventGuid>{D42CF7EF-DE92-473E-8B6C-621EA663113A}</EventGuid>
</ExtendedTracingInfo>
</Event>
</failedRequest>
The server specs are: 64bit Windows 2012 R2 with IIS 8.5. Does someone know what is going on ? Thank you in advance.
it seems the following lines in web.config caused the trouble. still don't know why.
<httpErrors errorMode="DetailedLocalOnly">
<remove statusCode="404" subStatusCode="-1" />
<error statusCode="404" prefixLanguageFilePath="" path="C:\inetpub\wwwroot\notfound.htm" responseMode="File" />
</httpErrors>
I resolved the problem by deleting those four lines.
The error message itself should be "Absolute physical path ... is not allowed in system.webServer/httpErrors section in web.config file. Use relative path instead."
And that clearly tells both the cause and the solution. That value set to path must be a relative path.
You can check the reference below for example,
https://www.iis.net/configreference/system.webserver/httperrors/error
I ran into this issue myself and found that a "bad character" had crept into my file. My 500.19 error was telling me that the XML header itself, <?xml version="1.0" encoding="UTF-8" ?>, was causing the web.config to be "malformed XML".
Deleting the line in notepad and resaving fixed the issue, but why would the XML header cause a malformed XML error!? So I went back to Stash's Web UI to view the file to see if it had changed in source.
That was where I noted a red dot as the first character of the file, on the same line as the XML header. The red dot is usually a 'bad character', someone used an editor that allowed a character from outside the file's encoding or maybe a corrupted save. But what you end up with is an invisible character that breaks IIS when it goes to read your config!
SO, be careful not to throw the baby out with the bath water! It might not be what you SEE that's wrong.
In windows, a quick fix for bad characters is to use clipboard's "dumbness" (strictness) and do a Ctrl-A, Ctrl-C, delete the file, create an empty file with the same name, and Ctrl-V. Notepad works nicely with this as it won't try to "help" with additional interpretation when you paste back. This will effectively and quickly remove any "invisible" characters that Windows doesn't recognize, since the clipboard simply won't copy them!
Though untested, mismatched encoding values in the XML headers among your other .config files (machine.config, app.configs, etc.) might lead to this kind of an issue, too. It has been noted that IIS won't respect different encodings as it reads all the .configs together. Currently it defaults to UTF-8 (ASP NET 4), so if you change your XML encoding in your web.config for some reason, make sure your machine.config matches. I feel I should call out here that changing your encoding away from the default is risky, so don't do it if you can help it!

NLog 4.0 unable to connect to SQL Server named instance to log to database table

I am using NLog to log errors from a Winform .NET application to a file and database table. The database table is hosted on SQL Server 2014.
The NLog config file is show below. Logs are successfully written to the file.
I can successfully log to a database table with the exact same config file if SQL Server is installed as a default instance.
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" internalLogFile="Nlog.log">
<targets>
<target name="file" xsi:type="File" layout="${longdate}|${level}|${callsite}|${logger}|${threadid}|${windows-identity:domain=false}--${message} ${exception:format=message,stacktrace:separator=*" fileName="My.Application.log" />
<target name="database" type="Database">
<connectionString>Data Source=ABC\DEV01;Initial Catalog=my_database;User Id=user01;Password=Password01;Application Name=My Application;Failover Partner=XYZ\DEV01</connectionString>
<commandText>
INSERT INTO tb_system_logging(log_date,log_level,log_logger,log_message,log_machine_name, log_user_name, log_call_site, log_thread, log_exception, log_stacktrace) VALUES(#time_stamp, #level, #logger, #message, #machinename, #user_name, #call_site, #threadid,
#log_exception, #stacktrace);
</commandText>
<parameter name="#time_stamp" layout="${longdate}" />
<parameter name="#level" layout="${level}" />
<parameter name="#logger" layout="${logger}" />
<parameter name="#message" layout="${message}" />
<parameter name="#machinename" layout="${machinename}" />
<parameter name="#user_name" layout="${windows-identity:domain=true}" />
<parameter name="#call_site" layout="${callsite:filename=true}" />
<parameter name="#threadid" layout="${threadid}" />
<parameter name="#log_exception" layout="${exception}" />
<parameter name="#stacktrace" layout="${stacktrace}" />
</target>
</targets>
<rules>
<logger name="*" minlevel="Info" writeTo="file" />
<logger name="*" minlevel="Info" appendTo="database" />
</rules>
</nlog>
I see the following error logged to the internal log file NLog.Log when I run the application on my development server that also host the SQL Server instance.
2015-08-25 23:41:27.0999 Error Error when writing to database System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server) ---> System.ComponentModel.Win32Exception (0x80004005): The network path was not found
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
I have checked that SQL Server allows remote connections and TCP/IP and named pipe protocols are enabled on the server.
Any help greatly appreciated.
Regards
James
This seems to be an issue with your connectionstring. Maybe this is helpful: how to solve the system.data.sqlclient.sqlexception (0x80131904) error

Resources