This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 271285 - Connection from Docker host for xdebug
Summary: Connection from Docker host for xdebug
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 8.2
Hardware: PC Windows 10 x64
: P1 normal (vote)
Assignee: issues@php
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-13 21:23 UTC by antoniocs
Modified: 2017-08-14 09:35 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description antoniocs 2017-08-13 21:23:52 UTC
Hey,

So I have a container running php-fpm with xdebug running.
Here are the settings:

xdebug.enable=1
xdebug.remote_enable=1
xdebug.remote_connect_back=0
xdebug.remote_autostart=0
xdebug.remote_handler=dbgp
xdebug.remote_host=10.0.75.1
xdebug.remote_port=9005
xdebug.idekey=docker-xdebug
xdebug.remote_log =/application/xdebug_remote.log
xdebug.remote_cookie_expire_time= 7200

The remote_host has the ip of my host in the docker nat.
This sometimes works others doesn't.

Here is a bit of the output of the xdebug log file:

I: Connecting to configured address/port: 10.0.75.1:9005.
E: Time-out connecting to client. :-(
Log closed at 2017-08-13 21:03:05

Log opened at 2017-08-13 21:03:05
Log opened at 2017-08-13 21:03:05
Log opened at 2017-08-13 21:03:05
I: Connecting to configured address/port: 10.0.75.1:9005.
E: Time-out connecting to client. :-(
Log closed at 2017-08-13 21:03:05

I: Connecting to configured address/port: 10.0.75.1:9005.
E: Time-out connecting to client. :-(
Log closed at 2017-08-13 21:03:05

This is when it doesn't connect but I also have data from when it connects:

Log opened at 2017-08-13 21:06:41
I: Connecting to configured address/port: 10.0.75.1:9005.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" x...<load more lines>

What I see from windows netstat -a is this:

  TCP    10.0.75.1:9005         10.0.75.2:34314        TIME_WAIT
  TCP    10.0.75.1:9005         10.0.75.2:34320        TIME_WAIT
  TCP    10.0.75.1:9005         10.0.75.2:34326        TIME_WAIT
  TCP    10.0.75.1:9005         10.0.75.2:34332        TIME_WAIT
  TCP    10.0.75.1:9005         10.0.75.2:34338        TIME_WAIT
  TCP    10.0.75.1:9005         10.0.75.2:34344        TIME_WAIT

What I have seen when xdebug fails is not TIME_WAIT but CLOSE_WAIT (not sure if relevant)

I believe that netbeans is at fault here because when I start to see that xdebug is not able to connect I restart netbeans and it magically connects back.

Can someone please check this out.

Product Version: NetBeans IDE 8.2 (Build 201705191307)
Updates: NetBeans IDE is updated to version NetBeans 8.2 Patch 2
Java: 1.8.0_101; Java HotSpot(TM) 64-Bit Server VM 25.101-b13
Runtime: Java(TM) SE Runtime Environment 1.8.0_101-b13
System: Windows 10 version 10.0 running on amd64; Cp1252; en_GB (nb)

Docker version 17.06.0-ce, build 02c1d87

The files I am using to run my containers I generated from:

- https://phpdocker.io/generator


Please! Please! Someone verify this bug I just spent days checking xdebug configurations, docker configurations and windows firewall (on/off) and it seems the culprit is Netbeans!!!
Comment 1 antoniocs 2017-08-14 09:35:04 UTC
It seems others have also encountered this issue. 

https://stackoverflow.com/questions/20277240/netbeans-waiting-for-connection-to-xdebug

https://stackoverflow.com/questions/13908010/xdebug-for-remote-server-not-connecting-netbeans

https://askubuntu.com/questions/635983/wating-for-connection-netbeans-xdebug


The fix seems to be to (as I mentioned in my previous post) to restart netbeasn.

This is all fine for small projects but currently I am working on something that has quite a high number of files and so I have to wait for netbeans to do its background scanning etc.

Can someone please fix this???