uiautomator icon indicating copy to clipboard operation
uiautomator copied to clipboard

curl: (7) Failed to connect to localhost port 9008: Connection refused

Open Andrew3019 opened this issue 4 years ago • 0 comments

C:\Users\Andrew>adb shell curl -d '{"jsonrpc":"2.0","method":"deviceInfo","id":1}' -v localhost:9008/jsonrpc/0
adb server is out of date.  killing...
* daemon started successfully *
*   Trying 127.0.0.1...
* TCP_NODELAY set
* connect to 127.0.0.1 port 9008 failed: Connection refused
* Failed to connect to localhost port 9008: Connection refused
* Closing connection 0
curl: (7) Failed to connect to localhost port 9008: Connection refused
Traceback (most recent call last):
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1349, in getresponse
    response.begin()
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 316, in begin
    version, status, reason = self._read_status()
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 285, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\uiautomator\__init__.py", line 427, in wrapper
    return _method_obj(*args, **kwargs)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\uiautomator\__init__.py", line 112, in __call__
    res = self.pool.urlopen("POST",
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\poolmanager.py", line 336, in urlopen
    response = conn.urlopen(method, u.request_uri, **kw)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 726, in urlopen
    retries = retries.increment(
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\retry.py", line 410, in increment
    raise six.reraise(type(error), error, _stacktrace)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\packages\six.py", line 734, in reraise
    raise value.with_traceback(tb)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 426, in _make_request
    six.raise_from(e, None)
  File "<string>", line 3, in raise_from
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 421, in _make_request
    httplib_response = conn.getresponse()
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1349, in getresponse
    response.begin()
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 316, in begin
    version, status, reason = self._read_status()
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 285, in _read_status
    raise RemoteDisconnected("Remote end closed connection without"
urllib3.exceptions.ProtocolError: ('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\Andrew\Desktop\Coding\CSGO-Tradeups\Purchase Bot\android_buff_automation.py", line 5, in <module>
    print(d.info())
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\uiautomator\__init__.py", line 594, in info
    return self.server.jsonrpc.deviceInfo()
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\uiautomator\__init__.py", line 431, in wrapper
    server.start(timeout=30)
  File "C:\Users\Andrew\AppData\Local\Programs\Python\Python39\lib\site-packages\uiautomator\__init__.py", line 491, in start
    raise IOError("RPC server not started!")
OSError: RPC server not started!

RPC server does not start. I have tried the "-t" "-r" fix, and I have tried two different phones.

Andrew3019 avatar Dec 25 '21 04:12 Andrew3019