Меню

Ошибка no connection could be made because the target machine actively refused it

    Несколько недель тому назад я заметил, что у одного из наших заказчиков NGINX спамит в error.log ошибки начинающиеся с «connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream…»:

2020/11/20 19:47:24 [error] 8560#14660: *1247 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 111.111.111.111, server: , request: «GET /favicon.ico HTTP/1.1», upstream: «https://XYZ.XYZ.XYZ.XYZ:3000/favicon.ico», host: «domain», referrer: «https://domain/»
2020/11/20 19:47:59 [error] 8560#14660: *1247 connect() failed (10061: No connection could be made because the target machine actively refused it) while connecting to upstream, client: 111.111.111.111, server: , request: «GET /ru/search?cs=N4I…

где XYZ.XYZ.XYZ.XYZ – это IP адрес их сайта, а domain – его доменное имя.
    Я где-то читал, что иногда программы могут избавляться от глюков если у них в настройках вместо «localhost» указать «127.0.0.1». Так и получилось. В одной из строк nginx.conf я сделал подобную замену:

...
server {
...
	location / {
		proxy_http_version 1.1;
		proxy_redirect off;
   			proxy_set_header Host $host;
   			proxy_set_header Upgrade $http_upgrade;
   			proxy_set_header Connection "upgrade";
		proxy_pass https://127.0.0.1:3000;
	}

	location /api/ {
		proxy_http_version 1.1;
		proxy_redirect off;
   			proxy_set_header Host $proxy_host;
   			proxy_set_header Upgrade $http_upgrade;
   			proxy_set_header Connection "upgrade";
		proxy_pass https://XYZ.XYZ.XYZ.XYZ:4443;
	}
}
...

и ошибка больше не появляется.

Я
   Паладин

16.12.08 — 10:44

Привет всем! возникла с утра такая ошибка:

Ошибка соединения с сервером 1С:Предприятия 8.1

server_addr= tcp://Myserv:1540 descr= Ошибка сетевого доступа к серверу

(Windows Sockets — 10061(0x0000274D). No connection could be made because the target machine actively refused it.) line 567

file=.srcDataExhangeTcpClientImpl.cpp

перезагружаться пробовал. В логах ничего особо не нашел. Кто нибудь сталкивался с подобным? Стоит ли переустанавливать 1С на сервере?

   asady

1 — 16.12.08 — 10:47

(0) нет не надо.

кэш на серваке почисти.

   borik

2 — 16.12.08 — 10:49

(0) http://www.gilev.ru/1c/81/error54/

   asady

3 — 16.12.08 — 10:49

(1)+ C:Program Files1cv81server там почикай все файлы и службу перезапусти

   Паладин

4 — 16.12.08 — 10:57

(3) удалить то есть?

   asady

5 — 16.12.08 — 10:59

(4) угу

   Паладин

6 — 16.12.08 — 11:04

(5) задам очень глупый вопрос — как перезапустить службу сервера? в Administrative tools — Services не нашел ее «Агент сервера 1с: Предприятия 8.1», C:Program Files1cv81binragent.exe — тоже такого нет. Большая просьба сильно не пинать(( версия платформы 8.1.11.67

   Паладин

7 — 16.12.08 — 11:08

ап…

   asady

8 — 16.12.08 — 11:08

(6) Если в сервисах службы нет, то она не инсталлирована.

скорее всего ты не на сервере смотришь

или при установке на сервере не установил компоненты сервера 1С

   Паладин

9 — 16.12.08 — 11:16

(8) все установлено, до сегодняшнего утра работало…

   asady

10 — 16.12.08 — 11:17

(9) тогда спеца зовите — вам шаман нужен не иначе.

   Serg_1960

11 — 16.12.08 — 11:17

На компе, который является 1С:сервером должно быть в Пуск — Программы(Все программы) — 1С:Предприятие8.1 — Останка сервера 1С Предприятия и Запуск сервера 1С Предприятие…

   Serg_1960

12 — 16.12.08 — 11:19

(11) Сорри, ошибка: не «останки сервера…» а «Остановка сервера…» 🙂

   Паладин

13 — 16.12.08 — 11:23

(10) ага, нужно пойти на школу темной магии… реально, вчера работало — а сегодня нет сервера 1С! теперь понятно все, кстати, спасибо за советы.

(11) спасибо

   Паладин

14 — 16.12.08 — 11:25

(12) =)))

   Serg_1960

15 — 16.12.08 — 11:26

Ещё вот это почитайте — мне помогло 🙂 v8: Нужна помощь: забыл 🙂 как добавлять процессы в кластере 8.1?

   Паладин

16 — 16.12.08 — 11:37

спасибо)

  

Odin1C

17 — 16.12.08 — 15:10

Компонент который на клиентской тачке стоит в упор сервер не видит. Либо чето с сетью нашаманили, либо кто-то сервер снес.

TurboConf — расширение возможностей Конфигуратора 1С

ВНИМАНИЕ! Если вы потеряли окно ввода сообщения, нажмите Ctrl-F5 или Ctrl-R или кнопку «Обновить» в браузере.

Ветка сдана в архив. Добавление сообщений невозможно.
Но вы можете создать новую ветку и вам обязательно ответят!
Каждый час на Волшебном форуме бывает более 2000 человек.

Sometimes I get the following error while I was doing HttpWebRequest to a WebService. I copied my code below too.


System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:80
   at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
   at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.GetRequestStream()

ServicePointManager.CertificatePolicy = new TrustAllCertificatePolicy();
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);

request.PreAuthenticate = true;
request.Credentials = networkCredential(sla);
request.Method = WebRequestMethods.Http.Post;
request.ContentType = "application/x-www-form-urlencoded";
request.Timeout = v_Timeout * 1000;

if (url.IndexOf("asmx") > 0 && parStartIndex > 0)
{
    AppHelper.Logger.Append("#############" + sla.ServiceName);

    using (StreamWriter reqWriter = new StreamWriter(request.GetRequestStream()))
    {                        
        while (true)
        {
            int index01 = parList.Length;
            int index02 = parList.IndexOf("=");

            if (parList.IndexOf("&") > 0)
                index01 = parList.IndexOf("&");

            string parName = parList.Substring(0, index02);
            string parValue = parList.Substring(index02 + 1, index01 - index02 - 1);

            reqWriter.Write("{0}={1}", HttpUtility.UrlEncode(parName), HttpUtility.UrlEncode(parValue));

             if (index01 == parList.Length)
                 break;

             reqWriter.Write("&");
             parList = parList.Substring(index01 + 1);
         }
     }
 }
 else
 {
     request.ContentLength = 0;
 }

 response = (HttpWebResponse)request.GetResponse();

BalaRam's user avatar

asked Jun 4, 2010 at 8:41

hsnkvk's user avatar

2

If this happens always, it literally means that the machine exists but that it has no services listening on the specified port, or there is a firewall stopping you.

If it happens occasionally — you used the word «sometimes» — and retrying succeeds, it is likely because the server has a full ‘backlog’.

When you are waiting to be accepted on a listening socket, you are placed in a backlog. This backlog is finite and quite short — values of 1, 2 or 3 are not unusual — and so the OS might be unable to queue your request for the ‘accept’ to consume.

The backlog is a parameter on the listen function — all languages and platforms have basically the same API in this regard, even the C# one. This parameter is often configurable if you control the server, and is likely read from some settings file or the registry. Investigate how to configure your server.

If you wrote the server, you might have heavy processing in the accept of your socket, and this can be better moved to a separate worker-thread so your accept is always ready to receive connections. There are various architecture choices you can explore that mitigate queuing up clients and processing them sequentially.

Regardless of whether you can increase the server backlog, you do need retry logic in your client code to cope with this issue — as even with a long backlog the server might be receiving lots of other requests on that port at that time.

There is a rare possibility where a NAT router would give this error should its ports for mappings be exhausted. I think we can discard this possibility as too much of a long shot though, since the router has 64K simultaneous connections to the same destination address/port before exhaustion.

mklement0's user avatar

mklement0

352k60 gold badges556 silver badges699 bronze badges

answered Jun 4, 2010 at 8:52

Will's user avatar

WillWill

73k38 gold badges168 silver badges240 bronze badges

13

The most probable reason is a Firewall.

This article contains a set of reasons, which may be useful to you.

From the article, possible reasons could be:

  • FTP server settings
  • Software/Personal Firewall Settings
  • Multiple Software/Personal Firewalls
  • Anti-virus Software
  • LSP Layer
  • Router Firmware
  • Computer Turned Off
  • Computer Not Plugged In
  • Fiddler

Adrian Mole's user avatar

Adrian Mole

47.9k138 gold badges48 silver badges78 bronze badges

answered Jun 4, 2010 at 8:48

Chathuranga Chandrasekara's user avatar

2

I had the same. It was because the port-number of the web service was changing unexpectedly.

This problem usually happens when you have more than one copy of the project

My project was calling the Web service with a specific port number which I assigned in the Web.Config file of my main project file. As the port number changed unexpectedly, the browser was unable to find the Web service and throwing that error.

I solved this by following the below steps: (Visual Studio 2010)

Go to Properties of the Web service project —> click on Web tab —> In Servers section —> Check Specific port
and then assign the standard port number by which your main project is calling the web service.

I hope this will solve the problem.

Cheers 🙂

answered Dec 29, 2012 at 6:32

Mr_Green's user avatar

Mr_GreenMr_Green

40.1k43 gold badges159 silver badges263 bronze badges

1

I think, you need to check your proxy settings in «internet options». If you are using proxy/’hide ip’ applications, this problem may be occurs.

answered Dec 2, 2014 at 8:12

isaeid's user avatar

isaeidisaeid

5335 silver badges26 bronze badges

4

I had the same error with my WCF service using Net TCP binding, but resolved after starting the below services in my case.

Net.Pipe.Listener.Adapter

Net.TCP.Listener.Adapter

Net.Tcp Port Sharing Service

answered Apr 9, 2014 at 11:25

Kiru's user avatar

KiruKiru

3,4611 gold badge22 silver badges46 bronze badges

1

In my case, some domains worked, while some did not. Adding a reference to my organization’s proxy Url in my web.config fixed the issue.

<system.net>
    <defaultProxy useDefaultCredentials="true">
      <proxy proxyaddress="http://proxy.my-org.com/" usesystemdefault="True"/>
    </defaultProxy>
</system.net>

answered May 16, 2016 at 20:46

James Lawruk's user avatar

James LawrukJames Lawruk

29.2k19 gold badges128 silver badges134 bronze badges

When you call service which has only HTTP (ex: http://example.com) and you call HTTPS (ex: https://example.com), you get exactly this error — «No connection could be made because the target machine actively refused it»

answered Sep 17, 2020 at 18:45

Avtandil Kavrelishvili's user avatar

I faced same error because when your Server and Client run on same machine the Client need server local ip address not Public ip address to communicate with server you need Public ip address only in case when Server and Client run on separate machine so use Local ip address in client program to connect with server Local ip address can be found using this method.

 public static string Getlocalip()
    {
        try
        {
            IPAddress[] localIPs = Dns.GetHostAddresses(Dns.GetHostName());
            return localIPs[7].ToString();
        }
        catch (Exception)
        {

            return "null";
        }

    }

answered Mar 21, 2017 at 9:56

1

I got this error in an application that uses AppFabric. The clue was getting a DataCacheException in the stack trace. To see if this is the issue for you, run the following PowerShell command:

@("AppFabricCachingService","RemoteRegistry") | % { get-service $_ }

If either of these two services are stopped, then you will get this error.

H. Pauwelyn's user avatar

H. Pauwelyn

13.1k26 gold badges80 silver badges139 bronze badges

answered Mar 21, 2013 at 18:12

John Zabroski's user avatar

John ZabroskiJohn Zabroski

2,1342 gold badges27 silver badges53 bronze badges

1

For me, I wanted to start the mongo in shell (irrelevant of the exact context of the question, but having the same error message before even starting the mongo in shell)

The process ‘MongoDB Service’ wasn’t running in Services

Start cmd as Administrator and type,

net start MongoDB

Just to see MongoDB is up and running just type mongo, in cmd it will give Mongo version details and Mongo Connection URL

Romit Mehta's user avatar

answered Jan 23, 2020 at 6:26

Siva Rahul's user avatar

Siva RahulSiva Rahul

2531 silver badge13 bronze badges

Well, I’ve received this error today on Windows 8 64-bit out of the blue, for the first time, and it turns out my my.ini had been reset, and the bin/mysqld file had been deleted, among other items in the "Program Files/MySQL/MySQL Server 5.6" folder.

To fix it, I had to run the MySQL installer again, installing only the server, and copy a recent version of the my.ini file from "ProgramData/MySQL/MySQL Server 5.6", named my_2014-03-28T15-51-20.ini in my case (don’t know how or why that got copied there so recently) back into "Program Files/MySQL/MySQL Server 5.6".

The only change to the system since MySQL worked was the installation of Native Instruments’ Traktor 2 and a Traktor Audio 2 sound card, which really shouldn’t have caused this problem, and no one else has used the system besides me. If anyone has a clue, it would be kind of you to comment to prevent this for me and anyone else who has encountered this.

answered Apr 7, 2014 at 16:56

J Griffiths's user avatar

J GriffithsJ Griffiths

6916 silver badges14 bronze badges

1

For service reference within a solution.

  1. Restart your workstation

  2. Rebuild your solution

  3. Update service reference in WCFclient project

At this point, I received messsage (Windows 7) to allow system access.
Then the service reference was updated properly without errors.

answered Jun 22, 2015 at 12:55

Gary Kindel's user avatar

Gary KindelGary Kindel

16.9k7 gold badges49 silver badges66 bronze badges

I would like to share this answer I found because the cause of the problem was not the firewall or the process not listening correctly, it was the code sample provided from Microsoft that I used.

https://msdn.microsoft.com/en-us/library/system.net.sockets.socket%28v=vs.110%29.aspx

I implemented this function almost exactly as written, but what happened is I got this error:

2016-01-05 12:00:48,075 [10] ERROR — The error is: System.Net.Sockets.SocketException (0x80004005): No connection could be made because the target machine actively refused it [fe80::caa:745:a1da:e6f1%11]:4080

This code would say the socket is connected, but not under the correct IP address actually needed for proper communication. (Provided by Microsoft)

private static Socket ConnectSocket(string server, int port)
    {
        Socket s = null;
        IPHostEntry hostEntry = null;

        // Get host related information.
        hostEntry = Dns.GetHostEntry(server);

        // Loop through the AddressList to obtain the supported AddressFamily. This is to avoid
        // an exception that occurs when the host IP Address is not compatible with the address family
        // (typical in the IPv6 case).
        foreach(IPAddress address in hostEntry.AddressList)
        {
            IPEndPoint ipe = new IPEndPoint(address, port);
            Socket tempSocket = 
                new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            tempSocket.Connect(ipe);

            if(tempSocket.Connected)
            {
                s = tempSocket;
                break;
            }
            else
            {
                continue;
            }
        }
        return s;
    }

I re-wrote the code to just use the first valid IP it finds. I am only concerned with IPV4 using this, but it works with localhost, 127.0.0.1, and the actually IP address of you network card, where the example provided by Microsoft failed!

    private Socket ConnectSocket(string server, int port)
    {
        Socket s = null;

        try
        {
            // Get host related information.
            IPAddress[] ips;
            ips = Dns.GetHostAddresses(server);

            Socket tempSocket = null;
            IPEndPoint ipe = null;

            ipe = new IPEndPoint((IPAddress)ips.GetValue(0), port);
            tempSocket = new Socket(ipe.AddressFamily, SocketType.Stream, ProtocolType.Tcp);

            Platform.Log(LogLevel.Info, "Attempting socket connection to " + ips.GetValue(0).ToString() + " on port " + port.ToString());
            tempSocket.Connect(ipe);

            if (tempSocket.Connected)
            {
                s = tempSocket;
                s.SendTimeout = Coordinate.HL7SendTimeout;
                s.ReceiveTimeout = Coordinate.HL7ReceiveTimeout;
            }
            else
            {
                return null;
            }

            return s;
        }
        catch (Exception e)
        {
            Platform.Log(LogLevel.Error, "Error creating socket connection to " + server + " on port " + port.ToString());
            Platform.Log(LogLevel.Error, "The error is: " + e.ToString());
            if (g_NoOutputForThreading == false)
                rtbResponse.AppendText("Error creating socket connection to " + server + " on port " + port.ToString());
            return null;
        }
    }

answered Jan 5, 2016 at 22:56

Jake's user avatar

JakeJake

3972 silver badges15 bronze badges

This is really specific, but if you receive this error after trying to connect to a database using mongo, what worked for me was running mongod.exe before running mongo.exe and then the connection worked fine. Hope this helps someone.

answered Mar 15, 2016 at 16:43

Script Kitty's user avatar

Script KittyScript Kitty

1,7075 gold badges27 silver badges47 bronze badges

0

One more possibility —

Make sure you’re trying to open the same IP address as where you’re listening. My server app was listening to the host machine’s IP address using IPv6, but the client was attempting to connect on the host machine’s IPv4 address.

answered Apr 10, 2017 at 8:50

Steve Mol's user avatar

Steve MolSteve Mol

1442 silver badges8 bronze badges

I’ve received this error from referencing services located on a WCFHost from my web tier. What worked for me may not apply to everyone, but I’m leaving this answer for those whom it may. The port number for my WCFHost was randomly updated by IIS, I simply had to update the end routes to the svc references in my web config. Problem solved.

answered Feb 28, 2013 at 16:58

WiseGuy's user avatar

WiseGuyWiseGuy

4091 gold badge8 silver badges19 bronze badges

In my scenario, I have two applications:

  • App1
  • App2

Assumption: App1 should listen to App2’s activities on Port 5000

Error: Starting App1 and trying to listen, to a nonexistent ghost town, produces the error

Solution: Start App2 first, then try to listen using App1

Community's user avatar

answered Apr 11, 2016 at 17:54

usefulBee's user avatar

usefulBeeusefulBee

9,02610 gold badges50 silver badges82 bronze badges

Go to your WCF project —
properties ->
Web ->
debuggers
-> unmark the checkbox

Enable Edit and Continue

answered Apr 12, 2017 at 13:10

Rajat's user avatar

RajatRajat

736 bronze badges

1

In my case this was caused by a faulty deployment where a setting in my web.config was not made.

A collegue explained that the IP address in the error message represents the localhost.

When I corrected the web.config I was then using the correct url to make the server calls and it worked.

I thought I would post this in case it might help someone.

answered Jul 24, 2018 at 9:58

arame3333's user avatar

arame3333arame3333

9,64725 gold badges119 silver badges203 bronze badges

1

Using WampServer 64bit on Windows 7 Home Premium 64bit I encountered this exact problem. After hours and hours of experimentation it became apparent that all that was needed was in my.ini to comment out one line. Then it worked fine.

commented out 1 line
socket=mysql

If you put your old /data/ files in the appropriate location, WampServer will accept all of them except for the /mysql/ folder which it over writes. So then I simply imported a backup of the /mysql/ user data from my prior development environment and ran FLUSH PRIVILEGES in a phpMyAdmin SQL window. Works great. Something must be wrong because things shouldn’t be this easy.

answered Jun 19, 2013 at 3:16

Doug Hockinson's user avatar

Doug HockinsonDoug Hockinson

9871 gold badge8 silver badges10 bronze badges

I had this issue happening often. I found SQL Server Agent service was not running. Once I started the service manually, it got fixed. Double check if the service is running or not:

  1. Run prompt, type services.msc and hit enter
  2. Find the service name — SQL Server Agent(Instance Name)

If SQL Server Agent is not running, double-click the service to open properties window. Then click on Start button. Hope it will help someone.

answered May 8, 2016 at 20:34

gmsi's user avatar

gmsigmsi

1,0421 gold badge15 silver badges29 bronze badges

1

I came across this error and took some time to resolve it. In my case I had https and net.tcp configured as IIS bindings on same port. Obviously you can’t have two things on the same port. I used netstat -ap tcp command to check whether there is something listening on that port. There was none listening. Removing unnecessary binding (https in my case) solved my issue.

answered Oct 2, 2017 at 8:36

Alex's user avatar

AlexAlex

1064 bronze badges

It was a silly issue on my side, I had added a defaultproxy to my web.config in order to intercept traffic in Fiddler, and then forgot to remove it!

Neeraj Kumar's user avatar

Neeraj Kumar

7612 gold badges16 silver badges36 bronze badges

answered Nov 1, 2017 at 14:59

Kik's user avatar

KikKik

4283 silver badges9 bronze badges

There is a service called «SQL Server Browser» that provides SQL Server connection information to clients.

In my case, none of the existing solutions worked because this service was not running. I resumed it and everything went back to working perfectly.

answered Jul 10, 2018 at 6:20

Talha Imam's user avatar

Talha ImamTalha Imam

9861 gold badge20 silver badges22 bronze badges

I was facing this issue today. Mine was Asp.Net Core API and it uses Postgresql as the database. We have configured this database as a Docker container. So the first step I did was to check whether I am able to access the database or not. To do that I searched for PgAdmin in the start as I have configured the same. Clicking on the resulted application will redirect you to the http://127.0.0.1:23722/browser/. There you can try access your database on the left menu. For me I was getting an error as in the below image.

enter image description here

Enter the password and try whether you are able to access it or not. For me it was not working. As it is a Docker container, I decided to restart my Docker desktop, to do that right click on the docker icon in the task bar and click restart.

Once after restarting the Docker, I was able to login and see the Database and also the error was gone when I restart the application in Visual Studio.

Hope it helps.

answered Jun 18, 2019 at 8:05

Sibeesh Venu's user avatar

Sibeesh VenuSibeesh Venu

16.9k11 gold badges91 silver badges136 bronze badges

it might be because of authorisation issues; that was the case for me.
If you have for example: [Authorize("WriteAccess")] or [Authorize("ReadAccess")] at the top of your controller functions, try to comment them out.

answered Jan 14, 2020 at 10:23

eva's user avatar

evaeva

791 silver badge2 bronze badges

I just faced this right now…

enter image description here

Here on my end, I have 2 separated Visual Studio solutions (.sln)… opened each one in their own Visual Studio instance.

Solution 2 calls Solution 1 code. The problem was related to the port assigned to Solution 1. I had to change the port on solution 1 to another one and then Solution 2 started working again. So make sure you check the port assigned to your project.

answered Jun 18, 2020 at 22:00

Leniel Maccaferri's user avatar

Leniel MaccaferriLeniel Maccaferri

98.9k44 gold badges363 silver badges467 bronze badges

Normally, connection scripts do not mention the port to use. For example:

$mysqli = mysqli_connect('127.0.0.0.1', 'user', 'password', 'database');

So, to connect with a manager that doesn’t use port 3306, you have to specify the port number on the connection request:

$mysqli = mysqli_connect('127.0.0.0.1', 'user', 'password', 'database', '3307');

To check the connections on the MySQL or MariaDB database manager, use the script:
wamp(64)wwwtestmysql.php
by putting ‘http://localhost/testmysql.php’ in the browser address bar having first modified the script according to your parameters.

answered Jan 17, 2021 at 9:54

sarfaraj's user avatar

I forgot to start the service so it failed because no service was listening on port.
Resolved by starting the service.

answered Aug 3, 2021 at 12:26

John Smith's user avatar

Multiple users have been facing an error when using certain online services and applications. Every time they try to login or run the program a statement appears, saying, No connection could be made because the target machine actively refused it. Users have been facing this issue while logging in or connecting to the Mysql server, while logging into the azure AD, using Vmware and send HTTPS request. Furthermore, the error also appears while using the Autodesk application. In this troubleshooting guide, we will be giving you some methods along with some important information regarding the error.

No Connection Could Be Made Because the Target Machine Actively Refused It Error

Causes of No Connection Could Be Made Because The Target Machine Actively Refused it Error

Talking of the causes behind No connection could be made because the target machine actively refused it an error. Multiple users have reported that the error appears because of active firewall and antivirus, furthermore, the error also appears because of network issues. However, if you are facing this error while browsing any website it may be because of an SSL certificate. If you are using any application and getting the error, maybe the software files have been corrupted.

  • Active firewall and antivirus
  • Network issues
  • SSL certificate
  • Software files have been corrupted
Similar Types No Connection Could Be Made Because The Target Machine Actively Refused it Error
  • Error while connecting to host No Connection Could Be Made Because The Target Machine Actively Refused it
  • Qlik sense
  • Town of Salem no connection could be made
  • Xerxes no connection could be made
  • 74.125 130.109 587
  • 13.107 136.9 443
  • 127.0.0.1:443 + SSRS
  • Sqlstate[hy000] [2002]

Now let’s go through all the possible ways by which you can fix No Connection Could Be Made Because The Target Machine Actively Refused it Error. We have managed to gather some methods. The following are the methods.

1. Disable Windows Firewall

The first and the foremost thing that you must do is to disable your windows firewall. Windows firewall prevents certain services from running and executing and thus the [winerror 10061] No Connection Could Be Made Because The Target Machine Actively Refused it error appears. Follow the steps to disable the firewall.

  • STEP 1. Open the Run window, press Win + R
  • STEP 2. In the Run window now type control panel and Hit Enter
  • STEP 3. Once the Control Panel window is opened, change the view to small
  • STEP 4. Locate and click on Windows Defender Firewall
  • STEP 5. In this new window, On the left-hand side, click on Turn Windows Defender Firewall On or Off link

Turn Windows Defender Firewall On or Off

  • STEP 6. A new window will open, now from the options select Turn Windows Defender Firewall OFF (not recommended)

windows defender firewall

  • STEP 7. Make sure to set this for both public and private network settings
  • STEP 8. Finally, Click on Apply and then OK
  • STEP 9. Restart your system and check if the error appears

2. Fixing the Error when using VMware

One of the major scenarios in which the error seems to appear is when using the VMware. Below are some ways you can use to eliminate the No Connection Could Be Made Because The Target Machine Actively Refused it http://127.0.0.1/ issue.

A). Starting the VMware vCenter Workflow Manager Service

  • STEP 1. Open the Run window, press Win + R
  • STEP 2. In the Run window now type services.MSC and Hit Enter

services msc

  • STEP 3. Once the services window opens up, locate VMware vCenter Workflow Manager Service

VMware vCenter Workflow Manager

  • STEP 4. Once you have found the service, right-click on the service and go to Properties
  • STEP 5. Now firstly Start the service, by clicking on the Start button at the bottom, of the service is already running, restart it
  • STEP 6. Now put the Startup type to Automatic
  • STEP 7. Once done restart your system and check if the error still occurs

B). Connecting the vCenter Server Appliance (VCSA) as Root

  • STEP 1. Make sure to follow all the steps from Method A.
  • STEP 2. Now Open the command window with admin privileges
  • STEP 3. Execute the below commands
service --stop vmware-vpx-workflow

cmd No Connection Could be Made Because the Target Machine Actively Refused it

  • STEP 4. Now enter the below command
service --start vmware-vpx-workflow

cmd No Connection Could be Made Because the Target Machine Actively Refused it

  • STEP 5. Now restart your system and use VMware without errors

3. Fixing the Error when using Autodesk Maya Application

A lot of users have been facing this sqlstate[hy000] [2002] No Connection Could Be Made Because The Target Machine Actively Refused it connection failed issue when using the Maya application. Below are some methods that will fix the issue.

A). Error when Submitting Jobs from 3ds Max & Maya

  • To resolve the issue when connecting to the render node kindly use a dedicated/static IP/ physically based IP address or machine name.
  • Also, you have to make sure that all the ports important and recommended ports are accessible to the backburner
  • Cross-check whether the Backburner Manager is set to either the IP Address or Host Name
  • Before you submit any job, open Maya Script Editor and check any errors
Window > General Editors > Script Editor 

B). Error when Submitting Jobs from Maya

The error can be resolved by resetting the Maya.

  • STEP 1. In the Start menu, click on My computer, then navigate to the below path
C:Users<username>My DocumentsMaya<version>
  • STEP 2. Once you reach at the directory locate the prefs folder

prefs No Connection Could be Made Because the Target Machine Actively Refused it

  • STEP 3. Now rename it to prefsOldl
  • STEP 4. Now Restart Maya
  • STEP 5. If you have been prompted select Create Default Preferences

4. Fixing the Error when Browsing Websites

Users have been facing veeam No Connection Could Be Made Because The Target Machine Actively Refused It Error while browsing the website. It occurs because of SSL is not trusted by the browser. To fix that follow steps.

A). Enable SSL in Chrome

  • STEP 1. Open Google Chrome > Press Alt + f
  • STEP 2. From the menu click on settings
  • STEP 3. On the left click on Privacy and Security
  • STEP 4. Now on the right scroll a little and click on Manage certificates

chrome No Connection Could be Made Because the Target Machine Actively Refused it

  • STEP 5. In this new window click on Advanced button
  • STEP 6. Now scroll and tick all version of Use SSL

B). Enable SSL in Firefox

  • STEP 1. Open up Firefox and enter the below command in the address bar
about:config
  • STEP 2. Now in the search bar type the below command
tls.version

tls.version No Connection Could be Made Because the Target Machine Actively Refused it

  • STEP 3. Enable them to fix the issue
Conclusion:

With this being the end of the troubleshooting guide on No Connection Could Be Made Because The Target Machine Actively Refused It Error. We have given you all the methods to fix the issue.

We hope by following this No Connection Could Be Made Because The Target Machine Actively Refused it guide your issue is fixed. For more troubleshooting, guides and tips follow us. Thank you!

1С Ошибка при выполнении операции с информационной базой

Дано: кластер 1С 8.3
Проблема: ошибки при запуске базы (пользователи не могут запустить 1С Предприятия после выбора базы), не важно бухгалтерия это или зарплата, или другая конфигурация.

Ошибка у пользователя при запуске базы в режиме «1С:Предприятие» 8.3:
Ошибка при выполнении операции с информационной базой

Или такая ошибка:
Ошибка установки соединения. Выполняется ожидание возможности запуска. При появлении возможности, запуск будет выполнен автоматически.

Ошибка при запуске кластера 1С:
Ошибка соединения с сервером 1С: Предприятия 8.3: 
server_addr = tcp://<название сервера + порт>
descr = <IP port>: No connection could bе made because the target machine actively refused it.
line =1040
file = srcDataExchangeTcpClientImpl.cpp

Один из вариантов решения:
Проверьте, запущен ли «Агента сервера 1С:Предприятие» в списке служб (Services — «Агент сервера 1С:Предприятие 8.3»). Должно быть состояние Running.

Если пусто, то нужно запустить службу — Старт (Start).
Если служба уже запущена, то рекомендуется сделать перезапуск — Restart.

Также можно проверить в кластере нет ли запрета на запуск базы в ее свойствах (например, установленного при обновлении базы):

Если при запуске свойств базы кластер попросит логин и пароль в окне «Администратор информационной базы», то вводим логин-пароль администратора конфигурации (т.е. тот, который вводим при запуске конфигуратора конкретной базы), а не администратора кластера.

В свойствах базы проверяем блок «Блокировка начала сеансов включена» — поля должны быть пусты, как на рисунке ниже:

Если Вам понравилась статья, пожалуйста, поставьте лайк, сделайте репост или оставьте комментарий. Если у Вас есть какие-либо замечания, также пишите комментарии.

  • Question

  • I hosted a wcf service application using windows services. When my client (ASP.NET) tries to call the service class hosted by the windows service, I get this error «TCP error code 10061: No connection could be made because the target machine actively refused it. «. Is there a fix for this? The same code works fine if I host it using a console application.

Answers

  • What port are you listening on? Is that port unblocked in your windows firewall?

All replies

  • What port are you listening on? Is that port unblocked in your windows firewall?

  • Yes, my firewall was blocking it. I got around it and it fixed the problem.

    • Proposed as answer by

      Friday, May 23, 2014 1:28 PM

  • Hi,

    Evn i am gettin the same error. Can u tell me wat is the fix.

  • I am getting the same error — but only when I change my return type to a cutom object. CLR types work fine — i.e. an IList of Strings, but not, say, MyResponseObj. I’m running the asp.net development server on port 1212, with a wsHttpBinding. Like I said, the problem seems to be with the return type which is marked up with the DataContract — DataMember tags, like my other custom objects that work fine as input objects. I am able to pass in an arbitrarily complex object of custom types no problem — but the server tanks with a custom return type.

    Any suggestion would be appreciated. Thanx — Ian

  • Brian

    I’ve configured trace in the web.config file as per the article, but no output or log file is generated. Do I need to create a trace object in my test code (NUnit) to explicitly start the trace segment?

    Or should the web.config entry be sufficient?

    Thanks,

    Ian

  • Kenny,

    I’ve unblocked the port on the firewall and still unable to connect.

    What was the fix?

  • For problem returning custom objects, turns out my IList<T> member variable, since it could be nullable, required this in the data contract: [DataMember(EmitDefaultValue = false)]
    That is what was causing the service to refuse the connection. Now all is well again.  A newbie error no doubt, but I never even heard of WCF before I started at my new company.  =o)

    • Proposed as answer by
      JeffKite
      Wednesday, August 14, 2013 6:32 PM

  • What port are you using? What binding is this? Can you connect to the port using IE (assuming you have an HTTP GET metadata enabled)?

  • Hi ,

    I am getting this error if I host it using a console application. it works fine if client is asp.net. Is there a fix for this?

    -ravi

  • try to remove and add service refrences again…it will help you to connect wcf…

  • Hi JothiMurugan,

    I am also getting same error when I host with the windows service.

    Same application when hosted in Console application, works fine.

    Can you please help me with the fix.

    Thanks in advance.

    Sakthi

  • hi
    i don’t know it will helpfull to u or not but u should try it
    first u click on  host  project and  click on Start new instance
    then u should run windows application

  • I have configured Tracing and I see my trace files just fine, the prblem is I don’t see an Error icon. 

    I’m looking through all the activities in the trace viewer and the one for my service operation has To and from transport messages, I can see the start for the activity but there is nothing indicating an error and I setup it up for  switchValue=»Error,ActivityTracing». 

    ??


    Santiago Perez

  • Hi,
    I am trying to write a WCF service with transport level security and basicHTTP binding. I am using a custom Membership provider to authenticate a client call to the service by authenticating the User ID and password passed to the service. I believe that WCF does not allow UserID/Password auth without having SSL certificate installed because the UserID/password are sent as clear text. I am currently in development and I tried installing the test certificate (X.509) on my dev machine running the service but w/o any success.
    My service web.config looks like this

    <

    system.serviceModel>

    <

    services>

    <

    service behaviorConfiguration=«LCCService.rbagLCWS_ServiceBehavior«

    name=«LCCService.rbagLCWS_Service«>

    <

    endpoint address=«»

    binding=«basicHttpBinding«

    bindingConfiguration=«LCCService.rbagLCWS_ServiceBinding«

    contract=«LCCService.IrbagLCWS_service«>

    </

    endpoint>

    <

    endpoint address=«mex«

    binding=«mexHttpBinding«

    contract=«IMetadataExchange« />

    </

    service>

    </

    services>

    <

    behaviors>

    <

    serviceBehaviors>

    <

    behavior name=«LCCService.rbagLCWS_ServiceBehavior«>

    <

    serviceCredentials>

    <

    userNameAuthentication userNamePasswordValidationMode=«MembershipProvider« membershipProviderName=«PasswordProvider«/>

    </

    serviceCredentials>

    <

    serviceMetadata httpGetEnabled=«true« />

    <

    serviceDebug includeExceptionDetailInFaults=«true« />

    </

    behavior>

    </

    serviceBehaviors>

    </

    behaviors>

    <

    bindings>

    <

    basicHttpBinding>

    <

    binding name=«LCCService.rbagLCWS_ServiceBinding«>

    <

    security mode=«Transport«>

    <

    transport clientCredentialType=«Basic«/>

    </

    security>

    </

    binding>

    </

    basicHttpBinding>

    </

    bindings>

    </

    system.serviceModel>

    When I try to call the service using the client w/o having the test certification installed, I get the following error:
    Could not connect to https://XYZ.com/rrxainet/LCCWCFService/rbagLCWS_service.svc. TCP error code 10061: No connection could be made because the target machine actively refused it XXX.XXX.XX.XXX:443.

    I have spent almost 2 days trying to figure out the solution and how to successfully install the test certificate to get it working but to no avail.

    Please can someone help. I really appreciate it!!!

  • hi guys,

    i am new to dot net. when i am using the folling program for connecting the particuler port it is giving the error.

    int

    timout = Convert.ToInt32(txttimeout.Text);

    int port = 5000;

    IPAddress localAddr = IPAddress.Parse(«127.0.0.1»);

    IPEndPoint remoteEndPoint = new IPEndPoint(localAddr, port);

    TcpClient NetworkClient = TimeOutSocket.Connect(remoteEndPoint, timout);

    NetworkStream networkstream = NetworkClient.GetStream();

    StreamReader streamReader = new StreamReader(networkstream);

    string line = streamReader.ReadToEnd(); //streamReader.ReadLine();

  • I got the same message after adding the registry value  «KeepAliveTime» with value 300000 in the window registry under HKEY_LOCAL_MACHINESystemCurrentControlSetServicesTcpipParameters.

    When I removed the window registry «KeepAliveTime», it resumed normal.

    Is there any settings I have to check ?

  • Hi All,

     I am new to WCF. I have created a WCF Service and hosted it in Windows Service. I have got a below Error when tring to create Client Proxy for the service.

    Error Message:

    «There was an error downloading ‘http://localhost:8051/Service1/’.
    Unable to connect to the remote server
    No connection could be made because the target machine actively refused it 127.0.0.1:8051
    Metadata contains a reference that cannot be resolved: ‘http://localhost:8051/Service1/’.
    Could not connect to http://localhost:8051/Service1/. TCP error code 10061: No connection could be made because the target machine actively refused it 127.0.0.1:8051.

    Unable to connect to the remote server
    No connection could be made because the target machine actively refused it 127.0.0.1:8051
    If the service is defined in the current solution, try building the solution and adding the service reference again.»

    I have seen some posts related to Issue like unblocking the port in Firewall. I have unblocked all ports from Firewall, Still the Issue raising while create Client Proxy. Some one can help me on this Problem. I have Pasted my configuration file below.

    <system.serviceModel>
        <services>
          <service name=»WcfService1.Service1″ behaviorConfiguration=»WcfService1.Service1Behavior»>
            <!— Service Endpoints —>
            <endpoint address=»» binding=»wsHttpBinding» contract=»WcfService1.IService1″>
            </endpoint>
            <!—<endpoint address=»» binding=»netTcpBinding» contract=»WcfService1.IService1″></endpoint>—>
            <!—<endpoint address=»mextcp» binding=»mexTcpBinding» contract=»IMetadataExchange»/>—>
            <endpoint address=»mex» binding=»mexHttpBinding» contract=»IMetadataExchange»/>
            <host>
              <baseAddresses>
                <add baseAddress = «http://localhost:8051/Service1/» />
              </baseAddresses>
            </host>
          </service>
        </services>
        <behaviors>
          <serviceBehaviors>
            <behavior name=»WcfService1.Service1Behavior»>
              <!— To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment —>
              <serviceMetadata httpGetEnabled=»true»/>
              <!— To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information —>
              <serviceDebug includeExceptionDetailInFaults=»false»/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>

    Please reply me to solve this problem.

  • I started getting this problem in VS 2008 IDE when I’m testing my web services.  Not a firewall issue.  Anyone find a positive solution to this??

    My Web Service test web application used to work fine a few months ago — now when I test it I get this error?  So I’m guessing some OS update has broken VS 2008 IDE for web services??

    Rob

  • Solved the problem for my case (appears to a Project’s Web Service reference issue):

    In VS 2008 IDE

    In your actual Web Services Project (with the ASMX source) — My Project | Web | Use Visual Studio Development Server | Auto-assign Port.

    a. If this is hard coded to a specific port you’ll need to verify the calling Project’s Web Service references match the same port and reference.

    b. Open your calling project — My Project | References — remove your Web Service references (Type = Service) — be sure to note the ReferenceName you used.  Now Add Service Reference back again — Discover Services in Solution, select the service
    and be sure to re-enter the same ReferenceName you used originally.

    If your Web Service project is configured differently or you reference external web services, then it might just be a case of removing and re-adding the web service back being sure to use the same ReferenceName so you project references stay intact.

    Rob.

    • Proposed as answer by
      Rob Ainscough
      Monday, August 2, 2010 10:23 PM

  • Hi I'm new to WCF.. I'm trying to invoke free web service
    

    http://www.mindreef.net/svc/hashservice/servicesHashClassSoap?wsdl....

    So i have created a client but it gives me an exception..Please help me

    Could not connect to http://localhost:8050/hashservice/services/HashClassSoap.
    
    
    TCP error code 10061: No connection could be made because the target machine 
    
    
    actively refused it 127.0.0.1:8050. 
    
    Server stack trace: 
     at System.ServiceModel.Channels.HttpOutput.WebRequestHttpOutput.GetOutputStream()
     at System.ServiceModel.Channels.HttpOutput.Send(TimeSpan timeout)
     at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.
    
    
    HttpChannelRequest.SendRequest(Message message, TimeSpan timeout)
     at System.ServiceModel.Channels.RequestChannel.Request(Message message,
    
    
     TimeSpan timeout)
     at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message,
    
    
     TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean 
    
    
    oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan
    
    
     timeout)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action,
    
    
     Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(
    
    
    IMethodCallMessage methodCall, ProxyOperationRuntime operation)
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
    
    Exception rethrown at [0]: 
     at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg,
    
    
     IMessage retMsg)
     at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData,
    
    
     Int32 type)
     at HashClassSoap.CheckHash(CheckHashRequest request)
     at HashClassSoapClient.HashClassSoap.CheckHash(CheckHashRequest request)
    
    
    
    

  • you have added your wcf reference by selecting wcf project node. to resolve it select your test project node and add wcf reference. i hope it will work.

  • you have added your wcf reference by selecting wcf project node. to resolve it select your test project node and add wcf reference. i hope it will work.

  • Yeah! First time I ever fixed ANYTHING! Error went away when changed properties of project to use IIS instead of local directory.  Set the project to use IIS, click the button to create a virtual directory and…c’est voila!.  Good luck.

  • TrollSpouse, I seem to have this problem, but I don’t understand the solution you found. Could you be more specific where in properties you configured  to use IIS instead of local directory? Thanks.

  • Make sure that «Net.Tcp Listener» is running go to  ControlPanel/Administrative Tools/Services
    also «Net.Tcp Port Sharing»  Service.

    • Proposed as answer by
      M.El-Baz
      Saturday, October 22, 2016 5:57 PM

  • My Net.tcp listener shows as starting, however starts… it shows the net.tcp Port Sharing as started, as well as the Windows Process Activation Service as started… i get the 10061 error as well… any idea how I can fix this?  would a service admin
    logon do it versus Local System/Service?

  • did you find the solution I have the same problem «TCP error code 10061: No connection could be made because the target machine actively refused it.

    when the service and application on the same PC its working fine but when I deployed the client application on another pc, i got the above error.

  • I’m quite interested in this as well, as I’ve got the same issue. I had my WCF service, that uses TCP for the transport protocol, on a Windows 2003 R2 Server. We’re writing a WPF application. It works fine for me, but no other user can run it. So in an
    effort to try and figure out what’s wrong I am now running the WCF service on my machine (a Windows 7 Ultimate machine). I’ve put the WCF service into IIS. I made sure the Windows Firewall allows for the port I want to use (9000). But I started getting these,
    «No connection could be made because the target machine actively refused it» and then it gives my machine’s IP address. I saw back in 2011 that Ivendur suggested making sure that Net.Tcp Listener Adapter and Net.Tcp Port Sharing Service services both be running.
    They weren’t on my machine, but they are now, and that didn’t resolve the issue, I’m still getting that actively refused error message.


    Rod

  • I am receiving the same error when i  try to connect 2 clients to the same server.

    I make myself clear…

    i created a lan chat program that works just fine with 1 server form who listens (I used TPCListener) on 8080, and 1 client form that connects to it

    but if i try to open another client form and connect to the same server form at 8080 i get the error…

    i believed that, since the 2 clients use a different port to connect to localost:8080 the socket should not give an error…

    I don’t know how to solve this!


    +++ Alex +++

  • VMWARE Virtual network can cause such a problem (happened to me) — ‘Restore Defaults’ is the solution!


    Di-ma-N

  • For mine, I had to go into my router settings and use port forwarding.

  • It can be that if your server where AGPM client is started was an AGPM server before, that still these settings are used and therefore point to a wrong server. Just delete all entries of HKEY_LOCAL_MACHINESOFTWAREMicrosoftAgpm and below only enter the
    two following strings:

    DefaultArchive = AGPMServerName.company.com:4600
    InstallDirClient = C:Program FilesMicrosoftAGPMClient

    Note that «AGPMServerName.company.com» is the FQDN-name of the AGPM server. If you have another port than 4600 and/or another installation directory of your client, please adapt it (hust check before you delete anything).

  • I got similar error, I had to reboot the web server.

    Could not connect to net.tcp://testwe01/Services/Jse.EquitySystem.DataService/PricesDataService.svc

    The connection attempt lasted for a time span of 00:00:01.0312568. TCP error code 10061: No connection could be made because the target machine actively refused it xx.xx.xx.xxx:808.

  • I hosted a wcf service application using windows services. When my client (ASP.NET) tries to call the service class hosted by the windows service, I get this error «TCP error code 10061: No connection could be made because the target machine actively
    refused it. «. Is there a fix for this? The same code works fine if I host it using a console application.

    https://hipmusic.co/

    • Edited by
      HezekiahNig
      Thursday, July 25, 2019 11:20 PM

Android Studio’s ADB (Android Debug Bridge) is a command-line tool to communicate with an Android device (either through a USB or by using TCP protocol). Many users, when issuing an ADB command e.g., adb connect, they encounter the ADB error 10061 with the following type of message:

How to Fix ADB Error 10061

The ADB error 10061 means that the remote device is refusing the client’s TCP connection request (either the IP or port). This error can occur due to many reasons but the following can be categorized as the main:

  • Outdated System’s OS, Android Studio, or Device Drivers: The incompatibility between the system’s OS, Android Studio, or device driver (if any one of these is outdated) may lead to the error 10061.
  • Improper Configuration of the USB Debugging: USB Debugging on the Android device is essential for the first authorization of the Android device to connect to ADB and if it is disabled or the proper connection method (like File Transfer, etc.) are not used, then ADB may fail to make a connection with error 10061.
  • ABD’s Usage of Other Network Adapters: ADB is not good in handling multi-networks on a system and if your system is using multiple networks (like Ethernet and Wi-Fi connection at the same time), then it may lead to the current ADB error.
  • Improper ADB Commands Used: If the proper ADB commands are not used (like not disconnecting from a previous session), then ADB may show the error at hand.

Update the PC’s OS to the Latest Build

The ADB error 10061 could be a result of the incompatibility between the outdated PC’s OS and other system modules (especially, related to ADB). In such a case, updating the PC’s OS to the latest build may solve the problem. For elucidation, we will discuss the process of updating a Windows PC.

  1. Click Windows, search and open Check for Updates.
  2. Now, in the right pane of the resulting window, click on Check for Updates, and if some updates are available, download and install the updates (optional updates as well).
    Check for Windows Updates
  3. Once the PC’s OS is updated, restart the system and check if the ADB error 10061 is cleared.

Update the Android Studio and SDK Platform Tools

‘No connection could be made ADB error 10061’ can be a result of an outdated Android Studio or SDK Platform-tools as it may lead to incompatibility with the OS/host device. Here, updating the Android Studio and SDK Platform Tools may solve the problem.

  1. Launch the Android Studio and expand its File menu.
  2. Now select Settings and in the left half of the resulting menu, expand Appearance and Behavior.
    Open Android Studio’s Settings
  3. Then expand System Settings and head to the Updates tab.
  4. Now, in the right half of the window, click on Check Now and if an update is available, download and install the update.
    Check for Updates of Android Studio
  5. Then relaunch the Android Studio and check if the ADB error 10061 is cleared.
  6. If not, again head to the System Settings tab of the Android Studio Settings and in the left pane, select Android SDK.
  7. Now, in the right pane, check if an update of the relevant packages is available. If so, download and install the update.
    Update SDK Platform and SDK Tools in the Android Studio
  8. Afterward, relaunch the Android Studio and check if the no connection could be made issue is resolved.

Update the Android Device Driver or Use an OEM-Provided Driver

If the driver of the Android device is outdated or improper in the system’s Device Manager, then you may encounter the ADB error 10061 in the Android Studio as it can cause incompatibility between the system and target machine. In this context, updating the Android device drive to the latest build or using an OEM-provided driver may solve the problem.

  1. Right-click on Windows and select Device Manager.
  2. Now, try to find the Android device in the options shown. You may find it under any of the different categories like Android devices, Android phones, portable devices, other devices, or USB controllers.
  3. Once found, right-click on the Android device and select Update Driver.
    Update the Android Device Driver in the Windows Device Manager
  4. Then click on Search Automatically for Drivers and if no update is available, then click on Search for Updated Drivers on Windows Update.
  5. If an updated driver is available, download and install the update.
  6. Once installed, restart your system, and upon restart, check if the ADB issue is resolved.
  7. If not, steer to the OEM website (like Huawei) and download the latest drivers as per the phone’s model.
  8. Now, right-click on the downloaded driver and select Run as Administrator.
  9. Then follow the prompts on the screen to install the driver and afterward, restart your system.
  10. Upon restart, check if the ADB error 10061 is cleared.
  11. If this doesn’t work, right-click on the Android device in the Device Manager and select Update Driver.
  12. Now, select Browse My Computer for Drivers and click on Let Me Pick from a List of Available Drivers on My Computer.
  13. Then select another driver and apply the changes made.
  14. Now restart your system and upon restart, check if the ADB issue is cleared.
  15. If this didn’t do the trick, then you may try all the other Android device drivers in the Device Manager one by one and check if any of the drivers solve the problem.

Disconnect the VPN on the System and Android Device

The Android Studio requires that both devices should be on the same network and if any of these devices have a VPN enabled on them, then the Android Studio may fail to find the other device on the same network, resulting in the ADB error 10061. In this context, disconnecting the VPN on both devices may solve the problem.

  1. Expand the hidden icon of the system tray and double-click on the VPN icon (e.g., AnyConnect).
    Disconnect VPN
  2. Then select Disconnect and then, on the Android device, swipe up (or down) to show the Notifications tray of the device.
  3. Now, tap on VPN (if shown) and then tap on Disconnect.
  4. Once both devices are disconnected from the VPN, re-launch Android Studio, and while keeping the Troubleshoot device connection issues tab opened on the Studio, check if the target machine actively refused connection error 10061 is resolved.
  5. If that did not work, then check if disabling/enabling the Wi-Fi of the Android device solves the ADB problem.

Disable Other Network Adapters on the System

For proper functioning of the ADB, Android Studio requires both devices to be on the same network but the ADB debug bridge is not good at handling multiple networks. So, the usage of multiple networks (Ethernet or Wi-Fi) on a system may trigger the ADB behavior under discussion. In this scenario, disabling other network adapters on the system may solve the problem.

  1. Right-click on Windows and select Network Connections.
  2. Now, select Change Adapter Options and right-click on any of the network adapters.
    Open Change Adapter Options
  3. Then select Disable and repeat the same on all the network adapters except the Wi-Fi adapter.
    Disable Ethernet Adapter in Network Connections
  4. Now restart the Android Studio and check if the ADB error 10061 is cleared.
  5. If that did not work, expand the hidden icon of the system tray and click on the Wi-Fi icon.
  6. Now select Airplane Mode and on the Android Device, swipe up (or down) to expand the Notifications tray of the device.
    Enable Airplane Mode of the System
  7. Then tap on the Airplane icon and afterward, enable the Wi-Fi on both devices (without disabling the Airplane mode).
    Enable the Airplane Mode
  8. Now re-launch the Android Studio and check if the ADB error 10061 is cleared.
  9. If the issue persists, check if disabling Wi-Fi in the router (not restarting the router) and then enabling it back solves the problem.

If that did not work, check if using Microsoft’s Your Phone app to connect the system/device and then executing the ADB commands solve the problem.

Edit the USB Debugging Settings of the Android Device

The USB debugging is an essential component of the ADB mechanism and if its settings are misconfigured, then ADB may show the warning of no connection could be made because the target machine actively refused it (10061). In this scenario, properly configuring the USB debugging of the Android device may solve the problem.

Enable USB Debugging in the Android Device Settings

  1. Firstly, enable the Developer Options of the Android device and then open the Android Settings.
    Open Developer Options
  2. Now open Developer Options and enable USB Debugging (if disabled), otherwise disable/enable the USB Debugging. Keep in mind that for some Android models (like MXQ Pro), you may find the USB Debugging option in Apps > Settings (not in Android Settings).
    Enable USB Debugging
  3. Then execute the following in the elevated Command Prompt on the system:
    adb connect <DeviceIP:Port>.

    Use the ADB Connect Command
  4. Then confirm the connection on the Android phone’s screen and check if the ADB error 10061 is cleared.
  5. If not, Revoke USB Debugging Authorizations and enable the Allow ADB Debugging in Charge Only Mode (some Android models might show the Allow ADB Debugging in Load Only Mode option) to check if that solves the problem.
    Revoke USB Debugging Authorizations
  6. If that did not work, check if disabling the Aggressive Wi-Fi to Cellular Handover in the Developer’s Options solves the problem.
    Disable Aggressive Wi-Fi to Cellular Handover

Enable Wireless, Network, or Bluetooth Debugging

  1. Launch Settings of Android 11 (or above) and open its Developer Options.
  2. Now enable Wireless Debugging and then click on Allow in the Allow Wireless Debugging on This Network. If you trust and want to regularly use the wireless debugging feature on the current network, then checkmark Always Allow on This Network.
    Enable Wireless Debugging
  3. Now, on the system’s elevated Command Prompt, execute the following:
    adb pair [Phone_IPAddress]:[PORT] [PAIRING CODE]

    Use the ADB Pair Command
  4. Once successful, execute the following and check if the ADB error 10061 is cleared:
    adb connect [Phone_IPAddress]:[PORT]

Keep in mind that some Android TV devices may show a Network ADB option. Also, if you are trying to connect to a smart Android device (like a watch), then you may enable Bluetooth Debugging in the device settings.

Change the USB Connection Mode to the File Transfer

  1. Launch the Android device settings and open Developer Options.
  2. Now tap on Revoke USB Debugging Authorizations and connect the device with the PC via a USB cable.
  3. Once connected, swipe up (or down) to open Notifications Tray and tap on USB Usage Mode.
  4. Then select File Transfer and execute the following in the elevated Command Prompt to check if the error 10061 is cleared:
    adb connect <DeviceIP:5555>

    Use the Transfer Files Mode of USB
  5. If that did not work, check if changing the USB Connection Mode to Camera solves the problem.
  6. If the issue persists, check if disabling Stay Awake in the Developers Options solves the problem.

Execute the Different ADB Commands with Different Parameters

The ADB connection may get refused by the target machine if a wrong parameter is used in the ADB command e.g., if the device’s IP was changed after a restart and the previous IP was used in the ADB command, then a user may encounter the error 10061. In this context, executing the ADB command with different parameters may solve the connection refused error. But before going to that route, check if restarting everything involved in the process like Android Studio, computer, router, phone, etc. solves the problem.

Check the IP of the Target Device

  1. Open the Android phone settings and tap on Wi-Fi.
  2. Now, click on the hamburger icon and select Advanced Settings.
    Open Advanced Wi-Fi Settings of Phone
  3. Then check the IP address of the Android device and make sure you are executing the following in the elevated Command Prompt on the system with the correct IP:
    adb connect <DeviceIP>

    Check the Phone’s IP Address
  4. Afterward, check if the connection actively refused issue is resolved. 

Disconnect ADB from the Other Devices

If multiple devices are being used with the Android Studio or the same Android device is connected after some time, then a connection with the other device or previous connection to the current device might cause the target machine to actively refuse the connection. In such a case, disconnecting ADB from the other device may solve the problem.

  1. Right-click on Windows and search for Command Prompt.
  2. Now right-click on Command Prompt and in the mini-menu, choose, Run as Administrator.
  3. Then, execute the following:
    adb disconnect

    Use the ADB Disconnect Command
  4. Now relaunch the Android Studio and execute the following to check if the ADB connection is successful:
    adb tcpip 5555
    
    adb connect <the_device_ip>
  5. If that did not work, then execute the following command in the elevated Command Prompt:
    adb devices
  6. If there are multiple devices shown like the following:
    List of devices attached
    
    dfdcdc9c device
    
    emulator-5554   device
  7. Then you may execute the TCPIP and connect commands as the device ID but add -s to them like the following:
    adb -s dfdcdc9c tcpip 5555
    
    adb -s dfdcdc9c connect <ip addr>
  8. Now check if the ADB error 10061 is cleared.

Use a Continual Ping on the System with Other ADB Commands

If that did not work,  you may set up a continual Ping on the system to check if the system can connect to the device IP and then execute the ADB commands afterward.

  1. Launch the elevated Command Prompt on the system and execute the following (whenever you have to stop the Ping command, use the Ctrl+C shortcut):
    ping -t (DeviceIP)

    Run Ping Command in the Command Prompt
  2. If the connection is successfully made, connect the device and system through a USB cable.
  3. Now try the following ADB commands to check if the issue is resolved.
    adb disconnect
    
    adb kill-server
    
    adb start-server
    
    adb usb
    
    adb devices
    
    adb tcpip 5555
  4. Then unplug the USB cable from the system and execute the following command in the system’s elevated Command Prompt:
    adb connect <DeviceIP:Port>
  5. After a successful connection, you may expand Studio>>Run and then select Device to check if the ADB error is cleared.

If the ping command failed at step 2, then try to find out the networking issue causing the ADB error.

Use a Different Port in the ADB Commands

If the above ADB commands did not work, then the issue could be due to the wrong port number used in the commands. Here, trying different port numbers might solve the problem.

  1. Repeat the steps mentioned above but at the TCPIP command execute the following:
    adb tcpip 5557
    
    adb connect (DeviceIP)
  2. And then execute the following:
    adb tcpip 5555
    
    adb connect (DeviceIP)

Keep in mind some devices have port 5555 closed by default (like a Mi Box) and to open the required port, you may have to connect the device with a USB to the system and execute the following:

adb tcpip 5555

Also, do note that the port will be closed if the device restarts and you may have to repeat the above step to open the required port.

Use the IP Address of the Local Host in the Command if Using an Android Emulator

If the issue is occurring with an Android emulator, then it could be a result of the ADB attempts to connect to the localhost over IPv6 (that will be “::1”, not, 127.0.0.1). In this context, using the IPv4 address of the local host may solve the problem.

  1. Execute the following in the elevated Command Prompt on the system:
    adb forward tcp:4444 localabstract:/adb-hub
    
    adb connect 127.0.0.1:4444
  2. Then check if the ADB connection issue is resolved.
  3. If that did not work, then check if using the ADB connect command without specifying a port number solves the problem.
    adb connect 127.0.0.1

Use the ADB Connect to the IP Address of the Local Host

If none of the above did the trick for you, then you may try an ADB plugin (like Wi-Fi ADB Ultimate or scrcpy) to solve the issue. If that did not work, then you may reset the system or phone to the factory defaults. For some advanced techies, adding the device’s IP to the ARP table of the system may solve the problem.

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка no camera are attached
  • Ошибка no signal detected как исправить