Giter VIP home page Giter VIP logo

Comments (4)

ssenart avatar ssenart commented on August 25, 2024 1

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.

mfkl avatar mfkl commented on August 25, 2024

Hi,

Can you share a minimal MCVE please?

from consuldotnet.

ssenart avatar ssenart commented on August 25, 2024

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.

jgiannuzzi avatar jgiannuzzi commented on August 25, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.