Comments (4)
Hi and thanks for your time.
I have found the cause. All HTTP requests are going through the company proxy server.
Even localhost or 127.0.0.1 requests. Obviously, the proxy is unable to DNS resolve localhost or 127.0.0.1, hence the error message I had.
To solve this, I set the environment variable NO_PROXY=localhost,127.0.0.1.
The fact that the behaviour changed between Core 2.x and Core 3.x led me to many investigation directions except thinking of proxy !
Note that CURL command line tool has the same behaviour as Core 3.x.
Thanks again for your time and you can close the issue which is not.
Stephane
from consuldotnet.
Hi,
Can you share a minimal MCVE please?
from consuldotnet.
The program below hangs at "put" command until a timeout :
System.AggregateException: 'One or more errors occurred. (Unexpected response, status code ServiceUnavailable: <HTML><HEAD>
<TITLE>Network Error</TITLE>
</HEAD>
<BODY>
<FONT face="Helvetica">
<big><strong></strong></big><BR>
</FONT>
<blockquote>
<TABLE border=0 cellPadding=1 width="80%">
<TR><TD>
<FONT face="Helvetica">
<big>Network Error (tcp_error)</big>
<BR>
<BR>
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
A communication error occurred: "Operation timed out"
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica">
The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time.
</FONT>
</TD></TR>
<TR><TD>
<FONT face="Helvetica" SIZE=2>
<BR>
For assistance, contact your network support team.
</FONT>
</TD></TR>
</TABLE>
</blockquote>
</FONT>
</BODY></HTML>
)'
class Program
{
public static async Task<string> HelloConsul()
{
using (var client = new ConsulClient())
{
var putPair = new KVPair("hello")
{
Value = Encoding.UTF8.GetBytes("Hello Consul")
};
var putAttempt = await client.KV.Put(putPair);
if (putAttempt.Response)
{
var getPair = await client.KV.Get("hello");
return Encoding.UTF8.GetString(getPair.Response.Value, 0,
getPair.Response.Value.Length);
}
return "";
}
}
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
Console.WriteLine(HelloConsul().Result);
}
}
The problem occurs only on my professional laptop. It does not on my private one.
It tried to remove all .NET SDK and runtime and reinstall the minimum via Visual Studio installers. But it does not fix. Since it works with .NET 2.1, I exclude security software that might have blocked the connection.
I know that Consul.Net is not the cause. It is between my laptop configuration and some .NET Core 3.1 specifics, but what ?
from consuldotnet.
Hi @ssenart, thanks for your report.
In our CI pipeline, we do run all the unit tests on .NET Framework 4.6.1, .NET Core 2.0, and .NET Core 3.1 on Windows. We also run them on .NET Core 3.1 on Linux and macOS.
I tested your program with .NET Core 3.1 on Windows and it worked fine.
Could you please help clarify a few things?
- The program in your previous comment is a console application, not an ASP.NET application, right?
- When you run the same program on the same machine but with .NET Core 2.1, does it work? Or does it work with .NET 2.1 on a different machine?
- When you run the same program on a different machine with .NET Core 3.1, does it work?
- Are you running a Consul agent on the same machine where the program is running? If so, can you access it with
curl http://127.0.0.1:8500/v1/status/leader
from a PowerShell prompt?
from consuldotnet.
Related Issues (20)
- [CI Bug]: Consul.Test.TokenTest.Token_CreateWithServiceIdentitiesDelete is flaky
- How to delete all keys? HOT 4
- [CI] Fix deprecation warnings HOT 1
- Is the class ConsulClient thread safe? HOT 1
- Cannot create an associated check for a service with custom check id HOT 5
- [Bug]: ServiceRegister does not pass WriteOptions to PutRequest, resulting in missing token and datacenter HOT 1
- [Bug]: Consul.Test.SemaphoreTest.Semaphore_OneShot is flaky
- [Bug]: System.IO.IOException: The response ended prematurely HOT 5
- Add `ServiceTags` field to the health endpoint response
- Table showing missing features in consuldotnet
- Add support for Agent Host
- Support for Agent Version Information
- Support for Agent Metrics
- Added Test for Agent Reload
- Support Applying Configuration and Get Configuration
- Support Listing and Deleting Configuration Entries
- Support for Listing Services for Node and Retrieving Nodes that support Mesh Capable Service
- Support Getting Service Configuration
- Wanna do some contribution HOT 1
- [FEATURE REQUEST]: support weights option
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from consuldotnet.