Satellite 6.17 Manifest refresh fails with error : HTTP status code: 400 , "policy":["\"\" is not a valid choice]

Solution Verified - Updated -

Environment

  • Red Hat Satellite 6.17

Issue

After upgrade Satellite 6.17, manifest refresh or manifest upload fails with below error :

Error message: the server returns an error
HTTP status code: 400
Response body: {"policy":["\"\" is not a valid choice."]}

Resolution

  • Check if there are any repositories which have empty Download policy :
# su - postgres -c "psql foreman -c \"select id, name, download_policy from katello_root_repositories;\"" 
  • Set the download policy for the ISO repo via GUI, Hammer, or ansible (redhat.satellite.repository)

  • Verify all repositories have a download policy have set

  • Refresh Manifest again

A Sample playbook to resolve the issue. (validated)

---
# Your list of repositories
- name: "Update repository download policy"
  hosts: satellite.example.ca
  become: true
  gather_facts: true
  vars: 
    satellite_username: "admin"
    satellite_password: "YourPasswordHere"
    satellite_url: "https://satellite.example.ca"
    satellite_organization: "Default Organization" 
    satellite_repositories:
      - name: "Red Hat Ansible Automation Platform 2.4 for RHEL 9 x86_64 Files"
        product: "Red Hat Ansible Automation Platform"
        content_type: "file"
        download_policy: "on_demand"         # Set repo to on-demand

      - name: "Red Hat Ansible Automation Platform 2.5 for RHEL 9 x86_64 Files"
        product: "Red Hat Ansible Automation Platform"
        content_type: "file"
        download_policy: "immediate"         # Set repo to immediate

  tasks:
    - name: "Ensure the state of the specified repositories."
      when: satellite_repositories is defined and (satellite_repositories | length ) > 0
      redhat.satellite.repository:
        username: "{{ satellite_username }}"
        password: "{{ satellite_password }}"
        server_url: "{{ satellite_url }}"
        organization: "{{ satellite_organization }}"
        name: "{{ satellite_repository.name }}"
        state: "{{ satellite_repository.state | default(omit) }}"
        product: "{{ satellite_repository.product }}"
        content_type: "{{ satellite_repository.content_type }}"
      loop: "{{ satellite_repositories }}"
      loop_control:
        loop_var: satellite_repository

Root Cause

Customers may experience this issue when configured Product repositories include repositories of type file that do not have a default download policy set. Ensuring these repositories have a download policy set will work around this issue.

e.g.
- Red Hat Ansible Automation Platform 2.4 for RHEL 9 x86_64 (Files)
- Red Hat Ansible Automation Platform 2.5 for RHEL 9 x86_64 (Files)
- Red Hat Enterprise Linux 8 for x86_64 - High Availability ISOs 8
etc.

The issue is being tracked by the bug SAT-34592

Diagnostic Steps

Repository showing empty Download Policy :

hammer> repository list
---|------------------------------------------------------------------|-------------------------------------------------------|--------------|-----------------------------------------|------------------------------------------------------------------------
ID | NAME                                                             | PRODUCT                                               | CONTENT TYPE | CONTENT LABEL                           | URL                                                                    
---|------------------------------------------------------------------|-------------------------------------------------------|--------------|-----------------------------------------|------------------------------------------------------------------------
1  | Red Hat Enterprise Linux 8 for x86_64 - High Availability ISOs 8 | Red Hat Enterprise Linux High Availability for x86_64 | file         | rhel-8-for-x86_64-highavailability-isos | https://cdn.redhat.com/content/dist/rhel8/8/x86_64/highavailability/iso
---|------------------------------------------------------------------|-------------------------------------------------------|--------------|-----------------------------------------|------------------------------------------------------------------------
hammer> repository info --id 1
Id:                 1
Name:               Red Hat Enterprise Linux 8 for x86_64 - High Availability ISOs 8
Label:              Red_Hat_Enterprise_Linux_8_for_x86_64_-_High_Availability_ISOs_8
Description:        
Organization:       Default Organization
Red Hat Repository: yes
Content Type:       file
Content Label:      rhel-8-for-x86_64-highavailability-isos
Mirroring Policy:   Content Only
Url:                https://cdn.redhat.com/content/dist/rhel8/8/x86_64/highavailability/iso
Publish Via HTTP:   yes
Published At:       https://ip-10-0-168-126.rhos-01.prod.psi.rdu2.redhat.com/pulp/content/Default_Organization/Library/content/dist/rhel8/8/x86_64/highavailability/iso/
Relative Path:      Default_Organization/Library/content/dist/rhel8/8/x86_64/highavailability/iso
Download Policy:  <================================================================================================= 
Publish Settings:   
    Restrict to architecture: No restriction
    Restrict to OS Version:   No restriction
HTTP Proxy:         
    HTTP Proxy Policy: global_default_http_proxy
Product:            
    Id:   312
    Name: Red Hat Enterprise Linux High Availability for x86_64
GPG Key:            

Sync:               
    Status: Not Synced
Created:            2025/05/29 23:12:41
Updated:            2025/05/29 23:12:41
Content Counts:     
    Files: 0

Manifest failed task :

Error message: the server returns an error
HTTP status code: 400
Response body: {"policy":["\"\" is not a valid choice."]}

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments