Project

General

Profile

Actions

Support #18542

closed

SmartProxy just not work (Requested url was not found instead of sinatra hello world) - Windows

Added by Atasian van Endern about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Triaged:
Fixed in Releases:
Found in Releases:

Description

Hello together,

i hava a strange thing i cant explain myself.

I installed a new SmartProxy 1.14.1 on Windows for MSDHCP.
From :DEBUG i can see, that the certificates are loaded. I can import Subnetworks. In Foreman it shows "green". If i request a IP adress over DHCP, i get an Error:

Failed to fetch a free IP from proxy mysmartproxy.my-domain.de (https://mysmartproxy.my-domain.de:8443): ERF12-8202 [ProxyAPI::ProxyException]: Ungenutzte IP konnte nicht abgerufen werden ([RestClient::BadRequest]: 400 Bad Request) für Proxy https://mysmartproxy.my-domain.de:8443/dhcp

But i think this is not the main Problem. It seems the sinatra application just does not work. If i access over the URL

https://mysmartproxy.my-domain.de:8443/ or just on the machine over localhost https://localhost:8443/
it said "Requested URL was not found". If i do the same thing on an older SmartProxy from me, he shows that the "Sinatra Hello World". I dont know what i do wrong here.

D, [2017-02-16T16:45:34.084583 ] DEBUG -- : Rack::Handler::WEBrick is mounted on /.
I, [2017-02-16T16:45:34.084583 ] INFO -- : WEBrick::HTTPServer#start: pid=592 port=8443
D, [2017-02-16T16:46:15.960485 ] DEBUG -- : close TCPSocket(0.0.0.0, 8443)
I, [2017-02-16T16:46:15.960485 ] INFO -- : going to shutdown ...
I, [2017-02-16T16:46:15.960485 ] INFO -- : WEBrick::HTTPServer#start done.
W, [2017-02-16T16:52:10.916591 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/facts.yml. Using default settings.
W, [2017-02-16T16:52:10.916591 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/dns.yml. Using default settings.
W, [2017-02-16T16:52:10.916591 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/templates.yml. Using default settings.
W, [2017-02-16T16:52:10.916591 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/tftp.yml. Using default settings.
D, [2017-02-16T16:52:10.916591 ] DEBUG -- : 'dhcp' settings: 'enabled': https, 'server': 10.2.1.66, 'subnets': [] (default), 'use_provider': dhcp_native_ms
W, [2017-02-16T16:52:10.916591 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/puppetca.yml. Using default settings.
W, [2017-02-16T16:52:10.932214 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/puppet.yml. Using default settings.
W, [2017-02-16T16:52:10.932214 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/bmc.yml. Using default settings.
W, [2017-02-16T16:52:10.932214 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/realm.yml. Using default settings.
W, [2017-02-16T16:52:10.932214 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/logs.yml. Using default settings.
D, [2017-02-16T16:52:10.932214 ] DEBUG -- : 'logs' settings: 'enabled': true (default)
D, [2017-02-16T16:52:10.932214 ] DEBUG -- : Providers ['dhcp_native_ms'] are going to be configured for 'dhcp'
W, [2017-02-16T16:52:10.932214 ] WARN -- : Couldn't find settings file C:/smart-proxy-1.14-stable/config/settings.d/dhcp_native_ms.yml. Using default settings.
D, [2017-02-16T16:52:11.072856 ] DEBUG -- : 'dhcp_native_ms' settings: 'disable_ddns': true (default), 'server': 10.2.1.66, 'subnets': [], 'use_provider': dhcp_native_ms
I, [2017-02-16T16:52:11.072856 ] INFO -- : Successfully initialized 'foreman_proxy'
I, [2017-02-16T16:52:11.072856 ] INFO -- : Successfully initialized 'dhcp_native_ms'
I, [2017-02-16T16:52:11.072856 ] INFO -- : Successfully initialized 'dhcp'
D, [2017-02-16T16:52:11.072856 ] DEBUG -- : Log buffer API initialized, available capacity: 2000/1000
I, [2017-02-16T16:52:11.072856 ] INFO -- : Successfully initialized 'logs'
I, [2017-02-16T16:52:11.088472 ] INFO -- : WEBrick 1.3.1
I, [2017-02-16T16:52:11.088472 ] INFO -- : ruby 2.3.3 (2016-11-21) [x64-mingw32]
I, [2017-02-16T16:52:16.026233 ] INFO -- :

*If access over a URL. It said this: *

D, [2017-02-16T17:16:18.659037 ] DEBUG -- : Rack::Handler::WEBrick is invoked.
I, [2017-02-16T17:16:18.659037 ] INFO -- : 127.0.0.1 - - [16/Feb/2017 17:16:18] "GET /favicon.ico HTTP/1.1" 404 27 0.0000

D, [2017-02-16T17:16:18.690316 ] DEBUG -- : Rack::Handler::WEBrick is invoked.
I, [2017-02-16T17:16:18.690316 ] INFO -- : 127.0.0.1 - - [16/Feb/2017 17:16:18] "GET /favicon.ico HTTP/1.1" 404 27 0.0000

D, [2017-02-16T17:16:41.376236 ] DEBUG -- : close: 127.0.0.1:56442
D, [2017-02-16T17:24:14.159596 ] DEBUG -- : accept: 10.2.3.8:58133
D, [2017-02-16T17:24:14.175177 ] DEBUG -- : Rack::Handler::WEBrick is invoked.
I, [2017-02-16T17:24:14.175177 ] INFO -- : 10.2.3.8 - - [16/Feb/2017 17:24:14] "GET / HTTP/1.1" 404 27 0.0000


If i request a IP Adress, it said this

D, [2017-02-16T17:47:21.361719 ] DEBUG -- : close: 10.2.3.8:58351
D, [2017-02-16T17:55:28.929533 ] DEBUG -- : accept: 10.2.0.71:56458
D, [2017-02-16T17:55:28.929533 ] DEBUG -- : Rack::Handler::WEBrick is invoked.
D, [2017-02-16T17:55:28.929533 ] DEBUG -- : verifying remote client 10.2.0.71 against trusted_hosts ["puppetmaster.my-domain.de"]
E, [2017-02-16T17:55:28.960742 ] ERROR -- : Error looking up a free ip address in subnet 10.2.0.0. Unknown error '1745'
D, [2017-02-16T17:55:28.960742 ] DEBUG -- : Error looking up a free ip address in subnet 10.2.0.0. Unknown error '1745' (DhcpsApi::Error)
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/dhcpsapi-0.0.11/lib/dhcpsapi/misc.rb:30:in `get_free_ip_address'
C:/smart-proxy-1.14-stable/modules/dhcp_native_ms/dhcp_native_ms_main.rb:78:in `unused_ip'
C:/smart-proxy-1.14-stable/modules/dhcp/dhcp_api.rb:59:in `block in <class:DhcpApi>'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1611:in `block in compile!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (3 levels) in route!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:994:in `route_eval'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:975:in `block (2 levels) in route!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1015:in `block in process_route'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `catch'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1013:in `process_route'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:973:in `block in route!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `each'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:972:in `route!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1085:in `block in dispatch!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1082:in `dispatch!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `block in call!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `block in invoke'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `catch'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1067:in `invoke'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:907:in `call!'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:895:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/methodoverride.rb:21:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/commonlogger.rb:33:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:219:in `call'
C:/smart-proxy-1.14-stable/lib/proxy/log.rb:109:in `call'
C:/smart-proxy-1.14-stable/lib/proxy/request_id_middleware.rb:9:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/nulllogger.rb:9:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/head.rb:11:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/show_exceptions.rb:25:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:182:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:2013:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `block in call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1787:in `synchronize'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sinatra-1.4.8/lib/sinatra/base.rb:1487:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:138:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/urlmap.rb:65:in `block in call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/urlmap.rb:50:in `each'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/urlmap.rb:50:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/builder.rb:138:in `call'
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rack-1.5.5/lib/rack/handler/webrick.rb:60:in `service'
C:/Ruby23-x64/lib/ruby/2.3.0/webrick/httpserver.rb:140:in `service'
C:/Ruby23-x64/lib/ruby/2.3.0/webrick/httpserver.rb:96:in `run'
C:/Ruby23-x64/lib/ruby/2.3.0/webrick/server.rb:296:in `block in start_thread'
I, [2017-02-16T17:55:28.960742 ] INFO -- : 10.2.0.71 - - [16/Feb/2017 17:55:28] "GET /dhcp/10.2.0.0/unused_ip?from=10.2.2.0&to=10.2.12.255 HTTP/1.1" 400 75 0.0312

D, [2017-02-16T17:55:29.007638 ] DEBUG -- : close: 10.2.0.71:56458

Any suggestions of this?

Actions #1

Updated by Anonymous about 7 years ago

What version of Windows is smart-proxy deployed on? The minimal tested version is Windows Server 2008, for ip address suggestions to work you'll need Windows Server 2012.

It seems the sinatra application just does not work. If i access over the URL https://mysmartproxy.my-domain.de:8443/ or just on the machine over localhost https://localhost:8443/
it said "Requested URL was not found". If i do the same thing on an older SmartProxy from me, he shows that the "Sinatra Hello World". I dont know what i do wrong here.

You can access /version or /features, there are no other urls accessible at the root level.

Actions #2

Updated by Atasian van Endern about 7 years ago

Hi Dmitri, first thanks for your fast reply ! :)

Dmitri Dolguikh wrote:

What version of Windows is smart-proxy deployed on? The minimal tested version is Windows Server 2008, for ip address suggestions to work you'll need Windows Server 2012.

I have a Server with Windows Server 2012 R2 and Smart Proxy 1.13 , everything works.
A new Server with 2012 R2 and SmartProxy 1.14, it does not.

It seems the sinatra application just does not work. If i access over the URL https://mysmartproxy.my-domain.de:8443/ or just on the machine over localhost https://localhost:8443/
it said "Requested URL was not found". If i do the same thing on an older SmartProxy from me, he shows that the "Sinatra Hello World". I dont know what i do wrong here.

You can access /version or /features, there are no other urls accessible at the root level.

Sorry i think this information its right or i understand it wrong. If i request this URL from outside or local host, on my foreman SmartProxy 13.1 i get a Example Page from Sinatra. It looks exactly like this:

https://www.safaribooksonline.com/library/view/sinatra-up-and/9781449306847/httpatomoreillycomsourceoreillyimages947225.png

if access the url on my new SmartProxy 14.1, it show just "Requested URL was not found" in simple plain HTML.
I try to install the SmartProxy tomorrow again, maybe i do something wrong. But i think this is the root of the problem. The Sinatra Application does not really running and the log said nothing.

Actions #3

Updated by Anonymous about 7 years ago

if access the url on my new SmartProxy 14.1, it show just "Requested URL was not found" in simple plain HTML.

All html pages have been removed, the only accessible urls at the top level now are https://localhost:8443/version and https://localhost:8443/features.

Is dhcp service running on the same machine as smart-proxy? If not, on what version of Windows server is dhcp service running?

Actions #4

Updated by Atasian van Endern about 7 years ago

Dmitri Dolguikh wrote:

if access the url on my new SmartProxy 14.1, it show just "Requested URL was not found" in simple plain HTML.

All html pages have been removed, the only accessible urls at the top level now are https://localhost:8443/version and https://localhost:8443/features.

Is dhcp service running on the same machine as smart-proxy? If not, on what version of Windows server is dhcp service running?

Oh ok good to to know. Thank you for this information. I will try to access the new URLS tomorrow when iam at work again and i will report what it looks like.

My Infrastructure is this:

DHCP Server:
- running Windows Server 2008

SmartProxy 14.1 Server:
- running Windows Server 2012 R2
- installed DHCP Server Role for netsh commands
- disabled DHCP Server Service, because i just need the commands
- The DHCP Server is configured in the dhcp.yml

SmartProxy 13.1 Server
- running Windows Server 2012 R2
- installed DHCP Server Role for netsh commands
- disabled DHCP Server Service
- The DHCP Server is configured in the dhcp.yml

did i use a unsupported constellation?

best regards :) !

Actions #5

Updated by Anonymous about 7 years ago

Ip address suggestions are not available for dhcp service running on Windows server versions prior to 2012. If you require this functionality, you'll need to run dhcp service on Windows Server 2012.

installed DHCP Server Role for netsh commands

You need the account that smart-proxy runs under to have DHCP Server role, but netsh is no longer being used. Starting with version 1.14 smart-proxy relies on native MS dhcps api.

Actions #6

Updated by Atasian van Endern about 7 years ago

Dmitri Dolguikh wrote:

Ip address suggestions are not available for dhcp service running on Windows server versions prior to 2012. If you require this functionality, you'll need to run dhcp service on Windows Server 2012.

installed DHCP Server Role for netsh commands

You need the account that smart-proxy runs under to have DHCP Server role, but netsh is no longer being used. Starting with version 1.14 smart-proxy relies on native MS dhcps api.

Thank you. That explains a lot and i did not expect this. I will trigger the migration to a newer DHCP Server. Its a other Team so i have to wait :) !

Did it make a difference for SmartProxy, if we will use Windows Server 2012R2 or Windows Server 2016 as a DHCP Server? Is 2016 alredy supported?

best regards.

Actions #7

Updated by Anonymous about 7 years ago

Did it make a difference for SmartProxy, if we will use Windows Server 2012R2 or Windows Server 2016 as a DHCP Server? Is 2016 alredy supported?

I don't know if anyone runs smart-proxy on Windows Server 2016 or interfaces with dhcp service running on it. This said, it should work. If you decide to give it a try, I would appreciate if you let us know about the results (here, or on the mailing list).

I'm going to close this bug, please open a new one if you encounter other issues with smart-proxy.

Actions #8

Updated by Anonymous about 7 years ago

  • Status changed from New to Closed
Actions #9

Updated by Dominic Cleal about 7 years ago

  • Tracker changed from Bug to Support
Actions

Also available in: Atom PDF