Can’t publish Oracle Linux 8 or CentOS 8 content views after upgrading to Katello 3.18.3 from 3.18.2

Problem:
Publishing new content view for Oracle Linux 8 and CentOS 8 content view results in errors. Other Oracle Linux 7 and CentOS 7 work as usual.

Expected outcome:
Publishing new content view without errors.

Foreman and Proxy versions:
Foreman 2.3.5

Foreman and Proxy plugin versions:
Katello 3.18.3.1
foreman-tasks 3.0.6
foreman_remote_execution 4.2.2
foreman_docker 5.0.0
foreman_discovery 16.3.4
foreman_chef 0.10.0

Distribution and version:
CentOS Linux release 7.9.2009

Other relevant data:

Error message: the server returns an error

Errors for Oracle Linux 8

Error message: the server returns an error
HTTP status code: 400
Response headers: {"date"=>"Tue, 03 Aug 2021 19:16:21 GMT", "server"=>"gunicorn/20.0.4", "content-type"=>"application/json", "vary"=>"Accept,Cookie", "allow"=>"GET, PUT, PATCH, DELETE, HEAD, OPTIONS", "x-frame-options"=>"SAMEORIGIN", "content-length"=>"62", "via"=>"1.1 katellod02p.d.carfax.us", "connection"=>"close"}
Response body: {"publication":["Invalid hyperlink - Object does not exist."]}

Errors for CentOS 8

HTTP status code: 502
Response headers: {"date"=>"Tue, 03 Aug 2021 19:32:18 GMT", "server"=>"Apache", "content-length"=>"445", "connection"=>"close", "content-type"=>"text/html; charset=iso-8859-1"}
Response body: <!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="/pulp/api/v3/content/rpm/packages/">GET&nbsp;/pulp/api/v3/content/rpm/packages/</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
Error message: the server returns an error

Why did you upgrade to 3.18.3 and not the latest version 3.18.4?

3.18.4 wasn’t available at the time of upgrade.

Does 3.18.4 solve this issue?

I don’t know. Updating would probably better, even if it doesn’t solve your issue. From your topic I have assumed you have just updated recently…

I upgraded to 3.18.4. It is still failing. Here are the results for oracle linux 8 content view:

Error message: the server returns an error
HTTP status code: 502
Response headers: {"date"=>"Thu, 05 Aug 2021 16:55:33 GMT", "server"=>"Apache", "content-length"=>"445", "connection"=>"close", "content-type"=>"text/html; charset=iso-8859-1"}
Response body: <!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="/pulp/api/v3/content/rpm/packages/">GET&nbsp;/pulp/api/v3/content/rpm/packages/</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
Error message: the server returns an error
HTTP status code: 502
Response headers: {"date"=>"Thu, 05 Aug 2021 16:55:33 GMT", "server"=>"Apache", "content-length"=>"445", "connection"=>"close", "content-type"=>"text/html; charset=iso-8859-1"}
Response body: <!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="/pulp/api/v3/content/rpm/packages/">GET&nbsp;/pulp/api/v3/content/rpm/packages/</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
Error message: the server returns an errorError message: the server returns an errorError message: the server returns an errorError message: the server returns an error
HTTP status code: 502
Response headers: {"date"=>"Thu, 05 Aug 2021 16:56:04 GMT", "server"=>"Apache", "content-length"=>"445", "connection"=>"close", "content-type"=>"text/html; charset=iso-8859-1"}
Response body: <!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="/pulp/api/v3/content/rpm/packages/">GET&nbsp;/pulp/api/v3/content/rpm/packages/</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>

I was able to hit “Resume” on the task and I’m back to the same error:

Error message: the server returns an error
HTTP status code: 400
Response headers: {"date"=>"Thu, 05 Aug 2021 20:34:37 GMT", "server"=>"gunicorn/20.0.4", "content-type"=>"application/json", "vary"=>"Accept,Cookie", "allow"=>"GET, PUT, PATCH, DELETE, HEAD, OPTIONS", "x-frame-options"=>"SAMEORIGIN", "content-length"=>"62", "via"=>"1.1 katellod02p.d.carfax.us", "connection"=>"close"}
Response body: {"publication":["Invalid hyperlink - Object does not exist."]}

Try re-syncing the repo and then re-publishing the CV, rather than resuming the failed task?

I tried publishing a new one, but it is still erroring:

Error message: the server returns an error
HTTP status code: 502
Response headers: {"date"=>"Mon, 09 Aug 2021 13:20:46 GMT", "server"=>"Apache", "content-length"=>"445", "connection"=>"close", "content-type"=>"text/html; charset=iso-8859-1"}
Response body: <!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="/pulp/api/v3/content/rpm/packages/">GET&nbsp;/pulp/api/v3/content/rpm/packages/</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
Error message: the server returns an error
HTTP status code: 502
Response headers: {"date"=>"Mon, 09 Aug 2021 13:20:46 GMT", "server"=>"Apache", "content-length"=>"445", "connection"=>"close", "content-type"=>"text/html; charset=iso-8859-1"}
Response body: <!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="/pulp/api/v3/content/rpm/packages/">GET&nbsp;/pulp/api/v3/content/rpm/packages/</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
Error message: the server returns an errorError message: the server returns an errorError message: the server returns an errorError message: the server returns an errorError message: the server returns an error

Is the error solved?
If so what is the solution for this proxy error 502