astro / socksify-ruby

Redirect any TCP connection initiated by a Ruby script through a SOCKS5 proxy
http://socksify.rubyforge.org/
Other
165 stars 80 forks source link

Error with torquebox 3.2.0/ jRuby 9.0.5.0 #29

Closed rusch closed 2 years ago

rusch commented 8 years ago

Deploying an application in Torquebox fails with the following error message:

Caused by: org.jruby.exceptions.RaiseException: (GemRequireError) There was an error while trying to load the gem 'savon'. Gem Load Error is: undefined local variable or method num' for #<Socksify::Color:0x30580987> Backtrace for gem load error is: /opt/torquebox/jruby/lib/ruby/gems/shared/gems/socksify-1.7.0/lib/socksify/debug.rb:24:into_s'

The following diff fixes the problem:

--- socksify-1.7.0/lib/socksify/debug.rb.orig   2016-10-13 14:40:25.244538919 +0200
+++ socksify-1.7.0/lib/socksify/debug.rb    2016-10-13 14:44:18.516043198 +0200
@@ -19,7 +19,9 @@
     def self::to_s
       new.to_s
     end
-
+
+    def num; 37; end
+
     def to_s
       "\e[1m\e[#{num}m"
     end
musybite commented 6 years ago

Adding num to abstract Color class looks like little overkill to me. If this issue is still relevant, could you provide complete backtrace?

dub357 commented 5 years ago

FYI - this is still an issue. The problem occurs because Torquebox calls 'to_s' on every class that the app loads and in the case of Socksify::Color, its class to_s method simply instantiates a new Color object and calls 'to_s' on it. The 'to_s' method of Color references the 'num' method, which isn't defined in Color Here is the stack:

08:50:41,654 ERROR [stderr] (pool-1-thread-24) Gem Load Error is: undefined local variable or method `num' for #

08:50:41,654 ERROR [stderr] (pool-1-thread-24) Backtrace for gem load error is:

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/socksify-1.7.1/lib/socksify/debug.rb:24:in `to_s'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/socksify-1.7.1/lib/socksify/debug.rb:20:in `to_s'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) uri:classloader:/org/torquebox/web/rails/boot.rb:29:in `method_added'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/socksify-1.7.1/lib/socksify/debug.rb:23:in `'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/socksify-1.7.1/lib/socksify/debug.rb:2:in `'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/socksify-1.7.1/lib/socksify/debug.rb:1:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/socksify-1.7.1/lib/socksify.rb:1:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/socksify-1.7.1/lib/socksify.rb:21:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/httpi-2.4.4/lib/httpi/adapter/net_http.rb:1:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/httpi-2.4.4/lib/httpi/adapter/net_http.rb:7:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/httpi-2.4.4/lib/httpi.rb:1:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/httpi-2.4.4/lib/httpi.rb:10:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/savon-2.12.0/lib/savon/options.rb:1:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/savon-2.12.0/lib/savon/options.rb:2:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:236:in `load_dependency'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/activesupport-3.2.22/lib/active_support/dependencies.rb:251:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/savon-2.12.0/lib/savon/operation.rb:1:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/savon-2.12.0/lib/savon/operation.rb:1:in `block in (root)'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/savon-2.12.0/lib/savon/client.rb:1:in `block in (root)'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyArray.java:1734:in `each'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/savon-2.12.0/lib/savon/client.rb:1:in `(root)'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/savon-2.12.0/lib/savon.rb:1:in `(root)'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/savon-2.12.0/lib/savon.rb:26:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/jlab-mis-web-service-4.0.1/lib/jlab-mis-web-service/engine.rb:1:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:974:in `load'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/jlab-mis-web-service-4.0.1/lib/jlab-mis-web-service/engine.rb:2:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/jlab-mis-web-service-4.0.1/lib/jlab-mis-web-service.rb:1:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) Bundler Error Backtrace:

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/bundler-1.13.1/lib/bundler/runtime.rb:95:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/bundler-1.13.1/lib/bundler/runtime.rb:86:in `block in require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyArray.java:1734:in `each'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/bundler-1.13.1/lib/bundler/runtime.rb:75:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/misSoftware/mis-torquebox-3.2.0/jruby/lib/ruby/gems/shared/gems/bundler-1.13.1/lib/bundler.rb:106:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/railsApps/railsForms/config/application.rb:7:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/railsApps/railsForms/config/environment.rb:1:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:974:in `load'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) C:/railsApps/railsForms/config/environment.rb:2:in `

'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) org/jruby/RubyKernel.java:956:in `require'

08:50:41,654 ERROR [stderr] (pool-1-thread-24) uri:classloader:/org/torquebox/web/rails/boot.rb:1:in `

'

dub357 commented 5 years ago

FYI - I can create a pull request for this if needed but it seems like an easy fix. Perhaps it can make it into 1.7.2 soon? As-is, pretty much any version of sockify is un-usable on Torquebox

MatzFan commented 2 years ago

Fixed via #38