-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 listening on port 6007 after deploying once on Android and closing the game on the mobile device #41650
Comments
Error still not fixed. Changing remote port to 6008 removes the error but the debugger still gets disconnected for me, and then the last output is "Connection Taken". |
This may be fixed by #37067 if it's merged. |
Need to debug a custom build with an Android local notification plugin and hard to do that without the debugger working 😄 Fingers crossed. |
I also have this issue. Hoping it gets resolved with the PR above.
Signing out and in again gets rid of it as well. |
Yeah you can iterate hundrets of ports and than you can down-iterate after restart... thats not realy a solution, thats a work around with risks. |
@lefavilla That is indeed true. It was never meant as go-to solution. It is a workaround, yes, but a better one than restarting your computer. I only meant to give an easier workaround for people, who may not know the configurability of the debugger port. FYI the mentioned PR does excactly what you can do by hand, only that it provides better usability 😃 |
I'm still having this error as of 3.3.1 |
AFAIK there is a fix in 3.4. (in the 3.x branch I used yesterday to compile the engine) |
Indeed, #37067 has been merged in the |
In 3.4.2 after one deploy to Android, I get this error: " Remote debugger failed listening on port: 6007 Retrying on new port: 6008 but the debugger still doesn't connect on the new port. |
Does this occur when running a project from two different editor instances on your own machine? |
Happens with 1 or 2 instances. However, I just noticed it only happens when "Use Custom Build" is enabled in Export (I'm using the Google Play Billing Plugin). |
Also changing the port, like suggested above, does not fix it - debugger gives "Connection taken" and does not work, neither on further Android deploys nor any other ones, so after one custom build Android deploy the debugger is gone unless you restart the pc. I hope this can be fixed, as it makes debugging almost impossible when using custom builds on Android, forcing you to having to restart your pc after every deploy. |
As a workaround, you can probably kill the debugger process using a task manager. |
I wanted to do that, but after killing every Godot process (which was not enough) I did not found any more that I could relate to it. Is the debugger a separate process in itself, if so what is it called? |
It may be an |
Killing adb doesn't free it up, andd I can't find any process that might be related to it... |
There are ways to check which software eats the port. If you use Windows, follow this guide: https://www.maketecheasier.com/check-ports-in-use-windows10/#:~:text=1%20How%20to%20Check%20for%20Ports%20in%20Use,app%20and%20want%20to%20have%20more%20control%20 |
Also getting this on 3.4.2 stable. netstat showing some process using the port but I can't kill them. The only workaround so far that has worked for me is from here by setting remote host to 0:0:0:0:0:0:0:1 and the remote port to a different one in editor > editor setting > network https://godotforums.org/discussion/23142/port-6007-error-when-disconnecting-android-test-device |
hello ,I got this problem too. and have to restart computer to fix it. |
I also started to get this error when i run debug on android over usb (v 3.4.3). It starts to appear after ending of the first debugging session:
My workaround is the following (killing the gradle daemon):
🤷♂️ |
Reply to myself: after project reload remote debugger on android started to work normaly. |
I've just hit this exact problem on Godot 3.5 Stable (downloaded from official Godot site). Have "custom build" switched on for GodotGooglePlayBilling. Killing Java.exe allows the console output to come back, but breakpoints still don't work. Restarting Godot makes no difference to breakpoints. |
I can confirm this is still happening with Godot 3.5 stable, custom build. I can use the command yurii-sio2 posted above (#41650 (comment)) to get the debugger working again When I turn off the custom build option, the debugger correctly disconnects. |
Still present in 3.5.2 Stable, Custom build on, using OpenXR for a VR project, the solution provided by yurii-sio2 works, but is quite lame to wait an extended amount of time for it do it's initial build. (ontop of already waiting for the project to reload; you all know the process) |
Another workaround I found: right after the first deploy to android, change the remote debug port in editor setting to be something different then current port and current port+1 (so if its 6007 change to 6009). Subsequent deploys will work as expected. This is on 3.5.1 |
BTW this is probably fixed incidentally in Godot 4.0. What likely happens here is:
So @NanitesNanites' workaround to change Godot's default port should indeed work, provided that the N+1 port is not already taken by another process on your system. The proper fix for this here though, is that at (2.), Godot should someone figure out that the process was terminated and make sure the port is released. |
The comment by @akien-mga was the key for me. |
You mean Editor->Settings->Language Server? @akien-mga worth making a PR for 3.x to change the LSP port? It's not a full fix but a workaround, but it works and should remove a lot of annoyance from those who don't know about the manual workarounds. |
I mean Remote Port |
This will break the LSP. We did that change in 4.0 and it broke plugins, which now don't know whether they should use the Godot 3.x port or the Godot 4.0 port. The situation will smooth itself out over time as more users move to Godot 4+ but we shouldn't break compatibility on Godot 3. |
I can confirm this still happens with Godot 4.0.2 build with this same exact problem : i have enabled the GodotPlayBilling plugin
edit: the workaround i have found is to go to task manager and find Java.exe and ending the process. it supposedly stops the gradle process and closes the port along with it. |
Godot 4.1 Stable; Quest 2 debug export No longer getting the "error listening on..." but the symptom persists with the changing of the remote port fixing the issue for regular output and debugging. The Quest [2] however still freezes up as if it's still connected, just no output from the console. May be a completely different issue now or not, not sure; wanted to mention it tho. Edit: I got the console to run normally without messing with the remote port, sometimes. I think it's something on my end. Glad no one noticed >.> |
Found some more information on this issue at #82764 (comment). There are two different issues going on here:
https://serverfault.com/questions/181015/how-do-you-free-up-a-port-being-held-open-by-dead-process
Error EditorExportPlatformAndroid::run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) {
...
// This should be changed to the port used by EditorDebuggerServerTCP
int dbg_port = EDITOR_GET("network/debug/remote_port");
...
} |
Godot version: 3.2.2 stable mono
Issue description:
Everytime when I launch an android debug build with custom build enabled direct to my smartphone and/or virtual test device godot can no longer connect to port 6007 if I deploy a second time. Due to this I get no prints or debug informations.
On 2nd build also play button, webbuild and such builds won't produce any prints or debug informations with same error.
I have to restart my computer to get rid of the blocked port. If I launch direct to android again I have to restart again.
Error: "error listening on port 6007".
Even if I kill the pid sitting on this port the problem won't vanish.
Steps to reproduce:
Build a project with custom build checked per direct deploy to any android device. Do it again and the error appears.
Minimal reproduction project:
simple 2d scene with custom build checked for android.
The text was updated successfully, but these errors were encountered: