seattlerb/ruby_parser

Forced $DEBUG output after 3.10.0 to 3.10.1 upgrade

smlsml opened this issue · 10 comments

After upgrading the gem from 3.10.0 to 3.10.1, I'm now getting a ton of output that was never there before. I could see this being useful during a deep debug perhaps, but not on by default.

Any ideas? Downgrading back to 3.10.0 makes this go away.

Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251 - cannot load such file -- 2.3.5/ruby_prof.so
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:240 - cannot load such file -- 2.3.5/ruby_prof.so
Exception `Errno::ENOENT' at /Users/slawson/code/manager/manager/config/application.rb:30 - No such file or directory @ rb_sysopen - config/svmanager.yml
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251 - cannot load such file -- idn
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:240 - cannot load such file -- idn
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251 - cannot load such file -- idn
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:240 - cannot load such file -- idn
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251 - cannot load such file -- fast_xs
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:240 - cannot load such file -- fast_xs
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251 - cannot load such file -- data_mapper
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:240 - cannot load such file -- data_mapper
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251 - cannot load such file -- mongoid
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:240 - cannot load such file -- mongoid
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_validators' not defined in #<Class:0x00007f981df20050>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_initialize_callbacks' not defined in #<Class:0x00007f981df20050>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_save_callbacks' not defined in #<Class:0x00007f981df20050>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_find_callbacks' not defined in #<Class:0x00007f981df20050>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_validate_callbacks' not defined in #<Class:0x00007f981df20050>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_validators' not defined in #<Class:0x00007f981fa212c8>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_accessible_attributes' not defined in #<Class:0x00007f981fa212c8>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_active_authorizer' not defined in #<Class:0x00007f981fa212c8>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_save_callbacks' not defined in #<Class:0x00007f981fa212c8>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_validators' not defined in #<Class:0x00007f981f04b668>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `reflections' not defined in #<Class:0x00007f981f04b668>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_save_callbacks' not defined in #<Class:0x00007f981f04b668>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_validate_callbacks' not defined in #<Class:0x00007f981f04b668>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_validation_callbacks' not defined in #<Class:0x00007f981f04b668>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_validators' not defined in #<Class:0x00007f981eee30f0>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_save_callbacks' not defined in #<Class:0x00007f981eee30f0>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_destroy_callbacks' not defined in #<Class:0x00007f981eee30f0>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `reflections' not defined in #<Class:0x00007f981eee30f0>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_create_callbacks' not defined in #<Class:0x00007f981eee30f0>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_update_callbacks' not defined in #<Class:0x00007f981eee30f0>
Exception `NameError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/core_ext/module/remove_method.rb:4 - method `_validate_callbacks' not defined in #<Class:0x00007f981eee30f0>

It even outputs http traffic:

-> "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<soapenv:Envelope xmlns:soapenc=\"http://schemas.xmlsoap.org/soap/encoding/\"\n xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"\n xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"\n xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n<soapenv:Body>\n<RetrievePropertiesResponse xmlns=\"urn:vim25\"><returnval><obj type=\"Datastore\">datastore-11</obj><propSet><name>summary</name><val xsi:type=\"DatastoreSummary\"><datastore type=\"Datastore\">datastore-11</datastore><name>dev1-datastore-01</name><url>ds:///vmfs/volumes/54f0b4da-b7fe48d8-234a-b083fee5945a/</url><capacity>291252469760</capacity><freeSpace>249831620608</freeSpace><uncommitted>144411224082</uncommitted><accessible>true</accessible><multipleHostAccess>false</multipleHostAccess><type>VMFS</type><maintenanceMode>normal</maintenanceMode></val></propSet></returnval></RetrievePropertiesResponse>\n</soapenv:Body>\n</soapenv:Envelope>"
read 931 bytes
Conn keep-alive
<- "POST /sdk HTTP/1.1\r\nContent-Type: text/xml; charset=utf-8\r\nSoapaction: urn:vim25/6.0\r\nCookie: vmware_soap_session=\"xxxxxxxxxxx\"; Path=/; HttpOnly; Secure;\r\nAccept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3\r\nAccept: */*\r\nUser-Agent: Ruby\r\nHost: dev1-av-vc.eng.vmware.com\r\nContent-Length: 544\r\n\r\n"
<- "<env:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:env=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><env:Body><RetrieveProperties xmlns=\"urn:vim25\"><_this type=\"PropertyCollector\">propertyCollector</_this><specSet xsi:type=\"PropertyFilterSpec\"><propSet xsi:type=\"PropertySpec\"><type>Datacenter</type><pathSet>name</pathSet></propSet><objectSet xsi:type=\"ObjectSpec\"><obj type=\"Datacenter\">datacenter-46</obj></objectSet></specSet></RetrieveProperties></env:Body></env:Envelope>"
-> "HTTP/1.1 200 OK\r\n"
-> "Date: Thu, 1 Feb 2018 23:39:52 GMT\r\n"
-> "Cache-Control: no-cache\r\n"
-> "Connection: Keep-Alive\r\n"
-> "Content-Type: text/xml; charset=utf-8\r\n"
-> "X-Frame-Options: DENY\r\n"
-> "Content-Length: 539\r\n"
-> "\r\n"
reading 539 bytes...

I added a line to our app to output the value of $DEBUG

When bundled with ruby_parser 3.9.0, the value of $DEBUG is false
When bundled with ruby_parser 3.10.1, the value of $DEBUG is true

This is with no other changes... I'm comparing the diff between the versions on github, don't see anything obvious, hum.

Can you tell me if you had a version bump in sexp_processor or any other deps?

BTW... just for your hunt: ruby -d will also cause this...

I did add this code:

+$DEBUG = true if ENV["DEBUG"]

so check env | grep DEBUG

so to be clear... 3.10.0 doesn't have the problem for you. It is 3.10.1 that uses ENV["DEBUG"]. Something, somewhere has to be setting this variable in your env, or something is running with ruby -d (which also sets the variable).

For now, I'd stick to 3.10.0 as it has some nice extensions and fixes in it.

Now that I know it is just $DEBUG, I can work-around this. But just for curiosity sake, I'll keep looking :)

Check this out.

ruby_parser 3.10.0:

before boot.rb: ENV DEBUG is "" AND DEBUG constant is "false"
before boot.rb: $DEBUG is "false"
after require rails/all: ENV DEBUG is "" AND DEBUG constant is "false"
after require rails/all: $DEBUG is "false"
I, [2018-02-03T06:47:02.181387 #54514]  INFO -- Xcessman::Xcess::BundleExec: Pinging http://127.0.0.1:3001/cv_api/version 
I, [2018-02-03T06:47:02.182148 #54514]  INFO -- Xcessman::Xcess::BundleExec: Server not yet accepting connections...
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:251 - cannot load such file -- 2.3.5/ruby_prof.so
Exception `LoadError' at /Users/slawson/.rvm/gems/ruby-2.3.5@manager-ruby23/gems/activesupport-3.2.22.5/lib/active_support/dependencies.rb:240 - cannot load such file -- 2.3.5/ruby_prof.so
after bundler: ENV DEBUG is "" AND constant is "false"
after bundler: $DEBUG is "true"
Exception `Errno::ENOENT' at /Users/slawson/code/manager/manager/config/application.rb:40 - No such file or directory @ rb_sysopen - config/svmanager.yml
end application.rb: ENV DEBUG is "" AND DEBUG constant is "false"
end application.rb: $DEBUG is "true"

ruby_parser 3.10.1

before boot: ENV DEBUG is "" AND constant is "false"
before boot: $DEBUG is "false"
after rails: ENV DEBUG is "" AND constant is "false"
after rails: $DEBUG is "false"
I, [2018-02-03T06:48:08.923298 #54667]  INFO -- Xcessman::Xcess::BundleExec: Pinging http://127.0.0.1:3001/cv_api/version 
I, [2018-02-03T06:48:08.923964 #54667]  INFO -- Xcessman::Xcess::BundleExec: Server not yet accepting connections...
after bundler: ENV DEBUG is "" AND constant is "false"
after bundler: $DEBUG is "false"
end app.rb: ENV DEBUG is "" AND constant is "false"
end app.rb: $DEBUG is "false"
* Listening on tcp://127.0.0.1:3001
Use Ctrl-C to stop

Did you annotate that correctly? Your original bug is about "Forced $DEBUG output after 3.10.0 to 3.10.1 upgrade" but now you're saying that $DEBUG isn't set in 3.10.1?

Can you send over your Gemfile so I might replicate your environment?

You definitely want ENV.delete "DEBUG" or, from the outside, unset DEBUG