Support #10098
closedDoes anyone have an updated procedure to install smart proxy on a Windows Server 2008 R2 OS?
Description
After upgrading foreman to 1.7.2 we realized when spinning up VM's in our vmware environment that the VM's couldn't pull a dhcp address for reservation from our MS DC's. Having been through this before I figured I would also have to upgrade the smart-proxy box which is running on a MS Srvr2008R2 box. Ive followed this procedure http://projects.theforeman.org/projects/smart-proxy/wiki/MS_DHCP and we cannot get the proxy service to run. When running the ruby bin\smart-proxy I get the below output. Any help much appreciated as I've spent days on this.
[2015-04-08 15:47:19] INFO WEBrick 1.3.1
[2015-04-08 15:47:19] INFO ruby 1.8.7 (2011-02-18) [i386-mingw32]
C:/Ruby187/lib/ruby/1.8/webrick/utils.rb:63:in `getaddrinfo': getaddrinfo: The s
torage control blocks were destroyed. (SocketError)
from c:/foreman/lib/smart_proxy.rb:144:in `join'
from c:/foreman/lib/smart_proxy.rb:144:in `launch'
from bin/smart-proxy:6
Files
Updated by Aaron Reed over 9 years ago
We have the 1.8 stable smart proxy installed btw.
Updated by Anonymous over 9 years ago
This chapter of the docs just got updated: http://theforeman.org/manuals/1.8/index.html#4.3.5DHCP -> 4.3.5.3
Please report back, if that helps.
Updated by Dominic Cleal over 9 years ago
- Tracker changed from Bug to Support
- Status changed from New to Feedback
Updated by Aaron Reed over 9 years ago
Getting this error
C:/Ruby193/lib/ruby/1.9.1/webrick/utils.rb:75:in `getaddrinfo': getaddrinfo: No
such host is known. (SocketError)
from C:/Ruby193/lib/ruby/1.9.1/webrick/utils.rb:75:in `create_listeners'
from C:/Ruby193/lib/ruby/1.9.1/webrick/ssl.rb:88:in `listen'
from C:/Ruby193/lib/ruby/1.9.1/webrick/server.rb:70:in `initialize'
from C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:45:in `initialize'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/web
rick.rb:11:in `new'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/web
rick.rb:11:in `run'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/server.rb:2
64:in `start'
from c:/foreman/lib/smart_proxy.rb:136:in `block in launch'
Updated by Benjamin Papillon over 9 years ago
Hello,
Please check that the smart proxy port you configured is not already in use.
Updated by Aaron Reed over 9 years ago
This port is not in use on that server. This has been verified.
Updated by Aaron Reed over 9 years ago
- File dhcp.yml dhcp.yml added
- File settings.yml settings.yml added
Here is an example of our config. Obviously some things are changed.
Updated by Aaron Reed over 9 years ago
Just for grins I spun up a brand new server2008R2 fresh install. Followed the procedure to the letter and getting same error. I'm also getting this error in the debug log about the dhcp server vendor set to isc even thought its set to native_ms in the dhcp.yml file
I, [2015-04-15T16:09:44.072672 #4024] INFO -- : 'dhcp' settings were initialized with default values: :dhcp_provider: isc
Updated by Aaron Reed over 9 years ago
Any help or info on this much appreciated.
Updated by Benjamin Papillon over 9 years ago
I've ran the procedure again and found some mistakes. I can replicate your problem when I specify this command in settings.yml
:bind_host: '*'
witch can be replaced with this:
:bind_host: 0.0.0.0
Updated by Aaron Reed over 9 years ago
Ok, so when I run ruby bin\smart-proxy.rb I get this message and it never goes back to a prompt but we are making progress as it looks like it accepts the keys.
[2015-04-30 15:18:39] INFO WEBrick::HTTPServer#start: pid=2732 port=8443
When I try to install the service using ruby extra\register-service.rb this is what I get.
extra/register-service.rb:2:in `<main>': uninitialized constant PLATFORM (NameError)
Updated by Benjamin Papillon over 9 years ago
Actually the service option is broken. We are trying to resolve the issue as fast as possible. If the proxy is not going back to a prompt then is is working, waiting for requests.
Updated by Aaron Reed over 9 years ago
Getting this error
2015-05-04 12:41:00 - LoadError - cannot load such file -- win32/open3:
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `re
quire'
Updated by Aaron Reed over 9 years ago
That's when trying to pull a dhcp address from foreman.
Updated by Benjamin Papillon over 9 years ago
Please try the patch in this pull request : https://github.com/theforeman/smart-proxy/pull/282
Updated by Aaron Reed over 9 years ago
This worked! Was able to pull an IP from DHCP. Thank you thank you!
Updated by Aaron Reed over 9 years ago
I'll keep an eye out when the service portion will be fixed. Thanks again Ben!
Updated by Aaron Reed over 9 years ago
I spoke too soon. When I actually create a VM this is what I get. task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request)
Updated by Daniel Erxleben over 9 years ago
log message from Forman host: Failed to save: Create DHCP Settings for testervm.42six.com task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://mastermd.42six.com:8443/dhcp
DHCP entry gets added - not sure why its freaking out.
Updated by Aaron Reed over 9 years ago
The specified option does not exist.
E, [2015-05-05T13:14:35.198869 #4388] ERROR -- : Unknown error while processing ''
D, [2015-05-05T13:14:35.198869 #4388] DEBUG -- : c:/foreman/modules/dhcp/providers/server/native_ms.rb:227:in `rescue in report'
c:/foreman/modules/dhcp/providers/server/native_ms.rb:204:in `report'
c:/foreman/modules/dhcp/providers/server/native_ms.rb:199:in `execute'
c:/foreman/modules/dhcp/providers/server/native_ms.rb:61:in `block in addRecord'
c:/foreman/modules/dhcp/providers/server/native_ms.rb:48:in `each'
c:/foreman/modules/dhcp/providers/server/native_ms.rb:48:in `addRecord'
c:/foreman/modules/dhcp/dhcp_api.rb:96:in `block in <class:DhcpApi>'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1610:in `block in compile!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `[]'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (3 levels) in route!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:993:in `route_eval'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:974:in `block (2 levels) in route!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1014:in `block in process_route'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `catch'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1012:in `process_route'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:972:in `block in route!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:971:in `route!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1084:in `block in dispatch!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1081:in `dispatch!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `block in call!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `block in invoke'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `catch'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1066:in `invoke'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:906:in `call!'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:894:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/commonlogger.rb:33:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:218:in `call'
c:/foreman/lib/proxy/log.rb:35:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/show_exceptions.rb:21:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:181:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:2021:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `block in call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1795:in `synchronize'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/sinatra-1.4.6/lib/sinatra/base.rb:1486:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:65:in `block in call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `each'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/urlmap.rb:50:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
C:/Ruby193/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
10.1.8.19 - - [05/May/2015 13:14:35] "POST /dhcp/10.1.8.0 HTTP/1.1" 400 33 29.6099
Updated by Aaron Reed over 9 years ago
After installing the latest dev version I'm still having the same issue. However I am getting a different error when starting the service even though they say that its been worked on.
c:\foreman>ruby extra\register-service.rb
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
cannot load such file -- highline/import (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
n `require'
from extra/register-service.rb:7:in `<main>'
Updated by Aaron Reed over 9 years ago
Aaron Reed wrote:
After installing the latest dev version I'm still having the same error when trying to spin up a VM in foreman. However I am getting a different error when starting the service.
c:\foreman>ruby extra\register-service.rb
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
cannot load such file -- highline/import (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
n `require'
from extra/register-service.rb:7:in `<main>'
Updated by Aaron Reed over 9 years ago
Getting this.
c:\foreman>ruby extra\register-service.rb
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- highline/import (LoadError) from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i nrequire'
from extra/register-service.rb:7:in `
Updated by Dominic Cleal over 9 years ago
No need to repeatedly update the ticket.
How have you installed the dependencies? Please attach bundle env
and bundle show
output.
Updated by Aaron Reed over 9 years ago
Hey Dominic, I'm running this on a Windows 2008 R2 srvr. I followed the 1.8 smart proxy install procedure. Installed Ruby 193. Thanks for your help
Updated by Dominic Cleal over 9 years ago
I'd try running bundle install
to install the necessary dependencies.
Updated by Benjamin Papillon over 9 years ago
Aaron Reed wrote:
Aaron Reed wrote:
After installing the latest dev version I'm still having the same error when trying to spin up a VM in foreman. However I am getting a different error when starting the service.
c:\foreman>ruby extra\register-service.rb
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
cannot load such file -- highline/import (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
n `require'
from extra/register-service.rb:7:in `<main>'
Hello,
This particular bug has been already reported and fixed in #10320
Updated by Aaron Reed over 9 years ago
Hey Ben, making some progress, got the service registered however when I try to start it I get Error: 1053 The service did not respond to the start or control request in a timely fashion. I made sure all MS updates are installed and all .net SP's are up to date per some articles online, but still can't get the service to start.
Updated by Aaron Reed over 9 years ago
I'm using the same admin account we used for the old smart proxy service. Also there is nothing in the smart proxy logs.
Updated by Benjamin Papillon over 9 years ago
- Related to Bug #10378: smart-proxy service doesn't start on windows added
Updated by Benjamin Papillon over 9 years ago
Can you try the workaround in #10378? This particular bug will be used to track devs progress on Win32 Service.
Thanks
Updated by Aaron Reed over 9 years ago
Service is now started but when creating a new host I get this in the error log and Foreman msg.
- Logfile created on 2015-05-18 15:05:03
0400 by logger.rb/31641: Netsh failed:
10.1.8.19 - - [19/May/2015 10:38:25] "GET /dhcp/10.1.8.0/unused_ip HTTP/1.1" 200 19 51.9847
E, [2015-05-19T10:39:34.967838 #3628] ERROR -
Changed the current scope context to 10.1.8.0 scope.
The specified option does not exist.
E, [2015-05-19T10:39:34.967838 #3628] ERROR -- : Unknown error while processing ''
10.1.8.19 - - [19/May/2015 10:39:34] "POST /dhcp/10.1.8.0 HTTP/1.1" 400 33 26.7189
Foreman error
Create DHCP Settings for test.42six.com task failed with the following error: ERF12-6899 [ProxyAPI::ProxyException]: Unable to set DHCP entry ([RestClient::BadRequest]: 400 Bad Request) for proxy https://"ourdc.dc.com":8443/dhcp
Updated by Aaron Reed over 9 years ago
It pulls an IP from our DHCP server fine in the network section of new host creation.
Updated by Aaron Reed over 9 years ago
Anyone have a possible solution to this yet?
Updated by Aaron Reed over 9 years ago
After trying to upgrade to foreman 1.8.2 getting this error.
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Updated by Ohad Levy over 9 years ago
Aaron Reed wrote:
After trying to upgrade to foreman 1.8.2 getting this error.
SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
this just means it failed validation, either time, hostname or certificates are wrong..
Updated by Aaron Reed over 9 years ago
I can start the service manually but when trying instal the service I get
c:\foreman>ruby extra\register-service.rb
extra/register-service.rb:2:in `<main>': uninitialized constant PLATFORM (NameEr
ror)
Updated by Aaron Reed over 9 years ago
Thanks Ohad, so where should this be changed. Nothing has changed besides the upgrade. Where are the config file locations to confirm hostname and everything in the webui settings are correct?
Updated by Travis Burrell almost 9 years ago
Not sure if this is the place to post this issue, but a Google search led me to this ticket, so please lmk if I should open a new one. I'm getting a similar error as note 40, but different constant (v 1.10.1):
/extra/register-service.rb:11:in '<main>': Use RbConfig instead of obsolete and deprecated Config. /extra/register-service.rb:15:in '<main>': uninitialized constant CONFIG (NameError)
Updated by Anonymous almost 9 years ago
I would recommend using the 1.10 stable or even latest code from develop branch. Please see http://theforeman.org/manuals/1.10/index.html#4.3.1SmartProxyInstallation, 'Windows' section for up-to-date installation instructions.
Updated by Travis Burrell almost 9 years ago
Hi Dmitri - yes, as stated, I'm using 1.10.1. Also, I can install the proxy fine (you guys actually merged my pull request in the Windows smart proxy installation documentation the other day).
My issue is, like stated in note 40, that I can start the service manually, but cannot use either method (NSSM or register-service.rb) to get the service installed & running.
As stated, please let me know if I should start another ticket - I just posted here because a Google search led me to this one.
Updated by Anonymous almost 9 years ago
Try using develop branch. It's using RbConfig and should solve the issues you are seeing.
Updated by Anonymous almost 9 years ago
Please also see http://projects.theforeman.org/issues/10378, seems like startup issues could be related to a path resolution https://github.com/theforeman/smart-proxy/blob/develop/bin/smart-proxy-win-service#L11. Please let us know if the workaround resolves your issue.