question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

IpRateLimitMiddleware can't parse caller IP

See original GitHub issue

Getting this somewhat frequently in production on an Azure Web App. Not able to reproduce since my home IP parses correctly. Any ideas?

Exception: IpRateLimitMiddleware can't parse caller IP
Type: System.Exception

Stack Trace

System.Exception: IpRateLimitMiddleware can't parse caller IP ---> System.FormatException: An invalid IP address was specified. ---> System.Net.Sockets.SocketException: An invalid argument was supplied
   --- End of inner exception stack trace ---
   at System.Net.IPAddress.InternalParse(String ipString, Boolean tryParse)
   at AspNetCoreRateLimit.ReversProxyIpParser.GetClientIp(HttpContext context)
   at AspNetCoreRateLimit.IpRateLimitMiddleware.SetIdentity(HttpContext httpContext)
   --- End of inner exception stack trace ---
   at AspNetCoreRateLimit.IpRateLimitMiddleware.SetIdentity(HttpContext httpContext)
   at AspNetCoreRateLimit.IpRateLimitMiddleware.d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Server.IISIntegration.IISMiddleware.d__8.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.AspNetCore.Hosting.Internal.RequestServicesContainerMiddleware.d__3.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Frame`1.d__2.MoveNext()

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
stefanprodancommented, Aug 31, 2017

@carlos-anaya your use case is different. Please get v2.1.0 from NuGet and tell me if it’s ok now.

Thanks

1reaction
stefanprodancommented, Dec 11, 2016

I’ve published v1.0.5 on NuGet with a fix for this issue. Please let me know if it works for you.

Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# Client can't parse an ip addres
I am wondering how to correctly parse the IP address typed in to RecieveIP.Text so it will read correctly? Thanks. try { InitializeComponent(); ......
Read more >
Exploring Communication of Rate Limits in ASP.NET Core ...
This post explores rate limit headers proposed in current Internet-Draft and how those can be served and consumed in .NET.
Read more >
Untitled
ClientRateLimitMiddleware [0] Request get:/api/values from ClientId client-id-1 has been blocked, quota 2/1m exceeded by 3. Blocked by rule *:/api/value, ...
Read more >
IPAddress.Parse Method (System.Net)
A string that contains an IP address in dotted-quad notation for IPv4 and in colon-hexadecimal notation for IPv6. Returns. IPAddress. An IPAddress instance....
Read more >
Parsing IP addresses crazily fast
Parsing IP addresses crazily fast. Most of us are familiar with IP addresses: they are strings typically of the form “ddd.ddd.ddd.ddd” where ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found