Open lefavilla opened 4 years ago
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 https://github.com/godotengine/godot/pull/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.
I have to restart my computer to get rid of the blocked port.
Signing out and in again gets rid of it as well.
For the time being, you can edit the port directly in the editor settings. You don't need to sign in and out nor restart your machine.
For the time being, you can edit the port directly in the editor settings. You don't need to sign in and out nor restart your machine.
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.
For the time being, you can edit the port directly in the editor settings. You don't need to sign in and out nor restart your machine.
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)
AFAIK there is a fix in 3.4. (in the 3.x branch I used yesterday to compile the engine)
Indeed, https://github.com/godotengine/godot/pull/37067 has been merged in the 3.x
branch but hasn't been cherry-picked to the 3.3
branch so far. In the meantime, there is a workaround you can use with an editor plugin: https://github.com/godotengine/godot/pull/37067#issuecomment-665863474
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 Connection Taken"
but the debugger still doesn't connect on the new port.
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 Connection Taken"
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?
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). When building the APK, I also get an error from Gradle that it could not reuse a stopped process or something like that (would need to record screen if more information is required as it only shows briefly).
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.
so after one custom build Android deploy the debugger is gone unless you restart the pc.
As a workaround, you can probably kill the debugger process using a task manager.
so after one custom build Android deploy the debugger is gone unless you restart the pc.
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?
Is the debugger a separate process in itself, if so what is it called?
It may be an adb
process or something like that.
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 For Linux distros: https://linuxize.com/post/check-listening-ports-linux/ For macOS: https://www.btaz.com/mac-os-x/find-the-process-listening-to-port-on-mac-os-x/
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. maybe it is because I first open AndroidStudio and run godot ,and Androidstudio somehow block godot from communicating the app
I also started to get this error when i run debug on android over usb (v 3.4.3). "Remote debugger failed listening on port: 6007 Retrying on new port: 6008"
It starts to appear after ending of the first debugging session:
My workaround is the following (killing the gradle daemon):
WMIC PROCESS where "Name like 'java%' AND CommandLine like '%GradleDaemon%'" Call Terminate
🤷♂️
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 (https://github.com/godotengine/godot/issues/41650#issuecomment-1115806561) 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. I've changed the debug port to 7000 in Editor>Settings>Debug and now it's working fine.
I've changed the debug port to 7000 in Editor>Settings>Debug and now it's working fine.
You mean Editor->Settings->Language Server? As changing this actually "fixes" it for good, without having to do something else ever again. You still get the warning that the port was taken every time but it automatically changes to the next one and works.
@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
@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.
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
I also started to get this error when i run debug on android over usb (v 3.4.3). "Remote debugger failed listening on port: 6007 Retrying on new port: 6008"
It starts to appear after ending of the first debugging session:
- run debug for the first time: everything is ok, breakpoints work, I can iterate over the functions.
- stop the program in android (swipe it in recent apps)
run debug again:
- start to get error ""Remote debugger failed listening on port: 6007..."
- debug is not available, I don't get any output from the app in the Output window
- as I can see, breakpoints work (because program freezes if I set any breakpoint), but I have no control over the debugging process, because editor didn't connect to the running app.
My workaround is the following (killing the gradle daemon):
- I run cmd in separate window
- execute the command
WMIC PROCESS where "Name like 'java%' AND CommandLine like '%GradleDaemon%'" Call Terminate
- after this debug stars to work but only the first time.
- after ending of debugging session, I have to kill gradle daemon again.
🤷♂️
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 https://github.com/godotengine/godot/issues/82764#issuecomment-1872582814.
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.