Project

General

Profile

Actions

Bug #37740

open

Smart proxies can serve incorrect content if remote is nil

Added by Thomas Mashos 4 months ago. Updated 28 days ago.

Status:
New
Priority:
High
Assignee:
-
Category:
Foreman Proxy Content
Target version:
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

Description

Description:
Foreman 3.11.1
Katello 4.13.0
Smart proxies in remote datacenters
Repositories on the main foreman server and all smart proxies are set to download content "On Demand"

It seems when a smart proxy doesn't have a remote set for a repository (eg. the data that should point to the main foreman server), it will serve a different repositories content (I'm assuming the previous repository in the list that does have a remote set). There's no warning this is happening and could be really bad depending on which repository is being served.

I've verified the remote isn't set as this returns nil when run in the console for the specific repository/smart proxy
smartproxy=SmartProxy::find(4)
Katello::Repository.find(300).backend_service(smartproxy).with_mirror_adapter.fetch_remote

Syncing the repo to the smart proxy fixes the issue
hammer -u <USER> -p <PASS> capsule content synchronize --id 4 --repository-id=300

What should happen:
An error should occur (minimally a 404 should be returned)

What actually happens:
A different repositories content is served. The incorrect content is visible both when browsing in the web browser and also when using yum/apt.

Actions

Also available in: Atom PDF