Skip to content

undefined method `join' for nil:NilClass #92

Closed
eegilbert opened this Issue Mar 25, 2012 · 9 comments

2 participants

@eegilbert

Hi,

I just discovered Collectd and Visage, very cool stuff!

I'm running Ubuntu server 11.10 and while I can start the application and add a system to a profile, when trying to view this profile I get the following in the Webrick output:

NoMethodError - undefined method `join' for nil:NilClass:
        /usr/lib/ruby/gems/1.8/gems/visage-app-2.0.0/lib/visage-app/views/profile.haml:13:in `evaluate_source'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:144:in `cached_evaluate'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:127:in `evaluate'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/haml.rb:24:in `evaluate'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:636:in `render'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:532:in `haml'
        /usr/lib/ruby/gems/1.8/gems/visage-app-2.0.0/lib/visage-app.rb:48:in `GET /profiles/:url'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `call'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `compile!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `[]'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `route!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:801:in `route_eval'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `route!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:822:in `process_route'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `catch'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `process_route'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:784:in `route!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `each'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `route!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:886:in `dispatch!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `invoke'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `catch'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `invoke'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:705:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/nulllogger.rb:9:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/head.rb:9:in `call'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/showexceptions.rb:21:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
        /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
        /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
        /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
        /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
        /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
        /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:13:in `run'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
        /usr/lib/ruby/gems/1.8/gems/visage-app-2.0.0/bin/visage-app:45
        /usr/bin/visage-app:19:in `load'
        /usr/bin/visage-app:19

I did have to update tilt to 1.3.3 before I could install visage-app via gem.

Erric

@auxesis auxesis was assigned Mar 25, 2012
@auxesis
Owner
auxesis commented Mar 25, 2012

Hi @eegilbert. Thanks for reporting this bug in Visage 2.0, and including a stack trace.

I'll take a look at the bug this evening, and will likely release an updated gem with the fix.

@auxesis
Owner
auxesis commented Mar 25, 2012

Hi @eegilbert, would you be able to post a copy of your profile.yaml into this issue?

I think there may be a race condition being triggered when Visage manipulates profile.yaml.

@auxesis
Owner
auxesis commented Mar 25, 2012

Also, through diagnosing this issue I managed to come across a JavaScript bug that stopped the save button from being rendered in newer versions of Firefox.

I've pushed out a 2.0.1 release that fixes this bug, and expect to push out another to fix this race condition.

@auxesis auxesis added a commit that referenced this issue Mar 25, 2012
@auxesis Merge branch 'gh-92' c784a32
@eegilbert

Hi auxesis, I have a profiles.yaml that contains:

root@afid:~# more /usr/lib/ruby/gems/1.8/gems/visage-app-2.0.0/lib/visage-app/config/profiles.yaml
--- 
afid+erric+local: 
  :profile_name: afid.erric.local
  :url: afid+erric+local
  :hosts: 
  - afid.erric.local
  :metrics: 

But that's all it contains. I did forget to mention I was doing this with Chrome 17.0.963.79 m

Thank you!

Erric

@auxesis
Owner
auxesis commented Mar 25, 2012

@eegilbert hmm ok, that's a bit weird - definitely a bug.

So you selected a host (afid.erric.local) in the builder interface, and then just saved a profile?

Did you select a metric as well before saving?

@eegilbert

I just updated to 2.0.2 with gem and then:

  1. Started the app with: visage-app start
  2. Typed afid.erric.local in the Hosts input box of the Builder
  3. Clicked on Show Graphs (nothing happens but the Save profile button appears)
  4. I type in the name afid.erric.local into the Save profile input box and then hit the Save profile button
  5. I click on Profiles and then click on erric.afid.local and get the stack trace

Stack Trace:

NoMethodError - undefined method `join' for nil:NilClass:
        /usr/lib/ruby/gems/1.8/gems/visage-app-2.0.2/lib/visage-app/views/profile.haml:13:in `evaluate_source'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:144:in `cached_evaluate'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:127:in `evaluate'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/haml.rb:24:in `evaluate'
        /usr/lib/ruby/gems/1.8/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:636:in `render'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:532:in `haml'
        /usr/lib/ruby/gems/1.8/gems/visage-app-2.0.2/lib/visage-app.rb:48:in `GET /profiles/:url'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `call'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:1211:in `compile!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `[]'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `route!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:801:in `route_eval'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:785:in `route!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:822:in `process_route'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `catch'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:820:in `process_route'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:784:in `route!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `each'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:783:in `route!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:886:in `dispatch!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `invoke'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `catch'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:871:in `invoke'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:719:in `call!'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/base.rb:705:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/nulllogger.rb:9:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/head.rb:9:in `call'
        /usr/lib/ruby/gems/1.8/gems/sinatra-1.3.2/lib/sinatra/showexceptions.rb:21:in `call'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:59:in `service'
        /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
        /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
        /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
        /usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
        /usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
        /usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
        /usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/handler/webrick.rb:13:in `run'
        /usr/lib/ruby/gems/1.8/gems/rack-1.4.1/lib/rack/server.rb:265:in `start'
        /usr/lib/ruby/gems/1.8/gems/visage-app-2.0.2/bin/visage-app:45
        /usr/bin/visage-app:19:in `load'
        /usr/bin/visage-app:19
10.0.0.54 - - [25/Mar/2012:05:39:59 PDT] "GET /profiles/afid+erric+local HTTP/1.1" 500 236411
http://afid.erric.local:9292/profiles -> /profiles/afid+erric+local
10.0.0.54 - - [25/Mar/2012:05:39:59 PDT] "GET /favicon.ico HTTP/1.1" 404 454

I've also tried this with Firefox and IE and get the same results.

Thank you!

Erric

@auxesis
Owner
auxesis commented Mar 25, 2012

Ah right, I know what's going on here - I'm missing some input validation.

I'm pushing a fix for this now in the 2.0.3 release. You'll need to recreate your profiles.yaml for this release.

I'll let you know when I've done the release.

@auxesis auxesis added a commit that referenced this issue Mar 25, 2012
@auxesis Merge branch 'gh-92' d425f0e
@auxesis
Owner
auxesis commented Mar 25, 2012

OK, I've pushed out 2.0.4 with a fix for this issue.

Please upgrade and let me know if you still have the issue!

@auxesis auxesis closed this Mar 25, 2012
@eegilbert

Yes, it's working now! :-) Thank you for the super quick turn around.

Erric

@ChrisLundquist ChrisLundquist pushed a commit to ChrisLundquist/visage that referenced this issue Oct 10, 2012
@auxesis Fix #92.
 - Check that there are hosts + metrics before trying to show the graph.
 - Only display save button + profile name input if the user has
   selected some hosts + metrics.
 - Display an error message to the user if they have not selected hosts
   or metrics.
e20bb36
@jessereynolds jessereynolds pushed a commit to jessereynolds/visage that referenced this issue Jun 17, 2015
@auxesis Bump patch version as part of #92 bugfix release to 2.0.1 ef4f8cc
@jessereynolds jessereynolds pushed a commit to jessereynolds/visage that referenced this issue Jun 17, 2015
@auxesis Merge branch 'gh-92' 6837565
@jessereynolds jessereynolds pushed a commit to jessereynolds/visage that referenced this issue Jun 17, 2015
@auxesis Fix #92.
 - Check that there are hosts + metrics before trying to show the graph.
 - Only display save button + profile name input if the user has
   selected some hosts + metrics.
 - Display an error message to the user if they have not selected hosts
   or metrics.
e863feb
@jessereynolds jessereynolds pushed a commit to jessereynolds/visage that referenced this issue Jun 17, 2015
@auxesis Merge branch 'gh-92' b73e9ee
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.