Can't Connect to Minecraft Server When Remote Debugging With IntelliJ - debugging

The remote debugging is working, but when I have IntelliJ open and the remote debugging profile active, I'm not able to join the Minecraft server with my actual player at all (via localhost). When connecting, it simply says "Disconnected" and shows nothing in the console. I can, however, join the server before loading IntelliJ and using Remote JVM Debug afterwards but when I disconnect, I'm not able to log in again (other servers work fine). The server will not poll after IntelliJ has launched with the profile active (doesn't have to be debugging). I see no other errors anywhere.
Here's what I've tried:
Running JDK19 on server and client
Switching ports and using 127.0.0.1 instead
Using JAR Application configuration
Using Remote JVM Debug configuration
Disabling MacOS Firewall (since been re-enabled)
Other stuff I copied... might be useful:
IntelliJ Versions:
IntelliJ IDEA 2022.3 (Community Edition)
Runtime version: 17.0.5+1-b653.14 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Server Info/Device Info:
Connected to the target VM, address: '127.0.0.1:55637', transport: 'socket'
Starting org.bukkit.craftbukkit.Main
System Info: Java 19 (OpenJDK 64-Bit Server VM 19.0.1+10-21) Host: Mac OS X 13.1 (aarch64)
2023-01-28 16:21:45,022 ServerMain WARN Advanced terminal features are not available in this environment
Server Version:
[16:21:49 INFO]: This server is running Paper version git-Paper-381 (MC: 1.19.3) (Implementing API version 1.19.3-R0.1-SNAPSHOT) (Git: 42fecd0)
Minecraft Client Log:
[15:32:04] [Render thread/INFO]: Connecting to localhost, 25565
[15:32:13] [Render thread/INFO]: Connecting to localhost, 25565
[15:33:29] [Render thread/INFO]: Connecting to localhost, 25565

Screenshot
I figured it out. For whatever reason, the "built-in server debugger" was already set to 25565. Not sure if I set that, but changing it to 25560 fixed the problem!
Settings > Build, Execution, Deployment > Debugger...Built-in Server

Related

Issues connecting Vagrant Xdebug with PhpStorm 2020.3

Have spent over a day trying to get PhpStorm to debug a Drupal site inside a Vagrant virtual machine running Xdebug and I feel I'm close - but just not quite there yet.
Currently, in PhpStorm when debugging I have an error:
Waiting for incoming connection with ide key 'PHPSTORM'
In the Xdebug log in the VM (at /tmp/xdebug.log)
[2094] I: Checking remote connect back address.
[2094] I: Checking header 'HTTP_X_FORWARDED_FOR'.
[2094] I: Checking header 'REMOTE_ADDR'.
[2094] I: Remote address found, connecting to 192.168.88.1:9000.
[2161] E: Time-out connecting to client (Waited: 200 ms). :-(
[2161] Log closed at 2020-12-15 04:25:32
I tried setting up the Zero-configuration debugging without any luck.
For the debugging configuration, I have a PHP Remote Debug that validates correctly although it always defaults to the 'Local Web Server or Shared Folder' rather than the 'Remote Web Server' option.
When I started the project I set it up as a local web server option and I'm worried that I haven't changed the correct settings to now make this a remote web server. The connection type for the deployment is now 'Local or mounted folder' but originally this was 'In-place'.
Under Languages & Frameworks --> PHP --> Servers, I set this up on port 80, using Xdebug and without path mappings. I tried changing the port etc but then it doesn't validate so I'm confident that the server settings are correct and that PhpStorm is talking to the virtual machine correctly.
I changed the /etc/php/7.4/cli/php.ini file but phpinfo() says the configuration is coming from /etc/php/7.4/fpm/php.ini. The changes I made in the php.ini file are active though. phpinfo() is showing:
xdebug.idekey: PHPSTORM
xdebug.remote_host: 10.0.2.2
xdebug.remote_port: 9000
xdebug.remote_autostart: Off
xdebug.remote_connect_back: On
Really at a loss now as to what to try next. It is incredibly frustrating so hope someone can shed some light.
EDIT --- As per comment here is the screenshots of the setup:
Deployment: Local or mounted folder
PHP settings
The server setup
Debug settings
Validate the debugger from the remote server
Run Chrome with the debug addon running
The error message
The Run debug configuration settings
Start of the phpinfo with the config file showing where the xdebug settings need to be edited.
The Xdebug settings of phpinfo()
Some of the tests as per the comments:
After logging in to 'vagrant SSH' it shows the IP address to be used (10.0.2.2). The local computer is also IP 10.1.1.150 a telnet test of both of these works.
A 'sudo nano' of the Xdebug ini file
NOTE: Changing the remote connect back to 0 fixed the connection:
xdebug.remote_connect_back=0
And then the path mapping needed to be turned on in the Server settings and then everything was working correctly.
Big thanks to LazyOne for his helpful and thorough comments. :)
1) Check if there are separate php.ini files used by web server, -- you need to edit the right php.ini file.
Run phpinfo() and check to see if there is an ini file for Xdebug. In my case this was at /etc/php/7.4/fpm/conf.d/20-xdebug.ini
2) What's your Xdebug version?
Version 2 and 3 of Xdebug have slightly different parameters. In my case I was running Xdebug 2.9.5
3) What is the IP address of your Host OS as seen from the inside the VM? That's where Xdebug should connect (as it's Xdebug that connects to IDE and NOT other way around).
When you first log in to the SSH there will be an IP address shown. This is what the IP should be for Xdebug. In my example, this was 10.0.2.2
4) xdebug.remote_connect_back: On -- try set it off and ensure that you have correct xdebug.remote_host (as Xdebug v2 may not fallback to remote_host value when autodetected IP fails.
This fixed my connection!
sudo nano /etc/php/7.4/fpm/conf.d/20-xdebug.ini
Then change:
xdebug.remote_connect_back=1
To:
xdebug.remote_connect_back=0
Save, and then restart the server.
Test the connection again. After this step I had a connection between the host and remote server but I also had to turn on path mapping in PhpStorm to get the debugger working 100%.
5) Ensure that PhpStorm is the one that listens on Xdebug port when "phone handle" icon is enabled (use netstat or alike to confirm) and is allowed in firewall.
6) If you know the correct IP and sure that PhpStorm is listening -- you can just use telnet from inside the VM and try to connect to IDE on Xdebug port -- if connected then IP, port and firewall is most likely set up correctly.
Even with the error messages, the telnet check was working. So it pointed to the issue being with the Xdebug setup rather than the handshaking between the host and remote server.
Thanks to LazyOne's comments for finding the answer and for presenting a great workflow to help identify the problem.
I was experiencing something very similar to what you described.
I was able to start a debug session from the xdebug cli tool (dbgpClient) which proved to me that it was an issue with phpStorm.
My project is using a legacy version of xdebug. (2.2.7)
Downgrading to phpStorm 2020.2.4 resolved my issue.
(It's one-click in the jetbrains toolbox to downgrade)
Thanks for the answers in this issue. It took me half a day to find out that xdebug 2.2.7 with php5.3.10 doesn't work on Phpstorm 2020.3. So I downgraded to 2020.2.4 and it works again.

Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code

I am trying to run a Jmeter test on remote machine ( macOS sierraO).
I configured jp#gc - Chrome Driver Config and I can connect to the slave machine. However, whenever I try to run it I get
Starting ChromeDriver 73.0.3683.20 (XXXXXXX) on port XXXX
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Mar 08, 2019 12:12:35 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: OSS
Using local port: XXXXXX
2019-03-08 13:04:39.171 java[10402:23852395] IMKInputSession [0x7f8bcbaaf740 presentFunctionRowItemTextInputViewWithEndpoint:completionHandler:] : [self textInputContext]=0x7f8bcbb578f0 *NO* NSRemoteViewController to client, NSError=Error Domain=NSCocoaErrorDomain Code=4099 "The connection from pid 0 was invalidated from this process." UserInfo={NSDebugDescription=The connection from pid 0 was invalidated from this process.}, com.apple.inputmethod.EmojiFunctionRowItem
I know this is related to the security consideration, but I couldn't find a way to solve for my use case.
My use case is:
I am running jmeter test using:
Run remote server directly from Jmeter 5.1
Run using java-maven-plugin project.
Any thoughts how to configure chromeDriver to run on remote server would be appreciated.
lease protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Solution:
Get your Chrome Browser version and download the ChromeDriver for specific to that version.
Open your Chrome browser > Click on 3 vertical dots (top right corner) > Help > About Google Chrome
Verify the Chrome Version (such as 73 or 74 or other ..)
goto Selenium browser driver download portal and download the Chrome Driver of that version
https://sites.google.com/a/chromium.org/chromedriver/downloads
I could not pass any parameters to chromedriver from p#gc - Chrome Driver Config directly, my config looks like:
where my chromedriver.dir was chromedirver.dir=vu.chromedriver.dir=/path/to/chromedriver
However, I was able to work around it by adding:
workaround.sh for macOS
#!/usr/bin/env bash
/path/to/chromedriver --whitelist-ip $*
workaround.bat for Windows
\\src\\path\\to\\chromedriver.exe --whitelist-ip %*
And that solved my issue for making chromedriver to accept remote connections.
I had the same issue. I fixed by changing to Chromedriver version 80.0.3987.106

Debug J2EE Applications on IntelliJ Community Edition and Tomcat8 (running as a service)

I've searched a lot on Remote Debugging a REST APIs written in Java using IntelliJ IDEA Community Edition.
My Setup:
Windows 10
Tomcat installed as a windows service
Java 8
Intellij Community IDE
Finally after some googling and sifting through SO, found a solution that works. Posting it below.
Part I. Running Tomcat in Debug Mode
When running Tomcat8 as a service
Open {$TOMCAT_HOME}\bin\Tomcat8w.exe
Under Java > Java Options add the following lines to enable the debug port 8001:
-Xdebug
-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8001
Restart the Tomcat Service
Part II. Attaching IntelliJ IDEA Remote Debugger
Create a new Run Configuration using the Remote Template.
Under Configuration > Settings Change the Port to 8001
Run the new config by clicking on the debug icon and IDEA will connect to the debug port of Tomcat
Credits:
How to remotely debug the webapplication running on tomcat service?

intellij idea 14 cannot connect to debug tomcat7 service

Ok, I think I tried everything before I am posting this question. Please tell me, what I am (Still) missing. I keep getting "unable to connect" exception (unable to connect hostname:6012), I changed from default port 1099 and it still didn't help.
version of IntelliJ 14.0.2
Tomcat 7.0.52
Tomcat is running as a service so, I configured on the UI interface of tomcat.exe (java tab) the following JAVA_OPTs
-Xdebug
-Xrunjdwp:transport=dt_socket,address=57497,server=y,suspend=n
-javaagent:C:\Users\username\.IntelliJIdea14\system\groovyHotSwap\gragent.jar
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=6012
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
-Dcatalina.home=C:\Tomcat 7.0
-Dcatalina.base=C:\Tomcat 7.0
-XX:MaxPermSize=512m
I made sure the port 57497 is open (open the firewall and telnet).
And on IntelliJ, I made a remote server connection. Please find attached
pictures. Both intellij and tomcat are running on the same system. I have a static dns setup. sometimes i get connection timedout exception.
server tab
connection tab
Here's my config.
Tomcat JAVA_OPTs to enable remote debugging:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5007
In IntelliJ, I don't use the Configuration-Type 'Tomcat'. In my case 'Remote' works pretty well (I would post an image but I ain't got 10 reputation...). You only need to configure your host and port on the config sheet.
I use IntelliJ 14.0.3 and I had the same issue, though with Jetty. Switching to using the remote instead of jetty -> remote worked. I'm guessing they're both supposed to work differently. I just haven't figured out why there are two different options to remote debug.

Port conflict while running Integrated weblogic Server in JDeveloper

The message i see when i try to run Integrated Weblogic server is
Port conflicts have been detected and the affected ports have been automatically reassigned to available ports.
Then I am unable to start my server. I have tried restarting the server but it did not help.
Windows
Press Ctrl+Shft+Esc click on Processes, End the JDeveloper(jDev64W.exe in my case) and Java instances(java.exe in my case). Now restart the JDeveloper and try running the Integrated Weblogic Server again.
Linux
Use the command jps -l. Select the process id corresponding to weblogic.server.
Use kill -9 <process-id> to kill the running instance
If it still does not work, restart the computer to ensure all the ports have been released.

Resources