Hi All!
Trying to deploy ubuntu, the template works fine on another instance (3.13) but on the new one (3.14,3.15.1) I receiving there error:
2025-11-06T17:34:57 b4af384e [I] Started GET /userdata/<mac>/meta-data
2025-11-06T17:34:57 b4af384e [I] Finished GET /userdata/<mac>/meta-data with 404 (0.75 ms)
2025-11-06T17:34:58 41a08cfb [I] Started GET /userdata/<mac>/meta-data
2025-11-06T17:34:58 41a08cfb [I] Finished GET /userdata/<mac>/meta-data with 404 (0.62 ms)
or
2025-11-06T17:51:42 2f6ef3dd [W] Failed to proxy /provision for {“token”=>“22ed6a05-321d-462b-9a81-b023f78ecf76”, “kind”=>“provision”}: Error retrieving unattended/provision for {“token”=>“22ed6a05-321d-462b-9a81-b023f78ecf76”, “url”=>“``http://url:8000``”} from url: Net::HTTPNotFound: 404 : <Proxy::Error::HttpError>: Error retrieving unattended/provision for {“token”=>“22ed6a05-321d-462b-9a81-b023f78ecf76”, “url”=>“``http://url:8000``”} from url: Net::HTTPNotFound: 404
For finish template it works fine (can receive it with token), for kickstart it creates provision fine. What’s strange - it works fine on other instance. Tried to add trusted-proxy, but it is doesn’t help. proxy and the server on the one server.
**Problem:** Failed to proxy /provision error
Expected outcome:
Foreman and Proxy versions:3.15.1
Foreman and Proxy plugin versions:
Distribution and version:Rocky 9.5
Other relevant data:
Hi,
Why is the URL value:
``http://url:8000``
It should be:
http://foreman.proxy.com:8000
Sorry, I just hide the real url. The url is the same as the hostname.
lknsfos
November 9, 2025, 12:21pm
4
There is a debug output when I try to load the provision:
2025-11-09T14:12:51 c8d61d8f [I] Started GET /unattended/provision token=6c23c0c4-f992-4f72-83ad-a664528319c4
2025-11-09T14:12:51 c8d61d8f [D] Template: request for unattended/provision using {"token"=>"6c23c0c4-f992-4f72-83ad-a664528319c4", "url"=>"http://url:8000"} at url
2025-11-09T14:12:51 c8d61d8f [D] Retrieving a template from https://url//unattended/provision?token=6c23c0c4-f992-4f72-83ad-a664528319c4&url=http%3A%2F%2Furl%3A8000
2025-11-09T14:12:51 c8d61d8f [D] HTTP headers: {"USER_AGENT"=>"Wget/1.21.4", "ACCEPT"=>"*/*", "ACCEPT_ENCODING"=>"identity", "CONNECTION"=>"Keep-Alive", "X-Forwarded-For"=>"192.168.54.198"}
2025-11-09T14:12:51 c8d61d8f [E] Failed to proxy /provision for {"token"=>"6c23c0c4-f992-4f72-83ad-a664528319c4", "kind"=>"provision"}: Error retrieving unattended/provision for {"token"=>"6c23c0c4-f992-4f72-83ad-a664528319c4", "url"=>"http://url:8000"} from url: Net::HTTPNotFound: 404
2025-11-09T14:12:51 c8d61d8f [W] Error details for Failed to proxy /provision for {"token"=>"6c23c0c4-f992-4f72-83ad-a664528319c4", "kind"=>"provision"}: Error retrieving unattended/provision for {"token"=>"6c23c0c4-f992-4f72-83ad-a664528319c4", "url"=>"http://url:8000"} from url: Net::HTTPNotFound: 404 : <Proxy::Error::HttpError>: Error retrieving unattended/provision for {"token"=>"6c23c0c4-f992-4f72-83ad-a664528319c4", "url"=>"http://url:8000"} from url: Net::HTTPNotFound: 404
/usr/share/foreman-proxy/modules/templates/proxy_request.rb:51:in `call_template'
/usr/share/foreman-proxy/modules/templates/proxy_request.rb:12:in `get'
/usr/share/foreman-proxy/modules/templates/template_proxy_request.rb:6:in `get'
/usr/share/foreman-proxy/modules/templates/templates_unattended_api.rb:23:in `block (2 levels) in <class:TemplatesUnattendedApi>'
/usr/share/foreman-proxy/lib/proxy/helpers.rb:19:in `log_halt'
/usr/share/foreman-proxy/modules/templates/templates_unattended_api.rb:22:in `block in <class:TemplatesUnattendedApi>'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1696:in `call'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1696:in `block in compile!'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1030:in `block (3 levels) in route!'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1049:in `route_eval'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1030:in `block (2 levels) in route!'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1078:in `block in process_route'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1076:in `catch'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1076:in `process_route'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1028:in `block in route!'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1025:in `each'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1025:in `route!'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1147:in `block in dispatch!'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `block in invoke'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `catch'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `invoke'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1142:in `dispatch!'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:956:in `block in call!'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `block in invoke'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `catch'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1119:in `invoke'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:956:in `call!'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:945:in `call'
/usr/share/foreman-proxy/lib/proxy/log.rb:102:in `call'
/usr/share/foreman-proxy/lib/proxy/request_id_middleware.rb:11:in `call'
/usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/xss_header.rb:18:in `call'
/usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/path_traversal.rb:16:in `call'
/usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/json_csrf.rb:26:in `call'
/usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/base.rb:50:in `call'
/usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/base.rb:50:in `call'
/usr/share/gems/gems/rack-protection-2.2.4/lib/rack/protection/frame_options.rb:31:in `call'
/usr/share/gems/gems/rack-2.2.4/lib/rack/null_logger.rb:11:in `call'
/usr/share/gems/gems/rack-2.2.4/lib/rack/head.rb:12:in `call'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/show_exceptions.rb:22:in `call'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:218:in `call'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:2004:in `call'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1564:in `block in call'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1780:in `synchronize'
/usr/share/gems/gems/sinatra-2.2.4/lib/sinatra/base.rb:1564:in `call'
/usr/share/gems/gems/rack-2.2.4/lib/rack/urlmap.rb:74:in `block in call'
/usr/share/gems/gems/rack-2.2.4/lib/rack/urlmap.rb:58:in `each'
/usr/share/gems/gems/rack-2.2.4/lib/rack/urlmap.rb:58:in `call'
/usr/share/gems/gems/rack-2.2.4/lib/rack/builder.rb:244:in `call'
/usr/share/gems/gems/rack-2.2.4/lib/rack/handler/webrick.rb:95:in `service'
/usr/share/gems/gems/webrick-1.9.1/lib/webrick/httpserver.rb:140:in `service'
/usr/share/gems/gems/webrick-1.9.1/lib/webrick/httpserver.rb:96:in `run'
/usr/share/gems/gems/webrick-1.9.1/lib/webrick/server.rb:310:in `block in start_thread'
/usr/share/gems/gems/logging-2.4.0/lib/logging/diagnostic_context.rb:474:in `block in create_with_logging_context'
2025-11-09T14:12:51 c8d61d8f [I] Finished GET /unattended/provision with 404 (46.15 ms)
But I can’t find any errors when send the host to build
found the issue.
About provision template it doesn’t create because it is ubuntu cloud init and only user-data template exists. My bad.
About userdata:
possible the default template preseed_kernel_options_autoinstall is old,
it contains:
userdata_option = "ds=nocloud-net;s=http://#{foreman_request_addr}/userdata/#{mac ? mac + '/' : ''}"
instead of the right:
userdata_option = "ds=nocloud-net;s=http://#{foreman_request_addr}/userdata/"
2 Likes