Other relevant data:
I can run the curl http://foreman.demo.com/unattended/provision?token=76f6f775-ee77-48f9-9faf-4b2dca24f81b in the browser and it (eventually) returns with the kickstart contents
I ran the curl from the command line on the foreman server where I assume the first response is similar to what is received in the dracut-initqueue phase of boot:
# curl http://foreman.demo.com/unattended/provision?token=76f6f775-ee77-48f9-9faf-4b2dca24f81b
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a href="/unattended/provision">GET /unattended/provision</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
I saw your response to a previous query of mine but I don’t think that timeouts are the issue. The token duration is 360 (default) and ping is very responsive (0.243 ms).
The error occurs when I am creating a new host and the dracut is trying to get the kickstart file for the first time (about 30 seconds in user time has passed).
I think the boot curl error is similar to the error when I run the curl from another server and get the 404 immediately. Why does it work in the browser and not from the command line or in dracut?
Preview in browser is entirely a different thing, in that case Foreman just renders the output, but you need to be authorized user.
When connecting to the endpoint via curl without authorization, you can only see the content if you do this from the very same IP address as the provisioning interface has or if you specify MAC address of the provisioning interface via HTTP header (that’s what Anaconda installer does automatically).
Thanks for the prompt reply Izap.
So my originally question still stands - why am I getting a curl 404 error immediately after the new host is created?
This indicates there must be HTTP proxy configured for something. Have you configured for Anaconda installer? For Foreman server itself? For the proxy? Or all of them?
This looks like some network misconfiguration and you need to dig it out yourself, I can hardly help you based on the observations you shared with us so far.
Also, please format your posts appropriately. I will fix what you have posted so far for you.