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 254298 - Could not reinitiate cli debug session
Summary: Could not reinitiate cli debug session
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal with 2 votes (vote)
Assignee: junichi11
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-08-12 08:38 UTC by pmaselkowski
Modified: 2017-04-18 13:41 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE log (73.10 KB, text/plain)
2015-08-12 08:38 UTC, pmaselkowski
Details
Example project file (71.99 KB, application/x-compressed-tar)
2015-09-14 10:14 UTC, pmaselkowski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description pmaselkowski 2015-08-12 08:38:02 UTC
Product Version = NetBeans IDE Dev (Build 201508100002) Also tried on 8.0.2
Operating System = Linux version 3.16.0-38-generic running on amd64
Java; VM; Vendor = 1.8.0_51
Runtime = Java HotSpot(TM) 64-Bit Server VM 25.51-b03

Background:
Debug single unit test in cli mode

Behavior:
1. When I click "Debug Project" (cli mode) it runs selected test
2. Status bar hangs on "Waiting for connection" even when tests finished
3. "Debug Project" icon is active, but clicking it does nothing

To re-run "Debug Project" I have to restart IDE.
Comment 1 pmaselkowski 2015-08-12 08:38:08 UTC
Created attachment 155284 [details]
IDE log
Comment 2 Tomas Mysik 2015-09-04 09:56:52 UTC
Does it happen to you with all your PHP projects? Or do you have some other PHP projects where debugger works as expected?

Anyway, I don't see any error related to PHP debugger in thye attached IDE log. But there are some other errors there, so please could you try a clean userdir [1]?

Simply reopen this issue, thanks.
[1] http://wiki.netbeans.org/FaqAlternateUserdir
Comment 3 pmaselkowski 2015-09-14 10:14:19 UTC
Created attachment 156143 [details]
Example project file

Tried with dev builds and 8.1 beta.
Tried to clean user dir, and did not import settings, still no luck.
Tried to cancel "Waiting for connection", it dissapeared after clicking "x". It didn't help.

Every project I tried does not work as expected. I can run tests only once, then I have to restart netbeans.

If it helps, I was developing on windows previously, perhaps some windows leftovers are in project file?

I attached example project. No deps, so test results in fatal error, anyway cannot re-run test.

What bugs me is status bar message "Waiting for connection" like if it was waiting for remote debug, through it's cli debug, should it even show up?
Comment 4 pmaselkowski 2015-10-12 12:38:30 UTC
Found a solution for this, it turned out that for CLI debugging, xdebug still needs to have remote enabled:

xdebug.remote_enable=1

Except above default configuration is used.

Perhaps there should be some timeout for cli debugging? And some error message to give clues on why failed?

Summary:

It hangs on "Waiting for connection" indefinitelly when "xdebug.remote_enable=1" is not set.
When clicked "Stop" button it stops, but could not start debugging again. Clicking again "Debug project" has no effect at all.


Currently tried at build 201510060002
Comment 5 sam002 2015-10-19 11:55:33 UTC
Story: xdebug session had been run for a project from cli and called another project (curl-call, exmpl).
If breakpoint set at the second project (remote called), it was missed.

In another IDE: I can resetting the debug session without  stop listening to the xdebug port (session rerun each remote or cli call).
Comment 6 Tomas Mysik 2015-10-19 12:11:47 UTC
(In reply to sam002 from comment #5)
> Story: xdebug session had been run for a project from cli and called another
> project (curl-call, exmpl).
> If breakpoint set at the second project (remote called), it was missed.
> 
> In another IDE: I can resetting the debug session without  stop listening to
> the xdebug port (session rerun each remote or cli call).

This seems to me to be a different issue, not related to this one. Feel free to report it as a new bug.

Thanks.
Comment 7 sam002 2015-10-19 12:30:42 UTC
(In reply to Tomas Mysik from comment #6)
> (In reply to sam002 from comment #5)
> > Story: xdebug session had been run for a project from cli and called another
> > project (curl-call, exmpl).
> > If breakpoint set at the second project (remote called), it was missed.
> > 
> > In another IDE: I can resetting the debug session without  stop listening to
> > the xdebug port (session rerun each remote or cli call).
> 
> This seems to me to be a different issue, not related to this one. Feel free
> to report it as a new bug.
> 
> Thanks.

Ok, new issue: https://netbeans.org/bugzilla/show_bug.cgi?id=256016
Comment 8 junichi11 2016-03-03 01:05:07 UTC
Perhaps, simply, it is reproducible with the following steps:

1. Disable xdebug : e.g. comment out lines of the xdebug.ini file
2. Create/Open a php project
3. Create/Opne a php file (index.php)
e.g.
    <?php
    
    echo "hello"; // set the break point
4. Set Script(run in command line) to Run Configuration of the project properties
5. Run Debug Project

Tomas, I found out the cause. The module is waiting in the SessionId.isInitialized() even if the debugging is canceled. So I think that we have to let the SessionId know that it is canceled. But I'm not sure yet. Could you look at it when you can make time?

BTW, the waiting progress bar is shown because the ServerSocket cannot accept in the ServerThread.run() (looping with SocketTimeoutException).

Thanks.
Comment 9 junichi11 2016-03-03 05:28:52 UTC
Sorry, missing steps:

6. Cancel Running Task (Click [x] for "Waiting For Connection")
7. Run Debug Project again
Comment 10 junichi11 2017-04-14 00:25:28 UTC
Fixed.

http://hg.netbeans.org/web-main/rev/386dd5c3e7c5

Thanks.
Comment 11 Quality Engineering 2017-04-15 02:50:19 UTC
Integrated into 'main-silver', will be available in build *201704150002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/386dd5c3e7c5
User: Junichi Yamamoto <junichi11@netbeans.org>
Log: #254298 - Could not reinitiate cli debug session
Comment 12 Tomas Mysik 2017-04-18 08:52:39 UTC
Thanks a lot, Junichi!
Comment 13 pmaselkowski 2017-04-18 11:36:04 UTC
Thank You, now behavior is correct, and there is information of what could be wrong, good. Verified at build 201704180002
Comment 14 junichi11 2017-04-18 13:41:26 UTC
You are welcome :)