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.
After updating my local gems to Rails 2.1.1, Mongrel started to acting up and wont start at all. When I try to start mongrel normally or in debug mode, it uses a random port number instead of the configured 3000 port number for my web app. Thank you for taking the time to look into this issue.
Erno, is this a known issue? I can't reproduce with latest build, neither for normal nor for debug mode, neither with JRuby nor with MRI. Note that NetBeans tries to increase port one by one if the current one is not free. So it tries 3001, 3002, ... But you said random, so likely you are getting something completely differecnt (like 34288?). Could you attach the log with the latest build as described here: http://wiki.netbeans.org/FaqRubyNBLogging PS: don't be confused by the first line: Fast Debugger (ruby-debug-ide 0.3.0) listens on localhost:37120 => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails 2.1.0 application starting on http://0.0.0.0:30001 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:30001 ** Starting Rails with development environment... Above 37120 is randomly choose port for *debugger* session. 30001 is the port I've set in the Rails project properties.
Could you please try whether you can reproduce this with the latest build (http://wiki.netbeans.org/RubyInstallation#section-RubyInstallation-HowDoIGetTheContinuousBuilds)? Or was it just that the first line in the output mislead you (see the previous comment)?
I downloaded the latest build from development today, I click on debug main project to start mongrel with debug mode and tried to start mongrel with port 4879 which is totally not the port I have configured, port 3000, and did not complete the startup of the server because it complained about the port being on use and shutdown mongrel. The second try started mongrel with port 3005, and that went well and completed the startup but it is still not the configure port 3000. I have noticed that if I have breakpoints in the code before starting mongrel, mongrel throws an error when starting complaining about the breakpoints and would not start until I delete the breakpoints. That is very strange. Please investigate. Thank you.
I don't know now what could be causing the first case, i.e. port 4879. The second case might be caused by the fact that the IDE tries to find a free port if the specified port is not available, so the server could be started in port 3005 even if you had specified 3000 if ports 3000-3004 were taken. Was this the case by any chance? It would be great if you could enable more detailed logging (pls see http://wiki.netbeans.org/FaqRubyNBLogging), reproduce this and then attach the log file here.
I downloaded the latest build and edited the netbeans.conf and added the options you mentions. Now, I am totally not able to start mongrel, as you know, in order to start mongrel I need to have mysql running, when I go to the databases tab and try to star MySQL database that I have configured, I am unable to start it as the start command is greyed out, I think the first step is to get that command back active in order to start MySQL. Thanks
Created attachment 70981 [details] netbeans latest build log file
I am having the same issue. 6.5 beta and with a dev build from a couple weeks back. Attaching a log with detailed logging turned on. My port numbers are usually in the 6000 range. The port number I set in the IDE is not in use, that's not the issue.
Created attachment 70990 [details] log of mongrel session with detailed logging enabled
> in order to start mongrel I need to have mysql running, I think it is not really necessary -- Mongrel should start up fine, just that Rails will throw an exception when it will try connect to the database. > when I go to the databases > tab and try to star MySQL database that I have configured, I am unable to start it as the start command is greyed out, I > think the first step is to get that command back active in order to start MySQL. Please go ahead and reopen issue 148753 to resolve this (if davidvc's comment in the issue doesn't apply to your case). Thanks both for the logs, I will investigate this.
Unfortunately I couldn't track down the problem based on logs, will need to add there more logging. I'm also not able to reproduce the problem myself. Does this happen to you all the time? What is the port number that you have specified in project properties?
It happens to me all the time and I am really getting tired of this issue. Is there any ways to log mongrel startup to see what is really happening when the server is starting up. Another suggestion, are there any other servers I can use, I know that mongrel is a gem, is there another server as a gem I can use instead? Thanks.
You can use WEBrick or GlassFish V3 as an alternative to Mongrel. I'll add more logging to track down this, the Mongrel log doesn't really help in this case. I'm also increasing priority for this because this happens to you all the time. Could you please attach the IDE log here once more (since in the previous log you attached the startup of the server fails completely). Thanks for the patience.
Created attachment 71299 [details] netbeans log file
Created attachment 71300 [details] netbeans log file
Created attachment 71301 [details] netbeans ide screenshot
I have attached the logs and a screenshot to show the random mongrel port number and the debugger error message. One thing I have observed, I can start mongrel in debug mode with version 6.1 but after several tries, a random number of tries. Every time I try it shots down right away until one time starts all of a sudden, This started to happen right after I upgraded rails to 2.1.1 One question, can I use glass fish server with ruby or is it only for JRuby interpreter? Thanks
I checked in some additional logging, could you please try with the latest continuous build (http://wiki.netbeans.org/ RubyInstallation#section-RubyInstallation-HowDoIGetTheContinuousBuilds), enable detailed logging (http:// wiki.netbeans.org/FaqRubyNBLogging), reproduce the issue once more and attach the log file here then. I hope we will then finally be able to track down the cause of this issue. Wrt. GlassFish, it needs the JRuby interpreter.
Created attachment 71379 [details] netbeans continuous build log
Created attachment 71380 [details] netbeans continuous build log
Hi, I did exactly what you have suggested, I downloaded the latest continuous build, unzip it, and ran it, I was able to reproduce the same error again. Attached is log file for you to investigate. Thanks. On a side note, the latest continuous build has issues with fetching rake tasks, it fails to load rake tasks with error in fetching them.
Thanks. Can you try adding the following option to netbeans_default_options in the <netbeans install dir>/etc/ netbeans.conf file and see if it helps (you need to restart the IDE then): -J-Drails.server.http.validation=true
Created attachment 71431 [details] Netbeans log file
Hi, Thank you for tracking down the issue, mongrel now tries to start the server on port 3000 with the config you gave me. Please make sure you include this config in the builds so it gets into version 6.5 This does not totally fix the issue, now I have to try to start the server several times in order to get it to start. It is a random number of tries. Looking at the IDE log I see exceptions regarding the server startup. I have attached the log file so you can track down the exception. Please take a look and let me know. Thank you for all your help
Something else I found out about this. It happens when I have more then one version of netbeans installed, such as having beta5 and a dev version or two dev builds. I uninstalled both, removed all the files they leave behind, then installed fresh and the problem went away. I noticed this when I installed a second dev build on my laptop, and boom same bug. Clean everything out, install fresh, problem went away.
> It happens when I have more then one version of netbeans installed That's good info, thanks for that. It might help to specify a different user dir for each of the installations, either change the following line in <netbeans install dir>/etc/netbeans.conf: netbeans_default_userdir="${HOME}/.netbeans/anotheruserdir" or start the IDE with the --userdir switch, e.g. netbeans.exe --userdir C:\anotheruserdir More info at http://wiki.netbeans.org/FaqAlternateUserdir theyaa: are you also running more than one instance of the IDE?
theyaa: Glad we are making at least some progress! To resolve the remaining problem, could you provide yet another log, this time with detailed logging enabled for debugging too: http://wiki.netbeans.org/RubyDebugging#section-RubyDebugging-HowToFileABug Also, is there anything in the server.log (I mean log/server.log of the rails app)? Furthermore, it would greatly help if you could describe step by step what you have to do to reproduce this issue from scratch -- I'd really to get this completely fixed, but it is difficult as long as I can't reproduce it myself.
Created attachment 71467 [details] netbeans log with debug logging turned on
Hi, I did put the config you asked me to in order to log the server debugging messages. The way to reproduce the error is just by starting the ide, start mysql server, then click on debug main project from the debug menu, the server starts to load then dies. I have attached the log for your review and it shows some exceptions with the ruby debugger. Please take a look. Also, I do have several versions of the ide installed, I have 6.1, 6.5M1 and the latest hudson continuous release. Would you please advice me on how can I clean my pc from all those releases and then install a clean version, and which version should I go with. Thank you.
Created attachment 71469 [details] netbeans ide log
Hi, I have changed the user dir and was able to reproduce the same error. Attached is the log from the new user dir.
Thanks once again for the logs. Could you please and try to following: 1) run the project, i.e. not in the debug mode -- does that work? 2) turn off the -J-Drails.server.http.validation=true switch (you can just remove it or change it to false, note that you need to restart the IDE then) and again normally run the project. I assume that this will give you a random port number, but would like to confirm this. 3) turn off all firewalls you have (e.g. Zone Alarm, Windows firewall etc) and try to (normally) run again? Regarding old versions, you can just uninstall them in Control Panel > Add or Remove Programs. For those installations that you installed using just the zip archive, you can just delete the directory. Having many versions installed shouldn't do any harm for each other though, just make sure that you specify a different user dir for each installation in the netbeans.conf file. Currently I'd go both with the latest build and 6.1 final.
Hi, I did follow all the steps you mentioned and here are the results: 1 - I ran the project in normal mode(no debug) and it ran from the first attempt without any issues. Ran on the port I have configured which is 3000, great. 2 - I disabled the -J-Drails.server.http.validation=true switch and turned it to false. Started the server normally(no debug) and it started the server on a random port =4955, as you expected. 3 - I disabled my firewall and tried to run the project again normally and this time I also got a random port = 4776. I have each version running from a different folder so no interference there. I hope this helps
Thanks. Seems that for some reason the way how we try to detect whether a port is used or not does not work reliably on your machine. I will rewrite the code in question, let's hope that will help.
Please let me know when the code is ready and how I can downlod it. Thanks
My attempt to fix this is now available in build #4025 and later, you can get it from http://deadlock.netbeans.org/hudson/job/trunk/lastSuccessfulBuild/artifact/nbbuild/dist/zip/ Please make sure the the -J-Drails.server.http.validation switch is either removed or set to false before testing.
Forgot to add that if it still doesn't work, please enable detailed logging once again (http://wiki.netbeans.org/ RubyDebugging#section-RubyDebugging-HowToFileABug) and attach the log file here then.
Integrated into 'main-golden', will be available in build *200810111401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/732eef3d7b77 User: Erno Mononen <emononen@netbeans.org> Log: #147637: Can not start mongrel with debug mode - getting random port number - an attempt to fix (not reproducible on my machine)
Created attachment 71667 [details] netbeans ide log with debugging log
Hi, I am afraid it still does not work, the port is actually correct, 3000, but the server is terminating right after it tries to start, I looked at the ide log and there are excepitons. I have attached a new ide log for you to take a look. Thanks
Thanks for testing it, too bad it didn't help. I'll continue to investigate this.
Forgot to ask -- does debugging work for you with WEBrick (you can change the server in project properties)?
Seems that this issue will win the "Issue of the release" prize :) Theyaa could you try to run from command line: cd E:\cms\cms2 E:\cms\ruby\bin\ruby.exe E:\cms\ruby\bin\rdebug-ide _0.3.0_ -p 3568 -d -- script\server --port 3000" And then from the second terminal to telnet to the debugger with: telnet localhost 3568 and type in the telnet session. start<Enter> What does happen? Does the process start up normally and you are able to connect you application to http://localhost:3000/ from the browser? Thanks.
Hi, I followed the advice from mkrauskopf, I opened a new terminal and executed the command: E:\cms\ruby\bin\ruby.exe E:\cms\ruby\bin\rdebug-ide _0.3.0_ -p 3568 -d -- script\server --port 3000 Then opened a new terminal and executed a nother command: telnet localhost 3568 Then typed start<enter> in the telnet terminal, in the first terminal I saw the server starting normally, then it throws an exception, it is from ruby.exe, the exception is: "This application has failed to start because LIBMYSQL.dll was not found. Re-installing the application may fix this problem" And the server quits and I am not able to connect to it through the browser. Please investigate.
Hi, I made some more progress, I started mysql manually and re-tried the same procedure, I still go the same error, but this time when I closed the error message the server started and I was able to connect to the server through the browser. I think we have a clue here, would you please investigate what is the difference between starting from command line and IDE. Thanks
Ok, it seems that your system has something broken. The problem is reproducible from command line as you have shown. After quick Googling: http://www.google.com/search?q=This+application+has+failed+to+start+because+LIBMYSQL.dll I've got here: http://www.ruby-forum.com/topic/150580 Could you try hints like that to solve the problem. Once you are able to start the debugger/server from CLI you should be able to start it from NetBeans as well. BTW, does: cd E:\cms\cms2 E:\cms\ruby\bin\ruby.exe script\server --port 3000 (i.e. without the debugger) works for you from CLI?
I have followed the instructions in the link you gave me, I was able to start the server in debug mode without any issues, which was great!!. I thought the problem was solved!!. I started the IDE and tried to start the server in debug mode. THE SAME PROBLEM!!!. The same exception in the log. FINE [org.rubyforge.debugcommons.ReadersSupport]: Connection reset java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168) at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264) at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306) at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158) at java.io.InputStreamReader.read(InputStreamReader.java:167) at java.io.BufferedReader.read1(BufferedReader.java:185) at java.io.BufferedReader.read(BufferedReader.java:261) at org.kxml2.io.KXmlParser.peek(Unknown Source) at org.kxml2.io.KXmlParser.peekType(Unknown Source) at org.kxml2.io.KXmlParser.nextImpl(Unknown Source) at org.kxml2.io.KXmlParser.next(Unknown Source) at org.rubyforge.debugcommons.ReadersSupport.startXPPLoop(ReadersSupport.java:112) at org.rubyforge.debugcommons.ReadersSupport.access$200(ReadersSupport.java:21) [catch] at org.rubyforge.debugcommons.ReadersSupport$XPPLoop.run(ReadersSupport.java:249)
That would be quite weird. Are you sure you are using the same Ruby from CLI - which works for you; and the same Ruby from NetBeans? Weird thinks is that you were able to start up server without debugger even when there were LIBMYSQL.dll problem - I can't really explain that. So to summarize current situation: - you *are* able to proceed through the procedure with telnet I've described - you *are not* able to use debugger with the *same* Ruby set for the Rails project in NetBeans - you *are* able to *run* the Rails project from both, CLI and NetBeans - you *are* able to debug/run using Webrick from CLI and NetBeans Are my above claiming true? Thanks.
Actually it is not quite that. I am able to Start Webrick and even Mongrel from netbeans in debug mode. The only different between normal start and debug mode in netbeans is that, the normal start goes from the first time without issues, in debug mode I have to try several times till I get it to start, and the number of times is random, sometimes from the second time another time from the 20th time. From CLI both start from the first time, normal and debug.
So great, we get a little bit further, now you are able to debug at least somehow. So could you do that - i.e. try to debug, when it fails, try it again, etc. and attach the log as you did several times before. Hopefully we will move further again. Thanks.
Created attachment 71882 [details] netbeans IDE log with debugging enabled.
Ok, I did restart netbeans, and tried to start Mongrel in debug mode inside netbeans, it started with the second try. In the log I see SocketException. Attached is the IDE log. Thanks for the help
The only difference is the port used for the debugger backend. Could you try the "telnet procedure" with both scenario. I.e.: cd E:\cms\cms2 E:\cms\ruby\bin\ruby.exe E:\cms\ruby\bin\rdebug-ide _0.3.0_ -p 4947 -d -- script\server -e development --port 3000 And then from the second terminal to telnet to the debugger with: telnet localhost 4947 and type in the telnet session. start<Enter> Try to connect to browser to the application (if the procedure did not fail sooner). Then repeat for port 4950 (instead of 4947). If the 4947 does not work and 4950 works than it might be some firewall issue.
I think we are back to an even worse situation, I can not even start the server in the CLI neither, here are the results of both ports from the command line. E:\cms\cms2>E:\cms\ruby\bin\ruby.exe E:\cms\ruby\bin\rdebug-ide _0.3.0_ -p 4950 -d -- script\server -e development --port 3000 Waiting for connection on 'localhost:4950' Fast Debugger (ruby-debug-ide 0.3.0) listens on localhost:4950 Starting command read loop Processing: start Starting: running program script => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails 2.1.1 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... DEPRECATION WARNING: Inflector is deprecated! Use ActiveSupport::Inflector inste ad. See http://www.rubyonrails.org/deprecation for details. (called from E:/cms /cms2/config/initializers/inflections.rb:5) Exiting E:\cms\cms2>E:\cms\ruby\bin\ruby.exe E:\cms\ruby\bin\rdebug-ide _0.3.0_ -p 4947 -d -- script\server -e development --port 3000 Waiting for connection on 'localhost:4947' Fast Debugger (ruby-debug-ide 0.3.0) listens on localhost:4947 Starting command read loop Processing: start Starting: running program script => Booting Mongrel (use 'script/server webrick' to force WEBrick) => Rails 2.1.1 application starting on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server ** Starting Mongrel listening at 0.0.0.0:3000 ** Starting Rails with development environment... DEPRECATION WARNING: Inflector is deprecated! Use ActiveSupport::Inflector inste ad. See http://www.rubyonrails.org/deprecation for details. (called from E:/cms /cms2/config/initializers/inflections.rb:5) Exiting I even tried your earlier command from an earlier post and now even that one does not work anymore. The only thing I have changed, since the last time I ran this command, is installing the mysql gem.
Does E:\cms\ruby\bin\ruby.exe script\server -e development --port 3000 from the command line still work? Could you also attach the log/development.log and log/server.log files (after a failed startup attempt). And finally, can you try whether using WEBrick works, with and without debuggging, i.e.: without: E:\cms\ruby\bin\ruby.exe script\server webrick -e development --port 3000 and with: E:\cms\ruby\bin\ruby.exe E:\cms\ruby\bin\rdebug-ide _0.3.0_ -p 4950 -d -- script\server webrick -e development --port 3000
Hi sorry for the confusion, I was able to start the server on both ports, 4947 and 4950, with debug mode successfully. The trick was that I had forgot to start mysql server and that was the reason the server was exiting. Now, both ports works fine from the first attempt from command line. Sorry again for the confusion.
But it still doesn't work from the IDE or does it?
No it doesn't, from the IDE I have to try several times in order to get the server to start. the log shows Socket Exceptions the same as the ones in the las log I attached. One question here, how do I change the port the debugger starts in netbeans? The example ports you gave me was 4947 and 4950, the one I got mongrel to start with after several attempts was 2338. I would like to change the debugger port in netbeans to start with port 4947 or 4950 if possible, is that doable?
Theyaa, another idea. It helped in similar issue. Could you try to upgrade to newer Ruby: http://www.ruby-lang.org/en/downloads/ MRI 1.8.6-p111 is a bit outdated.
Hi, I believe upgrading Ruby wont make any difference, I can start the server with debug in command line without any issues and from the first time, if the issue was with Ruby then I would have had the same issue in command line and in IDE right? I believe the issue is with how netbeans tries to start the debugger, it works sometimes and it does not work other times. There is where I would look and see. From my observation, the debugger is not trying to increment the port if the first one does not work, are you able to make it try another port if the first one does not work and keep trying until it can connect to one? Thanks
re Ruby-upgrade> there were some Segmentation Fault problems with MRI. The scenario from the CLI is the simplest possible which might or might not reveal the problem. Upgrading Ruby to the non-buggy one helps several time in similar scenarios. So still worth to try. Ruby 1.8.6-p111 does contain some bugs which were already fixed in newer version. It should not be used. Either latest 1.8.6, latest patch (ruby-1.8.6-p287 in the meantime), or latest 1.8.7 (ruby-1.8.7-p72 in the meantime). > the debugger is not trying to increment the port if the first one does not work The debugger always find random free port. So this should not be the issue. Code is here (method Util#findFreePort) http://debug-commons.rubyforge.org/svn/intermediate-java/trunk/src/org/rubyforge/debugcommons/Util.java Since I have no clue what could be wrong (if newer MRI does not help), I'll have to take a look where to add more logging.
Do you have the links for the binaries for the versions you mention. I looked around and all I saw was the source code. I need to windows version which contains the binaries like ruby.exe. Would you please give me the links
I've forgotten that you are on Windows. Hmm, there is: http://www.ruby-lang.org/en/downloads/ where seems to be binaries for 1.8.7. There is also link to One-Click installer for 1.8.6: http://rubyforge.org/frs/?group_id=167 But only "1.8.6-27 Release Candidate 1" contains "Ruby 1.8.6 patch level 287" according to Changelog: http://rubyforge.org/frs/shownotes.php?release_id=26150 Not sure what is the stability of the RC1.
Hi, I followed your advice and updated to Ruby 1.8.6 patch level 287, now it is even worse, it takes more tries to start the server, about over 20 time till I got it to start. Another problem is when I try access the rake tasks I get this error "Rake tasks fetching failed with working directory", any idea? Thanks
re debugger> Ok, thanks for the try. I'll have to take a look where to put more logging among the debugger layers. I do not have a clue what could be done until then. re rake> please file a new issue. This one is already too bloated. Thanks.
Hi, I hope you are doing some progress with this issue because now it is worse, I can not even start mongrel in debug mode anymore. Please help. Thanks
Yes, I'm working on the backends and intermediate library at debug-commons project: http://debug-commons.rubyforge.org/ or https://rubyforge.org/projects/debug-commons/ which is utilized by NetBeans.
Any progress on this issue please?
Sorry, no in the last 4 days, we had a public holiday here and a vacation. Continuing today. Will let you know immediately when I have something (hopefully until the Friday or sooner).
Progress in the backend: http://rubyforge.org/pipermail/debug-commons-commits/2008-October/000288.html I'll update intermediate library soon and update NetBeans to use it all. Will have to work simultaneously on new P1 151698. So be patient ;)
Thank you so much for the progress, I really appreciate it.
debug-commons-java progress: http://rubyforge.org/pipermail/debug-commons-commits/2008-October/000291.html Commit message: Robustness, strictness, logging: - let <message>s to come asynchronously - strict debug-commons protocol checking - better logging infrastructure
This is great progress, please let me know when I will be of assistance. Thank you.
Hi. I've purposely did not reply here yet. Since the build with the progress is not ready yet. It will be #4195 (if it passes). When it is ready, if you could try to reproduce again, following instructions at: http://wiki.netbeans.org/RubyDebugging70#section-RubyDebugging70-HowToFileABug OW content is not needed anymore. Just IDE log as usually. I do not think it will be fixed, but there is a bunch of changes which should make tracking of the bug easier. If not clear from the first sight, I'll add more logging, until we catch it.
Thank you, just let me know when the build is ready and I will get it installed and try it out. Thank you
Integrated into 'main-golden', will be available in build *200810311401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/46dcdd39fb84 User: Martin Krauskopf <mkrauskopf@netbeans.org> Log: Upgrading to new ruby-debug-ide (0.4.0) and new debug-commons-java (related to issues like #151098, #147637, #147637). In general brings robustness, strictness and better logging infrastructure (only one log is needed now) of underlaying layers. Might reveal more bugs. Changelog of debug-commons-java since last update: * Robustness, strictness, logging: * let <message>s to come asynchronously * strict debug-commons protocol checking * better logging infrastructure * more info during failures
The build is ready. So if you could reproduce with turned logging on as described at: http://wiki.netbeans.org/RubyDebugging70#section-RubyDebugging70-HowToFileABug (no CLI options needed anymore) and attach the log. Thanks.
Created attachment 73093 [details] netbeans ide log with detailed logging
I have attached the log file, please review and investigate. Thanks
The log you've attached does not contain any traces that would show the usage of the debugger. Did you try to run the debugger? It does not seems to from the log.
Created attachment 73130 [details] netbeans ide log
It seems like activating the detailed debugging through the ide is not working properly. I had to go edit the netbeans.conf and add the options, this time you have the exception. please take a look.
Created attachment 73135 [details] netbeans ide log
Attaching another log after applying the jar you sent
1) Could you try to pass -J-Dorg.netbeans.modules.ruby.debugger.timeout=40 2) Do you have any firewall activated? If yes, does it help to turn the firewall off?
Created attachment 73150 [details] netbeans ide log
I added your config and disabled my firewall, same error, nothing changed, attached is the log file
I guess that the "manual telnet way" still works for you, right? First terminal: E:\cms\cms2> e:\cms\ruby\bin\ruby.exe E:\cms\ruby\bin\rdebug-ide _0.4.0_ -p 4344 --xml-debug -- script\server --port 3000 Second one: > telnet localhost 4344 Then in started session: b E:\cms\cms2\app\controllers\content_controller.rb:1333<Enter> start<Enter> Does it work? I think we have not tried setting breakpoint from CLI. Might be it will cause some error. If not I think that the next step will be to simulate the behaviours with two mini-apps in Ruby and Java, outside of NetBeans. PS: please stop changing the Status of the issue from STARTED to NEW. The Status field is supposed to be set by the developer to better orientate in the issues he is currently investigating or working on. Thanks.
Your suggestion worked perfectly, I followed the steps and mongrel started from the first try from CLI without any errors.
Ok, thanks. What is your ipconfig? Are you using IPV6 by any chance. Is the localhost configured properly? If you could play with ruby-debug.rb, particularly with line: server = TCPServer.new(host, port) replacing the host variable with e.g.: server = TCPServer.new('127.0.0.1', port) or server = TCPServer.new(nil, port) whether something starts to work, it could be helpful. I think, you can find ruby-debug.rb on your system in: e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/lib/ruby-debug.rb I want to implement RFE 104473 where you could specify it from NetBeans. Or I can likely provide some properties. Or we can try to write some simple programs in Java and Ruby to get closer to the specifics of your system.
Sorry none of them worked, I tried nil and 127.0.0.1 and both had the same effect as the original value.
And to my other questions? > What is your ipconfig? Are you using IPV6 by any chance. Is the localhost configured properly? Just to exclude as much as possible.
To answer your question, how do I know what is my ipconfig version?, how do I know if my localhost is properly configured?. Would you guide me please
"ipconfig /all" should show four-numbers IP address, like 192.168.1.20. Also I suppose that you are not able to debug even simples script. I.e. when you create a new Ruby (non-Rails) project (Menu | File | New Project | Ruby | Ruby Application) and put a breakpoint in main.rb on: puts "Hello World" the debugger fails in the same way, right?
I have created a test app, created a model, tried to start mongrel on this app with debug and had the same exact issue, so it is not from my app it is in the ide. Please investigate
Please re-read my previous comment. I meant whether it work with *non*-Rails application. > ... Menu | File | New Project | Ruby | Ruby Application ...
I followed your comments and created a ruby application ( Non rails application) trying to start the debugger produced the same error, I was not able to start the debugger, so no changes here java.net.SocketException: Connection reset at java.net.SocketInputStream.read(SocketInputStream.java:168)
I've implemented Remote Debugging in the meantime (issue 104473). So we have another way to move a little bit. So could you: 1) create *non*-Rails application (Menu | File | New Project | Ruby | Ruby Application) 2) put a breakpoint in main.rb at line 4 => puts "Hello World" 3) from command line, from the created application's 'lib' directory run: E:\cms\ruby\bin\rdebug-ide rdebug-ide -p 7000 --xml-debug -- E:\full\path\to\created_application\lib and/or E:\cms\ruby\bin\rdebug-ide rdebug-ide -p 7000 -h localhost --xml-debug -- E:\full\path\to\created_application\lib 4) then in NetBeans remotely attach to the process with 'Menu | Debug | Attach', choose Ruby Debugger from combobox, press OK. Does it work? If not, is there something interesting on the CLI? Could you attach the output from CLI and the IDE log as usually? Thanks.
I followed your steps until I got to the point of attaching a debugger, I went to Menu|Debug|Attach Debugger. The only option I got there was Web Page Debugger (Javascript). I was not able to select any other debugger.
Hi, you have to take the latest continous build: http://wiki.netbeans.org/RubyInstallation#section-RubyInstallation-HowDoIGetTheContinuousBuilds
OK, downloaded the latest build, followed your instructions, attaching the debugger did not work. Using both commands, here is what I got in the CLI E:\cms\test2\lib>E:\cms\ruby\bin\rdebug-ide rdebug-ide -p 7000 --xml-debug -- E: \cms\test2\lib Fast Debugger (ruby-debug-ide 0.4.0) listens on localhost:7000 e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/bin/rdebug-ide:49: warni ng: already initialized constant ARGV e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/bin/rdebug-ide:54: warni ng: already initialized constant RDEBUG_SCRIPT e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/bin/rdebug-ide:71: warni ng: already initialized constant PROG_SCRIPT E:\cms\test2\lib>E:\cms\ruby\bin\rdebug-ide rdebug-ide -p 7000 -h localhost --xm l-debug -- E:\cms\test2\lib Fast Debugger (ruby-debug-ide 0.4.0) listens on localhost:7000 e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/bin/rdebug-ide:49: warni ng: already initialized constant ARGV e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/bin/rdebug-ide:54: warni ng: already initialized constant RDEBUG_SCRIPT e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/bin/rdebug-ide:71: warni ng: already initialized constant PROG_SCRIPT
The ide log did not have any exceptions in it, just the regular stuff when the ide is starting.
Sorry, example I've given was mistyped. You have to pass full path to the debugged file, i.e.: E:\cms\ruby\bin\rdebug-ide rdebug-ide -p 7000 --xml-debug -d -- E:\cms\test2\lib\main.rb Be sure, that main.rb exist. Those WARNINGs are ok, I guess. I've also added "-d" switch (will be more verbose in the console).
Same thing, log from CLI E:\cms\test2\lib>E:\cms\ruby\bin\rdebug-ide rdebug-ide -p 7000 --xml-debug -d -- E:\cms\test2\lib\main.rb Fast Debugger (ruby-debug-ide 0.4.0) listens on localhost:7000 <breakpointAdded no="1" location="E:/cms/test2/lib/main.rb:4"/> e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/bin/rdebug-ide:49: warni ng: already initialized constant ARGV e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/bin/rdebug-ide:54: warni ng: already initialized constant RDEBUG_SCRIPT e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.0/bin/rdebug-ide:71: warni ng: already initialized constant PROG_SCRIPT And the ide log will be attached in a sec
Created attachment 73490 [details] netbeans ide log
It has been almost 2 months since I have opened this issue, :-)
This time the NetBeans successfully connected to the backend and successfully submitted a breakpoint to it. But backend then did not stop on the breakpoint for some reason. So there seems to be some bug in the backend. But we've at least passed the "Connection Exception" problem. 2 months> Yup, that's the record here. I've never had such a long issue :) Actually that's also that we have been solving more (related) issues at once here. But unfortunately there seems to be something specific on your machine, since we have tried on multiple Windows machines and it works for us everywhere. Also no other users have submitted similar issues. But let's don't give up. Only more logging at this time helps. I think that now with the 'remote debugging' it will be easier since we see direct reaction of the backend at command line managed by NetBeans frontend. Will ping you back when I have something more.
I've released new backend, ruby-debgu-ide 0.4.1 which contains fix for the '-x' switch which provides very detailed logging and introduce the '--stop' switch. So next round. Could you upgrade to the version 0.4.1 and run from terminal: E:\cms\test2\lib>E:\cms\ruby\bin\rdebug-ide -p 7000 --xml-debug -d -x --stop -- E:\cms\test2\lib\main.rb and attach to it from NetBeans. What are the results? You will need build #4278 or later: http://deadlock.netbeans.org/hudson/job/trunk/lastSuccessfulBuild/artifact/nbbuild/dist/zip/ (BTW, I've just noticed that in the previous command you have passed 'rdebug-ide' twice, which could cause the failure)
I followed you instruction, downloaded the latest build and ran the command as instructed. It seems like everything worked just fine, from the first attempt the breakpoint was hit and I was able to debug. So your methods works great. below is the trace from the CLI E:\cms\test2\lib>E:\cms\ruby\bin\rdebug-ide -p 7000 --xml-debug -d -x --stop -- E:\cms\test2\lib\main.rb trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.2-x86-m swin32/lib/ruby-debug-base.rb:200", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.2-x86-m swin32/lib/ruby-debug-base.rb:200", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-base-0.10.2-x86-m swin32/lib/ruby-debug-base.rb:203", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:89", threadId=1 trace: location="e:/cms/ruby/lib/ruby/1.8/ostruct.rb:74", threadId=1 trace: location="e:/cms/ruby/lib/ruby/1.8/ostruct.rb:74", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:111", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:111", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:112", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:112", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:113", threadId=1 Fast Debugger (ruby-debug-ide 0.4.1) listens on localhost:7000 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:91", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:91", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:93", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:94", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:97", threadId=1 trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:98", threadId=1 Starting command read loop Processing: b E:\cms\test2\lib\main.rb:4 <breakpointAdded no="1" location="E:/cms/test2/lib/main.rb:4"/> Processing: start Starting: running program script trace: location="e:/cms/ruby/lib/ruby/gems/1.8/gems/ruby-debug-ide-0.4.1/lib/rub y-debug.rb:101", threadId=1 trace: location="e:/cms/ruby/lib/ruby/1.8/ostruct.rb:74", threadId=1 trace: location="e:/cms/ruby/lib/ruby/1.8/ostruct.rb:74", threadId=1 trace: location="E:\cms\test2\lib\main.rb:4", threadId=1 <suspended file='E:/cms/test2/lib/main.rb' line='4' threadId='1' frames='1'/> Stopping Thread #<Thread:0x284c748> Threads equal: true Processing: th l <threads> <thread id="1" status="sleep" /> </threads> Processing: w Processing context: w <frames> <frame no='1' file='E:/cms/test2/lib/main.rb' line='4' current='true' /> </frames> Processing: cont Processing context: cont Resumed Thread #<Thread:0x284c748> Hello World E:\cms\test2\lib>
Great at least there is some way for you to debug. But still does not work for you if you try to debug inside of NetBeans, right?
No, inside the ide is a pain, I had to try over 20 times to get the debugger to start. What would be the next step now?
So could you attach latest log when the debugging fails from inside the IDE. Let's see whether there is something new. As usually: http://wiki.netbeans.org/RubyDebugging70#section-RubyDebugging70-HowToFileABug
PS: please attach the log for *non*-Rails project scenario. E.g. with the Hello World sample in main.rb.
Created attachment 73682 [details] netbeans ide log
Attached is the ide log while trying to start the non rails app within the ide in debug mode.
Also one more idea (thanks Erno). Could you try to download and try a newer JDK version: https://jdk6.dev.java.net/
Created attachment 73729 [details] netbeans ide log
I applied the file you sent me and attached here the ide log. good luck
There should be also few lines in the OW, could you copy-paste them here. Something like: Fast Debugger (ruby-debug-ide 0.4.1) listens on localhost:34621 MK> server (TCPServer): #<TCPServer:0xb7e37008> MK> session (TCPSocket): #<TCPSocket:0xb7e36be4> MK> interface (Debugger::RemoteInterface): #<Debugger::RemoteInterface:0xb7e36b44> MK> @event_processor (Debugger::EventProcessor): #<Debugger::EventProcessor:0xb7e36ab8> Or was there just a one line?
Fast Debugger (ruby-debug-ide 0.4.1) listens on localhost:1144 MK> server (TCPServer): #<TCPServer:0x2dee32c>
Just this one line? This should not be practically possible if you have applied the file I've send you.
Trust me, just this one line, is there any kind of screen sharing possibility so I can show you?
I trust you ;) Just double checking this weird state.
Damn, I've missed the first line. Sorry.
Trust me I want to get over with this issue as soon as possible
That very weird. It seems that on Ruby side: server = TCPServer.new(host, port) while (session = server.accept) ... 'server.accept' waits for connection. Java tries to *successfully* connects to it (or to "something", but you have said, that you are not running firewall or anything like this). But then there is no message from Ruby process anymore. It seems it dies (could you check that if there is no Ruby task in Windows Task Manager). I'm not sure what more to do. Suggestion: - installing latest Ruby - installing latest JDK Let us know whether did it help. On Linux there were major issues with 1.8.6, it fails on SEGFAULT, might be similar here.
Has anything changed? Did last suggestion helped somehow? Still, not duplicate or anything similar has been filed so far.
Yes, I have installed a new version of JDK and installed NB 6.5, that seemed to solve the problem. I do not know why this would solve the problem but I suspect some corruption in the old JDK I was using. Thank you so much for all the help and dedication you showed in helping me resolve this issue, I appreciate it. Thanks
Thanks for confirmation. Closing as works-for-me. At least it helped to make the debugger a bit more robust due to various checks for this issue. The will surely help in the future :)