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 125084 - Modifications in script/server cause Run action to not launch browser
Summary: Modifications in script/server cause Run action to not launch browser
Status: RESOLVED FIXED
Alias: None
Product: ruby
Classification: Unclassified
Component: Rails (show other bugs)
Version: 6.x
Hardware: All All
: P2 blocker with 2 votes (vote)
Assignee: Erno Mononen
URL:
Keywords:
: 124381 (view as bug list)
Depends on: 125992 125996
Blocks:
  Show dependency tree
 
Reported: 2008-01-11 03:43 UTC by Chris Kutler
Modified: 2008-03-14 13:21 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Capture of latest build(note the build no.) (126.45 KB, text/plain)
2008-01-18 09:38 UTC, cheops2006
Details
Log File From Debug Info Enabled (35.35 KB, text/plain)
2008-01-21 11:59 UTC, cheops2006
Details
A new attached log file from the hudson link of netbeans (51.81 KB, text/plain)
2008-01-22 07:34 UTC, cheops2006
Details
Tried the new version but it still doesn't work attached a log again. Ade (40.93 KB, text/plain)
2008-01-22 20:42 UTC, cheops2006
Details
Brand new log file - failing to start mongrel in 121 seconds (44.07 KB, text/plain)
2008-01-24 11:16 UTC, cheops2006
Details
Broken Webrick Log File, Thanyou for fixing Mongrel Much Appreciated. Ade (49.51 KB, text/plain)
2008-01-24 19:28 UTC, cheops2006
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Kutler 2008-01-11 03:43:25 UTC
Using NetBeans IDE 6.0, bundled JRuby and Mongrel 1.1.3 (Java).

When I click the Run Main Project button, the IDE successfully starts up the Mongrel server, but does not show the
application in a browser. For a short while, the IDE flashes in the lower left margin of the IDE "could not connect to
the web server. Cannot show http://localhost:3000.

I can then go to my browser, enter the url http://localhost:3000 and the application displays. 

Also every time I click Run Main Program, the IDE starts up another mongrel server.

Martin said: This sounds like a bug. Probably there is kind of timeout which is to short for JVM with Mongrel to start up.
Comment 1 cheops2006 2008-01-13 23:42:43 UTC
I too have this problem.

I initially thought I had a problem with windows and did a totally new install.

The problem still exists on a brand new install

Comment 2 Erno Mononen 2008-01-15 15:12:59 UTC
Reproducible, I'll look into this. For the record, http://jira.codehaus.org/browse/JRUBY-1277 prevented me from 
reproducing this on Linux, but after upgrading to JRuby 1.0.3 I can see the described problem.
Comment 3 Jiri Skrivanek 2008-01-16 14:25:14 UTC
I am also able to reproduce it with WEBrick. First run doesn't show browser, second run opens browser.
Comment 4 Erno Mononen 2008-01-16 16:02:47 UTC
Should be fixed in trunk now, please give it a try. Was caused by two things: for Mongrel 1.1.3 the detection of server 
startup failed and for WEBrick the timeout was too short (it is now 60 seconds instead of 20).

http://ruby.netbeans.org/source/browse/ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/server/
RailsServer.java?r1=1.19&r2=1.20
http://ruby.netbeans.org/source/browse/ruby/railsprojects/test/unit/src/org/netbeans/modules/ruby/railsprojects/server/
RailsServerTest.java?r1=1.1&r2=1.2
http://ruby.netbeans.org/source/browse/ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/server/
RailsServer.java?r1=1.18&r2=1.19
http://ruby.netbeans.org/source/browse/ruby/railsprojects/test/unit/src/org/netbeans/modules/ruby/railsprojects/server/
RailsServerTest.java?rev=1.1&content-type=text/vnd.viewcvs-markup
http://ruby.netbeans.org/source/browse/ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/server/
RailsServer.java?r1=1.17&r2=1.18
Comment 5 cheops2006 2008-01-17 11:43:30 UTC
Tried the nightly build and its still doesn't work I have installed ruby/rails/gems/mongrel/mongrel cluster and added 
it as an addtional platform and set my project to use it however the problem still exists

let me know if you need any more info

Ade.
Comment 6 Erno Mononen 2008-01-17 13:36:50 UTC
cheops2006 : can you see any message in the lower left margin (e.g. "could not connect to ...")? Also, it would help if 
you could paste the server startup message here. It is also possible that the changes I committed are not yet in the 
last nightly build, so could you please try with the next nightly build or with a continuos build?
Comment 7 Erno Mononen 2008-01-17 15:41:59 UTC
*** Issue 124381 has been marked as a duplicate of this issue. ***
Comment 8 Jiri Skrivanek 2008-01-18 08:53:24 UTC
I worked for me both with WEBrick and Mongrel. First I tested WEBrick and then I used 'Tools|Ruby Gems' to install mongrel.

Product Version: NetBeans IDE Dev (Build 20080118054535)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1250; cs_CZ (nb)
Comment 9 Erno Mononen 2008-01-18 09:05:51 UTC
OK, I'm marking this as fixed again - cheops2006, please try again with the latest nightly build and reopen (preferably 
with the server startup log) if you still see the issue. I suspect that the fix was not yet included in the build you 
tried. Thanks!
Comment 10 cheops2006 2008-01-18 09:38:08 UTC
Created attachment 55236 [details]
Capture of latest build(note the build no.)
Comment 11 Erno Mononen 2008-01-18 10:59:27 UTC
Thanks for the attachment, clearly you are still experiencing the issue. Could you still attach the list of mongrel 
related gems that you have installed? It looks like you might run into this issue the version no. for the 'mongrel' gem 
could not be retrieved.
Comment 12 Martin Krauskopf 2008-01-18 11:12:31 UTC
Erno, often we are using in Ruby logging:

http://wiki.netbeans.org/wiki/view/FaqRubyNBLogging

So you might add the logging, e.g. the list of the gems and their version you need when the problem occurred (and
possibly update the FaqRubyNBLogging to include the package/module you need). After you commit, user will get new
version and give you detailed output log. I'm doing this quite often and quite often it helps.
But not sure how much appropriate here, I do not watch closely.
Comment 13 cheops2006 2008-01-18 11:27:32 UTC
Hi, 

Here are a list of all my installed gems.

Let me know if you need anything else.

actionmailer (2.0.2)
actionpack (2.0.2)
activerecord (2.0.2)
activeresource (2.0.2)
activesupport (2.0.2)
capistrano (2.1.0)
cgi_multipart_eof_fix (2.5.0)
fastthread (1.0.1)
fxri (0.3.6)
fxruby (1.6.13, 1.6.12)
gem_plugin (0.2.3)
highline (1.4.0)
hpricot (0.6)
log4r (1.0.5)
mongrel (1.1.3)
mongrel_cluster (1.0.5)
mysql (2.7.3)
needle (1.3.0)
net-sftp (1.1.0)
net-ssh (1.1.2)
rails (2.0.2)
rake (0.8.1, 0.7.3)
ruby-debug-base (0.9.3)
ruby-debug-ide (0.1.9)
sources (0.0.1)
win32-api (1.0.5, 1.0.0)
win32-clipboard (0.4.3)
win32-dir (0.3.2)
win32-eventlog (0.4.7, 0.4.6)
win32-file (0.5.2)
win32-file-stat (1.2.7, 1.2.5)
win32-process (0.5.5, 0.5.3)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.2.0)
windows-pr (0.7.4, 0.7.1)

Ade.
Comment 14 Erno Mononen 2008-01-18 14:56:06 UTC
Unfortunately I still cannot reproduce the problem. I added some logging to track down the issue, it should make it to 
tomorrow's nightly build (for today's build it is probably too late), so it would be great if you could try it with the 
following startup parameters (for enabling logging):

-J-Dorg.netbeans.modules.ruby.level=300 -J-Dorg.netbeans.api.ruby.platform.level=300  

and post the log here then. Please see http://wiki.netbeans.org/wiki/view/FaqRubyNBLogging for more details on how to 
turn on logging or feel free to ask if it is unclear. Of course, even better would be if you could test it with a 
continuous build from http://deadlock.netbeans.org/hudson/job/trunk so that there would be more time to fix this for 
6.1M1 (Sunday is the last day for that). The extra logging will be available in a few hours in the upcoming build 
#5303, possibly in #5302 already.
Comment 15 Erno Mononen 2008-01-21 08:31:59 UTC
Marking as incomplete for now, please attach the log file when you have a chance to try this again.
Comment 16 cheops2006 2008-01-21 11:59:36 UTC
Created attachment 55310 [details]
Log File From Debug Info Enabled
Comment 17 cheops2006 2008-01-21 12:01:03 UTC
Hi, I have attached the log file from the debug info enabled.

The thing that strikes me is the fact that it cannot run autotest.bat.

Please let me know your thoughts.
Comment 18 Erno Mononen 2008-01-21 14:36:25 UTC
Thanks for following up on this. It looks like the culprit is that for some reason GemManager can't see that Mongrel is 
indeed installed, but I will still need to add more logging there to find out what exactly goes wrong. Do you see the 
same problem with all your rails projects and platforms (i.e. ruby and jruby), including newly created projects?

Comment 19 cheops2006 2008-01-21 15:03:41 UTC
Yes it does it on existing projects and newly created ones so is quite easily repeatable.

Ade.
Comment 20 Martin Krauskopf 2008-01-21 19:36:38 UTC
Hi there. Could you repeat the procedure you did before and attach the log again. Erno put there some more logging which
should help to debug the problem.
Comment 21 Martin Krauskopf 2008-01-21 19:38:29 UTC
> The thing that strikes me is the fact that it cannot run autotest.bat.

What does this exactly mean? Do you thinks so from the log, or it is a real problem. Please in the second case, file a
bug. If the first case, do not believe that logging, it is a little confusing. I'm going to enhance it a little bit.
Comment 22 Erno Mononen 2008-01-21 19:56:55 UTC
> Hi there. Could you repeat the procedure you did before and attach the log again. Erno put there some more logging 
which
> should help to debug the problem.

But not just yet;) The logging I added will not be in today's nightly build. But if you don't mind trying a continuous 
build (no installer, just a zip), here's a link to the build that contains the added logging: 

http://deadlock.netbeans.org/hudson/job/trunk/5337/artifact/nbbuild/dist/zip/
Comment 23 Martin Krauskopf 2008-01-21 20:02:12 UTC
Yup, I meant build from Hudson. I would encourage everybody to use builds from Hudson:

  http://deadlock.netbeans.org/hudson/job/ruby/

I actually do not know any reason for preferring nightly builds. They are often quite old ;)
Comment 24 cheops2006 2008-01-22 07:34:35 UTC
Created attachment 55348 [details]
A new attached log file from the hudson link of netbeans
Comment 25 Martin Krauskopf 2008-01-22 08:11:22 UTC
Thanks for the great feedback. Now it's clear. There is a bug in the version parsing. It might be theoretically
encountered on non-windows as well and is not actually a mongrel specific.

This is the problem which I would like to solve with providing either a special wrapper script written in Ruby which we
would call from the NetBeans (similar to platform/release/platfrom_info.rb for platform's information gathering). The
script would use RubyGems's API and have output produced and consumed by us.
Current situation when we parse the output of gem tool is not usable for longer time. If gem tool is e.g. localized our
GemManager's "parser" would fails. This case is another one. Might be that bringing support of Gem Path would be the
next problem.
Might be we can still stay with some simple solution (some clever regexp - however not sure if it there is a good
solution) or it is time to switch to the wrapper.
Or another solution is to call gem tool in some special way, but would need probably more calls which would be slow.
Actually I forgot why we do not use e.g. "gem list --local --versions" for parsing gems and their versions, and looking
into the guts for the Repository instead.
Comment 26 cheops2006 2008-01-22 10:45:06 UTC
I can confirm that the same problem exists on linux(ubuntu) as I tried it out today.

Thanks

Ade.
Comment 27 Erno Mononen 2008-01-22 14:09:18 UTC
I'm working on this, but after discussion with the QE we agreed that the fix won't be integrated to the M1 branch.
Comment 28 Erno Mononen 2008-01-22 19:03:47 UTC
Hopefully fixed now, please give it a try (with a build >= 6274):

http://deadlock.netbeans.org/hudson/job/ruby/
Comment 29 Chris Kutler 2008-01-22 19:53:26 UTC
Works for me now. Build 6247 on Windows XP warped to my Firefox browser. 
Comment 30 cheops2006 2008-01-22 20:42:15 UTC
Created attachment 55399 [details]
Tried the new version but it still doesn't work attached a log again. Ade
Comment 31 Erno Mononen 2008-01-22 21:03:24 UTC
Strange, it looks like Mongrel is now recognized correctly on your machine as well. Does the same error message still 
flash in the lower left corner? Also, just to be sure that we are not doing anything differently, could you please post 
the exact steps how you can reproduce the problem (from the scratch, i.e. with a new project)? Thanks a lot.
Comment 32 cheops2006 2008-01-22 21:17:28 UTC
Hi

All I did was create a new rails project and ran the application, yes cannot connect to the web server etc...in the 
corner as usual.

ade
Comment 33 Erno Mononen 2008-01-23 13:51:17 UTC
I added still more logging, changed slightly the regex used for detecting Mongrel startup and increased the server 
startup timeout. So again, please try with a continuous build 6286 or higher and attach the log file here.

http://ruby.netbeans.org/source/browse/ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/server/
RailsServer.java?r1=1.21&r2=1.22
http://ruby.netbeans.org/source/browse/ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/server/
RailsServer.java?r1=1.22&r2=1.23
Comment 34 cheops2006 2008-01-24 11:16:24 UTC
Created attachment 55485 [details]
Brand new log file - failing to start mongrel in 121 seconds
Comment 35 Erno Mononen 2008-01-24 14:25:04 UTC
Thanks for the log file. Now this is hopefully fixed, finally. Turns out that on your setup the output lines contained 
end of line characters and the regex for detecting server startup failed due to them. Strange is that this worked for 
jskrivanek with a similar setup (the same JDK + WinXp). In any case, the fix should be integrated in build 6305 (should 
be availabe in an hour or so), please verify when you have a chance.

Checking in test/unit/src/org/netbeans/modules/ruby/railsprojects/server/RailsServerTest.java;
/cvs/ruby/railsprojects/test/unit/src/org/netbeans/modules/ruby/railsprojects/server/RailsServerTest.java,v  <--  
RailsServerTest.java
new revision: 1.3; previous revision: 1.2
done
Checking in src/org/netbeans/modules/ruby/railsprojects/server/RailsServer.java;
/cvs/ruby/railsprojects/src/org/netbeans/modules/ruby/railsprojects/server/RailsServer.java,v  <--  RailsServer.java
new revision: 1.24; previous revision: 1.23
done
Comment 36 cheops2006 2008-01-24 18:52:53 UTC
Mongrel Fixed but Webrick now Broken.
Comment 37 Erno Mononen 2008-01-24 19:07:08 UTC
Could you please attach the log file once again?
Comment 38 cheops2006 2008-01-24 19:28:58 UTC
Created attachment 55529 [details]
Broken Webrick Log File, Thanyou for fixing Mongrel Much Appreciated. Ade
Comment 39 Erno Mononen 2008-01-24 19:43:24 UTC
How did you force Webrick to be started by script/server? Currently we expect that the script will start Mongrel if it 
is installed and if no extra params are passed, so this fails for Webrick now in your case since you have Mongrel 
installed but script/server starts Webrick. Note that we are currenly working on making the target server selectable 
via the UI, so this will be available in 6.1.   
Comment 40 cheops2006 2008-01-24 20:48:06 UTC
I used this

ARGV[0]="webrick"

in scripts/server file

Ade
Comment 41 Chris Kutler 2008-01-24 23:18:32 UTC
Just want to add a note that info about the Mongrel server is at http://wiki.netbeans.org/FaqRailsMongrel (including the
part about ARGV[0]="webrick"
Comment 42 Erno Mononen 2008-01-25 08:46:46 UTC
I see, that's definitely a valid use case. Need to make some changes to the current logic to handle this case, I will 
address it together with the other upcoming changes in the server integration area. In any case, I'm dowgrading this to 
P2 as there is a workaround.
Comment 43 Martin Krauskopf 2008-01-25 10:30:06 UTC
BTW, better to leave the original problem/issue as closed (since it really was "Wrong parsing of version from
multidashed gem .spec's filenames") and file a new one then to mutate the issue into another, actually unrelated, one.
So we can point users which encounter this in older versions of NetBeans (with e.g. non-rails gems) that it is fixed,
with clear subject.
Comment 44 Erno Mononen 2008-01-25 10:53:05 UTC
True, it occurred to me after I changed the summary. But actually there were more than one original problems; there was 
a problem with detecting the server startup when the startup msg included a version number (and too short timeout for 
webrick) which caused problems on all platforms. So one could argue that in fact already the first change of the 
summary confused things and that a separate issue would be needed for the multidashed gem name problem as well. Not to 
say that the second change made things any less confusing:) So let me file issues for them both..
Comment 45 Martin Krauskopf 2008-01-25 11:10:41 UTC
Yup, right. Ehm, who did the first change... ups, me :)
Thanks for handling it.
Comment 46 Erno Mononen 2008-01-25 12:20:09 UTC
OK, so I filed #125992 and #125996 for the original problems. Could've closed this one and filed new one for the issue 
in the summary, but I've grown so attached to this one that I didn't have the heart to close it just yet.
Comment 47 Erno Mononen 2008-03-14 13:21:44 UTC
Fixed, changeset 246655140938.