I'm trying to move my website to another host, a shared hosting, and I keep getting this message:
Detailed Error Information: Module
AspNetInitializationExceptionModule Notification BeginRequest
Handler ExtensionlessUrlHandler-Integrated-4.0 Error Code
0x00000000 Requested URL http://1.3144.co.il:80/ Physical Path
h:\root\home\picsize-001\www\3144clubmember Logon Method Not yet
determined Logon User Not yet determined
I've tried many things but nothing seems to work for me.
It looks like either your host doesn't support .net 4.5 or you don't have it enabled.
Things to check in your hosts control panel:
You have enabled .net 4.5
It's running in integrated mode and not classic pipeline
Related
I am working on a .NET API that runs inside of a docker container. At some point it makes a call to a Python Flask API that is also running in a container.
var response = await httpClient.GetAsync("http://service-name:8000/actual/url")
which then produces the following error:
System.Net.Http.HttpRequestException: Resource temporarily unavailable
---> System.Net.Sockets.SocketException (11): Resource temporarily unavailable
at System.Net.Http.ConnectHelper.ConnectAsync(String host, Int32 port, CancellationToken
cancellationToken)
Has anyone had experience with this before and potentially knows a solution? I cant find much on the web about it at all. I have some seen some mentions of the issue potentially being related to the Flask API not using async methods but that doesnt make sense to me.
The Flask API produces the appropriate responses when accessed through a web browser or Postman using localhost:8000/actual/url and the container logs these responses. I have tried using the localhost URL in the .NET API but that does not work either.
If anymore information is needed please leave a comment and I will do my best to update the post quickly.
-- Christie
TLDR
A reason for the "Resource temporarily unavailable" error is when during name resolution the DNS Server responds with RCODE 2 (Server failure).
Long answer
I noticed the same behavior in a dotnet application running in a dotnet runtime alpine docker container. Here are the results of my investigation:
The error message "Resource temporarily unavailable" corresponds to the EAGAIN error code which gets returned by various functions from the C standard library. At first I suspected the connect() function because the C# stack trace indicates the error happening during the ConnectAsync() call of the c# socket. And indeed the EAGAIN error code appears in the man page of connect() with this description: "No more free local ports or insufficient entries in the routing cache".
I simulated a system with depleted local ports and noticed that a different exception gets thrown in that case, which rules out local port availability as a root cause for the original exception. Regarding the other mentioned cause in the man page it turns out that the routing cache was removed from Linux in 2012. commit
I started to look around for EAGAIN in the source of the musl C lib which is used in the dotnet runtime alpine docker container. After a while I finally noticed the gethostbyname2_r function which is used for resolving a domain name to an ip address via DNS. During System.Net.Sockets.Socket.ConnectAsync() the hostname is still a string and the name resolving happens in native code using the gethostbyname2_r function (or one of its variations).
The final question is: When does gethostbyname2_r return the EAGAIN error code? It's when the RCODE field in the header of the DNS Response has the value 2, which stands for "Server failure". source line 166
To verify this result I ran a simple mock DNS server which always returns the RCODE 2 in the DNS response. The resulting c# exception along with the stack trace matched the original exception exactly.
I am seeing a number of these errors in the logs for a .NET Core 2.2.x web app:
Connection ID ""13546832108852449106"", Request ID ""80018f57-0407-bc00-b63f-84710c7967bb"": An unhandled exception was thrown by the application.
System.ObjectDisposedException: The CancellationTokenSource has been disposed.
at System.Threading.CancellationTokenSource.ThrowObjectDisposedException()
at Microsoft.AspNetCore.Server.IIS.Core.IISHttpContext.<>c__DisplayClass314_0.<AbortIO>b__0(Object t)
As you can see, the error occurs in the .net core framework rather than my code.
I looked up the specific Request Id mentioned in the error and it seems to have processed just fine. The error appears in the log about a second after the request has processed and returned data. I also checked the Event Viewer and there wasn't anything suspicious around the time frame of the error.
How can I troubleshoot this issue?
The Windows 2016 server has .NET Core 2.2.6 runtime installed.
Our Linux Docker ASP.NET Core container server logs are getting filled by the following 'Informational' log entries since we've updated from .NET Core 2.0 to .NET Core 2.1 (SDK 2.1.302):
INFO|Microsoft.AspNetCore.Server.Kestrel|Connection id "0HLFG42JUAORG" bad request
data: "Invalid request line:
'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1B\x00\x00\x00M\x0A'"
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid
request line: 'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1B\x00\x00\x00M\x0A'
INFO|Microsoft.AspNetCore.Server.Kestrel|Connection id "0HLFG42JUAORH" bad request
data: "Invalid request line:
'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1B\x00\x00\x00M\x0A'"
Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Invalid
request line: 'CNXN\x00\x00\x00\x01\x00\x00\x04\x00\x1B\x00\x00\x00M\x0A'
The connection ID is incrementing by 1 alpha/digit every second or so. The hex doesn't seem translate to anything meaningful (NUL NUL NUL SOH NUL NUL EOT NUL ESC NUL NUL LF).
Things we've ruled out:
It's not originating from WAN/LAN (disabled network access to the
containers and the entries are still being generated).
It doesn't occur in our development environment (windows w/ Visual Studio)
Redeploying the docker container doesn't fix the issue.
We don't believe it to be an SSL issue since kestrel is configured for http only. We can access the app and it's websockets (SignalR) over https and wss
It looks like you're hitting an HTTP endpoint over HTTPS.
Turns out it was an issue with the docker host (debian) and hanging sockets (netstat showing a lot of TIME_WAITs). Changed the app port to a different one and the malformed requests stopped.
A reboot or restart of the docker daemon would probably also fix it, but the uptime of our other containers is vital so we weren't able to test that.
I had same problem and in my case solution was in nginx configuration - I had proxy_pass set to https://localhost:4000 instead of http://localhost:4000
I'm creating a shopify app using ASP.NET MVC, I made some code changes.
When I tried to run the application, I got the following error message
Error: The remote server returned an error: (502) Bad Gateway.
I always make backups for my application, because I got the error message, I decided to replace it with my backup file. But the same error still occurs.
I am a beginner both in the shopify app as well as C#. Can anyone explain why this happened and how to solve it?
You are trying to access an invalid connectionString shopUrl. Check this
İt is a proxy problem. Change current proxy to default proxy :
httpRequest.Proxy = GlobalProxySelection.GetEmptyWebProxy();
A customer using a ASP.NET program I have just sent them is experiencing the error below, I had personally tested the program on 4 web server IIS6, 7, and 7.5, on 4 different networks and I never got this, the customer is using IIS6 with .Net 2.0 (as required). The program uses Windows authentication which may or may not be part of the problem. I'm stuck I don't know where to start with this. Any help is very much appreciated.
Sys.WebForms.PageRequestManagerServerErrorException:
An unknown error occurred while
processing the request on the server.
The status code returned from the
server was: 500
HTTP error code 500 simply means "something bad happened on the server, but we're not going to tell you what that was".
You have to "ask" the server machine what went wrong. Look into the Windows event logs, the IIS logs, or your application's own logs to find out what the "something" is.
This error often means that there is some exception thrown inside your code, e.g. because a reference is null or something else.
If you have < > / characters in your web form you will get this error.
Try placing ValidateRequest="false" in the page directive of your page.
If you have < > / characters in your web form you will get this error.
You must insert space or single quotation mark, right and left
for example :
false: 1<TR<5
True:1< TR <5 or 1<'TR'<5