Bug 2104792

Summary: curl fail to reach to the satellite
Product: Red Hat Satellite Reporter: Elyasaf Halle <ehalle>
Component: PulpAssignee: satellite6-bugs <satellite6-bugs>
Status: POST --- QA Contact: Satellite QE Team <sat-qe-bz-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.10.4CC: dalley, dkliban, ggainey, rchan, rlavi, zhunting
Target Milestone: streamKeywords: Triaged
Target Release: Unused   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: pulpcore-3.40.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Elyasaf Halle 2022-07-07 07:21:49 UTC
Description of problem:

After registering a host with an AK subscription-manager is reporting the status Not Subscribed.

# subscription-manager list
+-------------------------------------------+
    Installed Product Status
+-------------------------------------------+
Product Name:   Red Hat OpenStack
Product ID:     191
Version:        13.0
Arch:           x86_64
Status:         Not Subscribed
Status Details: 
Starts:         
Ends:          

I testing the osp13 pre upgrade validation script (https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html-single/framework_for_upgrades_13_to_16.1/index#validating-red-hat-openstack-platform-oldvernum-before-the-upgrade) and I get 404 from the satellite 

Task 'Call repository URLs' failed:
Host: undercloud
Message: Status code was 404 and not [200]: HTTP Error 404: Not Found

the script do curl to curl https://satellite.test/pulp/content/RedHat-Juniper/Library/RHOSP13_16_V2/content/dist/rhel/server/7/7Server/x86_64/openstack/13/os

when I installed package from the repo is install it fine

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Brad Buckingham 2022-07-07 14:06:01 UTC
Is this a change or regression in behavior from an earlier release of Satellite?

Comment 2 Elyasaf Halle 2022-07-07 14:11:21 UTC

(In reply to Brad Buckingham from comment #1)
> Is this a change or regression in behavior from an earlier release of
> Satellite?

I didn’t try to register to another version of satellite

Comment 4 Daniel Alley 2022-08-23 02:14:29 UTC
@Rigel The description says installing from the repo works fine, so my guess is that an index page is not being provided when you don't have a trailing slash at the end.  Which is expected behavior.  Without a trailing slash it doesn't look like a directory, so you don't get an index page.

Comment 5 Daniel Alley 2022-08-23 02:15:50 UTC
If this is confirmed, please close as NOTABUG.

Comment 6 Rigel Di Scala 2022-08-25 06:20:10 UTC
Thank you, Daniel, for looking into it. I'm deferring to ehalle as he opened the BZ.

Comment 7 Elyasaf Halle 2022-08-25 08:06:10 UTC
Hi Daniel when I used the CDN in the same script and the script accepted the repo 
the script link ( https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/16.1/html-single/framework_for_upgrades_13_to_16.1/index#validating-red-hat-openstack-platform-oldvernum-before-the-upgrade )
It's automatically from /etc/yum.repo.d/redhat.repo the URL.
And that is the ansible that runs behind.
---
- hosts: undercloud, overcloud
  vars:
    metadata:
      name: Check correctness of current repositories
      description: >
        Detect whether the repositories listed in `yum repolist`
        can be connected to and that there is at least one repo
        configured.

        Detect if there are any unwanted repositories (such as EPEL) enabled.
      groups:
        - pre-upgrade
  tasks:
  - name: List repositories
    command: 'yum repolist -v'
    args:
      warn: no
    changed_when: False
    register: repositories
  - name: Find repository URLs
    shell: 'echo "{{ repositories.stdout }}" | grep Repo-baseurl | sed  "s/Repo-baseurl.*\(http[^ ]*\).*/\1/g"'
    register: repository_urls
    changed_when: False
  - name: Check if there is at least one repository baseurl
    fail:
      msg: No repository found in yum repolist
    when: repository_urls.stdout_lines|length < 1
  - name: Call repository URLs
    uri:
      url: "{{ item }}"
    with_items: "{{ repository_urls.stdout_lines }}"
  - name: Find repository IDs
    changed_when: False
    shell: 'echo "{{ repositories.stdout }}" | grep Repo-id | sed "s/Repo-id.*://" | tr -d " "'
    register: repository_ids
  - name: Check if there are any unwanted repositories enabled
    fail:
      msg: Found unwanted repository {{ item.0 }} enabled
    when: item.0 == item.1
    with_nested:
      - [ 'epel/x86_64' ]
      - "{{ repository_ids.stdout_lines }}"

Comment 8 Daniel Alley 2022-08-26 04:59:40 UTC
It's completely valid for a webserver to not redirect from a URL without a trailing slash to one with a trailing slash, just perhaps a little atypical.  Is adjusting the script an option?

I can file an issue to implement automatic redirection but this isn't a very common complaint for us.

Comment 9 Elyasaf Halle 2022-08-28 08:14:24 UTC
Hi,
the script is built in the ansible triplo, it is possible to change that but I am not sure if it will help us.
we can do manual commands (curl) to test.

Comment 10 Elyasaf Halle 2022-09-06 09:42:32 UTC
Hi, I try to do the same procedure in satellite 6.9 and it worked.

Comment 13 Daniel Alley 2023-03-03 13:50:35 UTC
Was reverted upstream

Comment 17 Robin Chan 2023-10-31 17:07:08 UTC
The Pulp upstream bug status is at closed. Updating the external tracker on this bug.

Comment 18 Robin Chan 2023-10-31 17:07:11 UTC
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.

Comment 19 Daniel Alley 2024-01-23 17:36:20 UTC
Moving this out to 6.16 - we can't backport it to pulpcore 3.39, and since I don't really see any demand for it, there's no real need to work out something special.

Comment 20 Daniel Alley 2024-01-24 15:40:51 UTC
Removing triaged keyword for reevaluation.