Project

General

Profile

Actions

Bug #18458

closed

Windows: ''dhcpsapi' gem fails to load downstream

Added by Daniel Helgenberger over 7 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
DHCP
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Issue

Running smart proxy on windows, dhcpsapi gem fails to load downstream:

E, [2017-02-08T18:44:27.169390 ] ERROR -- : Disabling all modules in the group ['dhcp_native_ms', 'dhcp'] due to a failure in one of them: cannot load such file -- dhcpsapi
D, [2017-02-08T18:44:27.169390 ] DEBUG -- : ["C:/TheForeman/smart-proxy/modules/dhcp_native_ms/plugin_configuration.rb:5:in `require'", "C:/TheForeman/smart-proxy/modules/dhcp_native_ms/plugin_configuration.rb:5:in `load_classes'", "C:/TheForeman/smart-proxy/lib/proxy/plugin_initializer.rb:294:in `load_classes'", "C:/TheForeman/smart-proxy/lib/proxy/plugin_initializer.rb:243:in `load_settings'", "C:/TheForeman/smart-proxy/lib/proxy/plugin_initializer.rb:81:in `block in load_provider_settings'", "C:/TheForeman/smart-proxy/lib/proxy/plugin_initializer.rb:80:in `each'", "C:/TheForeman/smart-proxy/lib/proxy/plugin_initializer.rb:80:in `load_provider_settings'", "C:/TheForeman/smart-proxy/lib/proxy/plugin_initializer.rb:155:in `block in initialize_plugins'", "C:/TheForeman/smart-proxy/lib/proxy/plugin_initializer.rb:155:in `each'", "C:/TheForeman/smart-proxy/lib/proxy/plugin_initializer.rb:155:in `initialize_plugins'", "C:/TheForeman/smart-proxy/lib/launcher.rb:134:in `launch'", "C:/TheForeman/smart-proxy/bin/smart-proxy:6:in `<main>'"]

Workaround:

Require dhcpsapi as the first gem in bin/smart-proxy:

$LOAD_PATH.unshift(*Dir[File.expand_path("../../lib", __FILE__), File.expand_path("../../modules", __FILE__)])

require 'dhcpsapi'
require 'smart_proxy_main'
Proxy::Launcher.new.launch

Gem env:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.7
  - RUBY VERSION: 2.0.0 (2015-04-13 patchlevel 645) [x64-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby200-x64/lib/ruby/gems/2.0.0
  - USER INSTALLATION DIRECTORY: C:/Users/Administrator/.gem/ruby/2.0.0
  - RUBY EXECUTABLE: C:/Ruby200-x64/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby200-x64/bin
  - SPEC CACHE DIRECTORY: C:/Users/Administrator/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
  - RUBYGEMS PLATFORMS:
    - ruby
    - x64-mingw32
  - GEM PATHS:
     - C:/Ruby200-x64/lib/ruby/gems/2.0.0
     - C:/Users/Administrator/.gem/ruby/2.0.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - :sources => ["https://rubygems.org"]
  - REMOTE SOURCES:
     - https://rubygems.org
  - SHELL PATH:
     - C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler
     - C:\ProgramData\chocolatey\bin
     - C:\Ruby200-x64\bin
     - C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler
     - C:\Python3\
     - C:\Python3\Scripts
     - C:\Windows\system32
     - C:\Windows
     - C:\Windows\System32\Wbem
     - C:\Windows\System32\WindowsPowerShell\v1.0\
     - C:\Program Files\TortoiseGit\bin
     - C:\Program Files\Microsoft SQL Server\110\Tools\Binn\
     - C:\Program Files\Puppet Labs\Puppet\bin
     - C:\Program Files\Git LFS
     - C:\Users\Administrator\AppData\Roaming\Python\Scripts
Actions #1

Updated by Daniel Helgenberger over 7 years ago

Forgot: I had to remove the require from modules/dhcp_native_ms/plugin_configuration.rb.

Actions #2

Updated by Anonymous over 7 years ago

How are you starting smart-proxy? If launching from command line, you'll need to use bundler (bundler exec ruby bin/smart-proxy), as we rely on it for dependency management. If you are running it as windows service, and the service have been installed for the previous version of smart-proxy, you'll need to remove it and install again using https://github.com/theforeman/smart-proxy/blob/develop/extra/register-service.rb.

Actions #3

Updated by Daniel Helgenberger over 7 years ago

Right, that was the issue. After re-registering service the gem loads now.

I see the issue was already mentioned in docs, it skipped my attention.

Pls close!

BTW: Great work with https://github.com/theforeman/smart-proxy/pull/445, performance seems to be better by multiples.

Actions #4

Updated by Anonymous over 7 years ago

  • Status changed from New to Resolved
Actions

Also available in: Atom PDF