Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Could not listen/forward on any port in range #2468

Closed
2 tasks done
andregs opened this issue Jul 8, 2021 · 7 comments
Closed
2 tasks done

ERROR: Could not listen/forward on any port in range #2468

andregs opened this issue Jul 8, 2021 · 7 comments

Comments

@andregs
Copy link

andregs commented Jul 8, 2021

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: Windows 10 Pro Version 20H2 OS build 19042.1052
  • scrcpy version: scrcpy-win64-v1.18
  • installation method: Windows zip release
  • device model: moto g9 play
  • Android version: 11

Describe the bug
I've been using scrcpy via USB for some time with no issues, but at some point it's no longer working. I believe that's because I recently upgraded from Android 10 to 11, but I'm not sure.

11:43 andre> adb logcat -c
11:43 andre> C:\Apps\scrcpy-win64-v1.18\scrcpy.exe --stay-awake --turn-screen-off --prefer-text
INFO: scrcpy 1.18 <https://github.com/Genymobile/scrcpy>
C:\Apps\scrcpy-win64-v1.18\scrcpy-server: 1 file pushed, 0 skipped. 32.1 MB/s (37330 bytes in 0.001s)
bind: No error
WARN: Could not listen on port 27183, retrying on 27184
bind: No error
WARN: Could not listen on port 27184, retrying on 27185
bind: No error
                     (...)
WARN: Could not listen on port 27198, retrying on 27199
bind: No error
ERROR: Could not listen on any port in range 27183:27199
WARN: 'adb reverse' failed, fallback to 'adb forward'
WARN: Could not forward port 27183, retrying on 27184
adb.exe: error: cannot bind listener: cannot bind to 127.0.0.1:27184: An attempt was made to access a socket in a way forbidden by its access permissions. (10013)
ERROR: "adb forward" returned with value 1
WARN: Could not forward port 27184, retrying on 27185
adb.exe: error: cannot bind listener: cannot bind to 127.0.0.1:27185: An attempt was made to access a socket in a way forbidden by its access permissions. (10013)
ERROR: "adb forward" returned with value 1
                     (...)
WARN: Could not forward port 27198, retrying on 27199
adb.exe: error: cannot bind listener: cannot bind to 127.0.0.1:27199: An attempt was made to access a socket in a way forbidden by its access permissions. (10013)
ERROR: "adb forward" returned with value 1
ERROR: Could not forward any port in range 27183:27199
11:43 andre> adb logcat -d > logcat.txt

See also attached logcat.txt.

Thanks for the great app, by the way. I really love it!

@rom1v
Copy link
Collaborator

rom1v commented Jul 8, 2021

Probably a firewall which prevents you to listen on a port?

@andregs
Copy link
Author

andregs commented Jul 8, 2021

Hmm, I don't think so. I have only standard Windows Defender firewall, and I just disabled it but I still get the same error.

@rom1v
Copy link
Collaborator

rom1v commented Jul 8, 2021

You have a permission problem to listen on a port, I don't know why.

@andregs
Copy link
Author

andregs commented Jul 8, 2021

Yeah, it really seems to be unrelated to scrcpy, right? I cannot even connect to my device via tcpip

14:40 andre> adb.exe tcpip 5555
14:41 andre> adb connect 192.168.1.105:5555
cannot connect to 192.168.1.105:5555: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. (10060)

@KalanjaliParikisetty
Copy link

C:\Users\Admin\Downloads\scrcpy-win64-v1.18>scrcpy
INFO: scrcpy 1.18 https://github.com/Genymobile/scrcpy
adb: error: failed to get feature set: no devices/emulators found
ERROR: "adb push" returned with value 1

C:\Users\Admin\Downloads\scrcpy-win64-v1.18>

@andregs
Copy link
Author

andregs commented Jul 9, 2021

Nevermind. After applying latest windows updates and restarting both the phone and the laptop, the issue was fixed. Thanks for the help!

@vnaz
Copy link

vnaz commented Feb 8, 2022

netsh interface ipv4 show excludedportrange protocol=tcp

Protocol tcp Port Exclusion Ranges

Start Port    End Port
----------    --------
     26505       26604
     26605       26704
     26705       26804
     26805       26904
     26905       27004
     27005       27104
     27105       27204
     50000       50059     *

* - Administered port exclusions.

to resolve an issue I did use following command:

scrcpy --tcpip -p 27206:27220

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants