You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by Tim Zimmerman <ic...@hotmail.com> on 2017/04/27 13:11:59 UTC

Issues with debugging

Not sure if this is a bug or misunderstanding on my part.


I was trying to enable debugging so that I could troubleshoot a problem. I modified bootstrap.conf to enable debugging. I simply uncommented the java.arg.debug line and changed the  port to 8187. I was able to attach to the process at 8187 but my breakpoints were never hit. If Ieave the address alone, set to 8000 it worked as expected.


The following worked as expected: java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

With address changed to 8187, debugger attached but never stopped on breakpoints : java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8187

Input is appreciated.

Thanks,
  tim


Re: Issues with debugging

Posted by Joe Witt <jo...@gmail.com>.
no worries tim.  this is a good place to ask and I guarantee this
thread will help someone else later.

On Thu, Apr 27, 2017 at 10:30 AM, Tim Zimmerman <ic...@hotmail.com> wrote:
> Bryan,
>
>   Thanks for the quick response. Yes I thought it quite strange myself. I
> was trying to debug a processor rather than any bootstrap process. I am
> pretty sure I was connected to the correct process. I did not see any
> additional java processes (other than my IDE) and when I disconnected I saw
> output in NiFi indicating that it was listening to for connections on 8187.
>
>
>   This morning I tried to reproduce everything I had done yesterday and it
> works using either my port or the original port regardless of whether I
> suspend the process on start up or not. Basically, it all works as expected
> this morning.
>
>
>   I don't have an explanation for the change in behavior. Yesterday I did
> restart my IDE (NetBeans) but that did not seem to make any difference. This
> morning I did not restart anything (just put my laptop to sleep last night)
> and it all seems to work.
>
>
>   I apologize for submitting before I tested it again this morning. And I
> sincerely appreciate the help.
>
>
> tim
>
>
>
>
>
> ________________________________
> From: Bryan Rosander <br...@apache.org>
> Sent: Thursday, April 27, 2017 1:22:24 AM
> To: users@nifi.apache.org
> Subject: Re: Issues with debugging
>
> Hey Tim,
>
> That's pretty strange that your breakpoints aren't being hit.  In the past
> when things like that have happened to me, it's usually due to me
> successfully connecting but to the wrong JVM.
>
> If you're trying to debug code related to the bootstrap process itself
> (RunNiFi or anything it calls), you'd need to put the debug arg in nifi.sh
> or nifi.bat depending on OS, not in bootstrap.conf.  Our bootstrap process
> runs in a separate JVM from NiFi.
>
> If that isn't the issue, you could run jps  to list all Java processes and
> be sure that only the NiFi instance(s) you expect are running are listed.
>
> If that doesn't show anything unexpected, would you mind setting suspend=y
> in the above property and restarting NiFi?  Having suspend=y will make the
> NiFi JVM wait on a debugger connection before proceeding with startup which
> would rule out things like accidentally connecting to another local NiFi or
> Java process, etc.
>
> Thanks,
> Bryan
>
> On Thu, Apr 27, 2017 at 9:11 AM, Tim Zimmerman <ic...@hotmail.com>
> wrote:
>>
>> Not sure if this is a bug or misunderstanding on my part.
>>
>>
>> I was trying to enable debugging so that I could troubleshoot a problem. I
>> modified bootstrap.conf to enable debugging. I simply uncommented the
>> java.arg.debug line and changed the  port to 8187. I was able to attach to
>> the process at 8187 but my breakpoints were never hit. If Ieave the address
>> alone, set to 8000 it worked as expected.
>>
>>
>>
>> The following worked as expected:
>> java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000
>>
>>
>>
>> With address changed to 8187, debugger attached but never stopped on
>> breakpoints :
>> java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8187
>>
>>
>>
>> Input is appreciated.
>>
>>
>>
>> Thanks,
>>
>>   tim
>>
>>
>

Re: Issues with debugging

Posted by Tim Zimmerman <ic...@hotmail.com>.
Bryan,

  Thanks for the quick response. Yes I thought it quite strange myself. I was trying to debug a processor rather than any bootstrap process. I am pretty sure I was connected to the correct process. I did not see any additional java processes (other than my IDE) and when I disconnected I saw output in NiFi indicating that it was listening to for connections on 8187.


  This morning I tried to reproduce everything I had done yesterday and it works using either my port or the original port regardless of whether I suspend the process on start up or not. Basically, it all works as expected this morning.


  I don't have an explanation for the change in behavior. Yesterday I did restart my IDE (NetBeans) but that did not seem to make any difference. This morning I did not restart anything (just put my laptop to sleep last night) and it all seems to work.


  I apologize for submitting before I tested it again this morning. And I sincerely appreciate the help.


tim





________________________________
From: Bryan Rosander <br...@apache.org>
Sent: Thursday, April 27, 2017 1:22:24 AM
To: users@nifi.apache.org
Subject: Re: Issues with debugging

Hey Tim,

That's pretty strange that your breakpoints aren't being hit.  In the past when things like that have happened to me, it's usually due to me successfully connecting but to the wrong JVM.

If you're trying to debug code related to the bootstrap process itself (RunNiFi or anything it calls), you'd need to put the debug arg in nifi.sh or nifi.bat depending on OS, not in bootstrap.conf.  Our bootstrap process runs in a separate JVM from NiFi.

If that isn't the issue, you could run jps  to list all Java processes and be sure that only the NiFi instance(s) you expect are running are listed.

If that doesn't show anything unexpected, would you mind setting suspend=y in the above property and restarting NiFi?  Having suspend=y will make the NiFi JVM wait on a debugger connection before proceeding with startup which would rule out things like accidentally connecting to another local NiFi or Java process, etc.

Thanks,
Bryan

On Thu, Apr 27, 2017 at 9:11 AM, Tim Zimmerman <ic...@hotmail.com>> wrote:

Not sure if this is a bug or misunderstanding on my part.


I was trying to enable debugging so that I could troubleshoot a problem. I modified bootstrap.conf to enable debugging. I simply uncommented the java.arg.debug line and changed the  port to 8187. I was able to attach to the process at 8187 but my breakpoints were never hit. If Ieave the address alone, set to 8000 it worked as expected.


The following worked as expected: java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000

With address changed to 8187, debugger attached but never stopped on breakpoints : java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8187

Input is appreciated.

Thanks,
  tim



Re: Issues with debugging

Posted by Tim Zimmerman <ic...@hotmail.com>.
Pierre,

  Thanks, yes I did make sure I download the corresponding source.  And even tried to match up the stacktrace with the source and it all seemed to tie together.


  I just responded to Bryan that this morning all is working as expected. The issue may have been with NetBeans. I waited quite some time after connecting but I am thinking now that it never actually submitted the breakpoints.


  Regardless, I do appreciate everyone's input and I am happily back to working on my flows.


Thanks again,

  tim

________________________________
From: Pierre Villard <pi...@gmail.com>
Sent: Thursday, April 27, 2017 1:33:32 AM
To: users@nifi.apache.org
Subject: Re: Issues with debugging

Hi,

Dummy question but... are you sure the code of the running NiFi is exactly matching the code where you specified breakpoints? If this is not matching, that could be the reason.

Re: Issues with debugging

Posted by Pierre Villard <pi...@gmail.com>.
Hi,

Dummy question but... are you sure the code of the running NiFi is exactly
matching the code where you specified breakpoints? If this is not matching,
that could be the reason.

Re: Issues with debugging

Posted by Bryan Rosander <br...@apache.org>.
Hey Tim,

That's pretty strange that your breakpoints aren't being hit.  In the past
when things like that have happened to me, it's usually due to me
successfully connecting but to the wrong JVM.

If you're trying to debug code related to the bootstrap process itself
(RunNiFi or anything it calls), you'd need to put the debug arg in nifi.sh
or nifi.bat depending on OS, not in bootstrap.conf.  Our bootstrap process
runs in a separate JVM from NiFi.

If that isn't the issue, you could run jps  to list all Java processes and
be sure that only the NiFi instance(s) you expect are running are listed.

If that doesn't show anything unexpected, would you mind setting suspend=y
in the above property and restarting NiFi?  Having suspend=y will make the
NiFi JVM wait on a debugger connection before proceeding with startup which
would rule out things like accidentally connecting to another local NiFi or
Java process, etc.

Thanks,
Bryan

On Thu, Apr 27, 2017 at 9:11 AM, Tim Zimmerman <ic...@hotmail.com>
wrote:

> Not sure if this is a bug or misunderstanding on my part.
>
>
> I was trying to enable debugging so that I could troubleshoot a problem. I
> modified bootstrap.conf to enable debugging. I simply uncommented the
> java.arg.debug line and changed the  port to 8187. I was able to attach to
> the process at 8187 but my breakpoints were never hit. If Ieave the address
> alone, set to 8000 it worked as expected.
>
>
>
> The following worked as expected: java.arg.debug=-agentlib:jdwp=
> transport=dt_socket,server=y,suspend=n,address=8000
>
>
>
> With address changed to 8187, debugger attached but never stopped on
> breakpoints : java.arg.debug=-agentlib:jdwp=transport=dt_socket,server=y,
> suspend=n,address=8187
>
>
>
> Input is appreciated.
>
>
>
> Thanks,
>
>   tim
>
>