-
Notifications
You must be signed in to change notification settings - Fork 722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nil:NilClass (NoMethodError) #53
Comments
Hmm seems to be trying to format code on a warning with no code associated with it. I'll look into it. |
Hi Phil, can you try this with the latest (1.5.1) just to make sure it has not already been fixed? Thanks! |
Justin, I did have an older version running, tried it with 1.5.1, same errors: Processing configuration... Indexing call sites... ed
Phil |
I cannot reproduce on my OSX box. Current running box is CentOS 5.6. If I specify checks, it seems to error when I have the "MassAssignment" check enabled. If I disable that one check, it works fine. |
Have done a bit more debugging. It seems that it has something to do with the Git clone of the repo. When I add the repo by hand to a separate directory and run brakeman, it works with no problems. If I run it on the clone done by Jenkins, it fails. Any thoughts? Running checks in parallel...
{:backtrace=>["could not parse /var/lib/jenkins/jobs/RightApiBrakemanScanner/workspace/lib/daemon/ec2_daemon.rb. There is probably a typo in the file. Test it with 'ruby_parse /var/lib/jenkins/jobs/RightApiBrakemanScanner/workspace/lib/daemon/ec2_daemon.rb'"], :error=>" parse error on value "true", 76"} |
Different Ruby versions, maybe? |
Justin, Nope, same exact Ruby, Rails, brakeman, ... Just different BaseOS, and the fact that Jenkins is doing the "git clone" Phil On Mon, Mar 12, 2012 at 9:04 PM, Justin <
Director of Security and Compliance |
Any idea what the code that involves Sorry, these kinds of problems can be a pain to track down. I'm really not sure why different copies of the code are behaving differently, though. |
Seems to be working now. Not sure what the deal was. |
Had the same problem and had to revert from 1.8.0 to 1.7.1 for it to work. |
@dfuentes77 can you clarify which problem you had? Can you paste the error/stack trace? Thanks! |
it was pretty much the same as the very first stack trace. I'd have to update my Gemfile again and duplicate it and I'm running tests against my app using 1.7.1 right now. I'd have to get back to you with the exact error. |
Okay, when you get a chance please run Brakeman with the |
I tried it again and for some reason, its working with 1.8.1 now. Don't know why. I reverted to 1.7.1 before and recently just changed the version in my Gemfile to 1.8.1 and did a "bundle update brakeman" and afterward it started working. Maybe another gem that was updated in my previous attempt was braking it. |
I fixed it in 1.8.1 ;) |
Got the same error through Jenkins, ran it by hand and got same problem. Run of other repositories on same system complete with no error. Any thoughts?
[Notice] Using Ruby 1.8.7. Please make sure this matches the one used to run your Rails application.
Processing application in /var/lib/jenkins/jobs/BrakemanScan/workspace
Processing configuration...
Processing gems...
Processing initializers...
Processing libs...
Processing routes...
Processing templates...
Processing data flow in templates...
Processing models...
Processing controllers...
Processing data flow in controllers...
Indexing call sites... ed
Running checks in parallel...
Checks finished, collecting results...
Generating report...
/opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman/warning.rb:74:in
format_code': private method
gsub' called for nil:NilClass (NoMethodError)from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman/warning.rb:88:in
format_message' from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman/warning.rb:98:in
to_row'from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman/report.rb:105:in
generate_warnings' from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman/report.rb:104:in
each'from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman/report.rb:104:in
generate_warnings' from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman/report.rb:339:in
to_s'from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman.rb:262:in
send' from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman.rb:262:in
scan'from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/../lib/brakeman.rb:55:in
run' from /opt/ruby-enterprise-1.8.7-2012.02/lib/ruby/gems/1.8/gems/brakeman-1.4.0/bin/brakeman:45 from /opt/ruby-enterprise-1.8.7-2012.02/bin/brakeman:19:in
load'from /opt/ruby-enterprise-1.8.7-2012.02/bin/brakeman:19
The text was updated successfully, but these errors were encountered: