Katello/Foreman client didn't see repository

Problem:
I have configured and registered host to Foreman/Katello server.
Host is attached to RedHat subscription.
When I try update or only list repository I have empty output, for example.

yum --verbose repolist all

Not loading “rhnplugin” plugin, as it is disabled
Loading “post-transaction-actions” plugin
Loading “priorities” plugin
Loading “product-id” plugin
Loading “search-disabled-repos” plugin
Loading “subscription-manager” plugin
Updating Subscription Management repositories.
Config time: 0.437
Yum version: 3.4.3
Setting up Package Sacks
repolist: 0

I see in file /etc/yum.repos.d/redhat.repo correct configuration for example repo URL:

[rhel-7-server-rpms]
metadata_expire = 1
enabled_metadata = 1
sslclientcert = /etc/pki/entitlement/134870980987234733.pem
baseurl = https://katello.example.com/pulp/repos/ORG/DEV/CV_RHEL7/content/dist/rhel/server/7/$releasever/$basearch/os
ui_repoid_vars = releasever basearch
sslverify = 1
name = Red Hat Enterprise Linux 7 Server (RPMs)
sslclientkey = /etc/pki/entitlement/134870980987234733-key.pem
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
enabled = 1
sslcacert = /etc/rhsm/ca/katello-server-ca.pem
gpgcheck = 1

When i try curl for this url, I have response 404 not found.

On Katello server I have empty directories:

ls -l /var/lib/pulp/published/yum

total 0
drwxr-xr-x. 2 apache apache 6 Nov 19 16:00 http
drwxr-xr-x. 2 apache apache 6 Nov 19 16:00 https

I tried Republish Repository Metadata and job finished successfully, but still Repository is unavailable.

In Repository View for mentioned repo I see option:
Published At:
https://katello.example.com/pulp/repos/ORG/Library/content/dist/rhel/server/7/7Server/x86_64/os/

And this URL works correctly.
I don’t know whats happen, but earlier working as expected, and I can update host client.

Expected outcome:
Working repository on host client.

Foreman and Proxy versions
Version 2.2.1 © 2009-2021 Paul Kelly and Ohad Levy

Foreman and Proxy plugin versions:

|foreman-tasks|3.0.1|
|foreman_remote_execution|4.1.0|
|katello|3.17.1|

Distribution and version:
RedHat 7.9

Regards
Tom

@thomas-merz Thank you for bringing this to our attention.

Was this a new installation of 3.17.1, or an upgrade?

Hi
This is a freshly installation.
In Foreman log /va/log/foreman/production.log. I found:

2021-01-14T07:01:56 [I|kat|] GET: https://katello.example.com/pulp/api/v2/repositories/843428f0-5a5c-42fd-b005-b456549fe6bd/?details=true: {“content_type”=>“application/json”, “accept”=>“application/json”}
404 Not Found: {“http_request_method”: “GET”, “exception”: null, “error_message”: “Missing resource(s): repository=843428f0-5a5c-42fd-b005-b456549fe6bd”, “_href”: “/pulp/api/v2/repositories/843428f0-5a5c-42fd-b005-b456549fe6bd/?details=true”, “http_status”: 404, “error”: {“code”: “PLP0009”, “data”: {“resources”: {“repository”: “843428f0-5a5c-42fd-b005-b456549fe6bd”}}, “description”: “Missing resource(s): repository=843428f0-5a5c-42fd-b005-b456549fe6bd”, “sub_errors”: }, “traceback”: null, “resources”: {“repository”: “843428f0-5a5c-42fd-b005-b456549fe6bd”}}

When I curl for URL:

https://localhost/pulp/content/ORG/dev/CV_RHEL7/content/dist/rhel/server/7/7Server/x86_64/os/
I have:
< HTTP/1.1 403 [(‘PEM routines’, ‘PEM_read_bio’, ‘no start line’)]
< Date: Thu, 14 Jan 2021 14:04:09 GMT
< Server: Python/3.6 aiohttp/3.7.2
< Content-Type: text/plain; charset=utf-8
< Content-Length: 56

But for repo I have 404

Regards

Do you always get a 403 when attempting to reach the published URL for that repository?
Also can you confirm that you are using pulp2 for yum content?

Another question for @Tomasz - any weird permissions on that repo?

Hi
In Katello 3.17 there is pulp 3.
I checked permissions, I think there are OK:

-rw-r–r--. 1 apache apache 2 Dec 4 11:34 0005_puppet_module_name_change.txt
drwxr-xr-x. 6 pulp pulp 78 Dec 4 11:33 assets
drwxrwxr-x. 3 pulp pulp 22 Dec 4 11:52 docroot
drwxr-xr-x. 2 foreman foreman 6 Dec 4 11:34 katello-export
drwxr-xr-x. 2 apache apache 6 Dec 4 11:33 packages
drwxrwxr-x. 5 apache pulp 45 Dec 4 11:20 published
drwxrwxr-x. 2 apache pulp 25 Dec 4 11:33 static
drwxrwxr-x. 59 pulp pulp 4096 Jan 14 15:23 tmp
drwxrwxr-x. 2 apache pulp 6 Nov 10 16:08 uploads

Realy this is very weird, last time this working, I didn’t any change on host.
Subscribtion works well, I can add, remove host, repo created, but host didn’t see repository.

Empty reply.

I think, you wanted to ask “Tomasz” and not me (we are on Katello 3.14.1 btw) :wink:

My mistake!

Hi
Meanwhile I tried to found a issue, and :

  1. I saw that database has been broken, error: Data is already initialized
    I update to newst version, but repository still not working.

  2. When I recreate repository metadata I have errpr:
    pulpcore-worker-4: FileNotFoundError: [Errno 2] No such file or directory: ‘/var/lib/pulp/media/artifact/de/7d562330fef4aaed524325e7f2050f54897ff5129d92245fca2f927b8ac319’

  3. I cant remove a main Version in ContenView, I have error, that I can’t remove Version 0

  4. I prepare new ContentView, and can remove Version, Content Views.

This looks like a litle errors in database.

One other suggestion is to re-register the client to katello.