Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-3005

New sources are created with wrong type "yum" instead of "yum-baseurl"

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Undefined Undefined
    • None
    • rhel-9.2.0.z
    • cockpit-composer
    • None
    • None
    • None
    • sst_image_builder
    • ssg_front_door
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • Red Hat Enterprise Linux
    • None
    • None
    • None
    • Unspecified
    • None

      What were you trying to do that didn't work?

      I am using the Cockpit Composer to add a new source. 

      Image Builder -> Sources -> Add Source 

      Thereafter, it is impossible to search for packages when creating a blueprint.

      How reproducible:

      If I create a blueprint and search for a package with the default sources, it works:

      Sep 11 15:04:02 rhel9-fc7 osbuild-composer[4518]: 2023/09/11 15:04:02 GET /api/v0/modules/list/*java-17-*
      Sep 11 15:04:04 rhel9-fc7 osbuild-composer[4518]: 2023/09/11 15:04:04 GET /api/v0/projects/info/java-17-openjdk,java-17-openjdk-demo,java-17-openjdk-devel,java-17-openjdk-headless,java-17-openjdk-javadoc,java-17-openjdk-javadoc-zip,java-17-openjdk-jmods,>

      But as soon as I add a new Source (here as an arbitrary example I take EPEL-9, with URL https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64/
      taken from https://console.redhat.com/insights/content/popular-repositories):

      Sep 11 15:05:21 rhel9-fc7 osbuild-composer[4518]: 2023/09/11 15:05:21 POST /api/v0/projects/source/new 

      then suddenly the queries for packages fail:

      Sep 11 15:05:34 rhel9-fc7 osbuild-composer[4518]: 2023/09/11 15:05:34 GET /api/v0/modules/list/*java-17-*
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]: Traceback (most recent call last):
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:   File "/usr/libexec/osbuild-composer/dnf-json", line 386, in <module>
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:     main()
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:   File "/usr/libexec/osbuild-composer/dnf-json", line 378, in main
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:     result, err = solve(request, cachedir)
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:   File "/usr/libexec/osbuild-composer/dnf-json", line 275, in solve
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:     solver = Solver(
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:   File "/usr/libexec/osbuild-composer/dnf-json", line 56, in __init__
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:     self.base.repos.add(self._dnfrepo(repo, self.base.conf))
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:   File "/usr/libexec/osbuild-composer/dnf-json", line 75, in _dnfrepo
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]:     assert False
      Sep 11 15:05:35 rhel9-fc7 osbuild-composer[4973]: AssertionError
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4518]: 2023/09/11 15:05:36 GET /api/v0/modules/list/*java-17-*
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]: Traceback (most recent call last):
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:   File "/usr/libexec/osbuild-composer/dnf-json", line 386, in <module>
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:     main()
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:   File "/usr/libexec/osbuild-composer/dnf-json", line 378, in main
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:     result, err = solve(request, cachedir)
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:   File "/usr/libexec/osbuild-composer/dnf-json", line 275, in solve
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:     solver = Solver(
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:   File "/usr/libexec/osbuild-composer/dnf-json", line 56, in __init__
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:     self.base.repos.add(self._dnfrepo(repo, self.base.conf))
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:   File "/usr/libexec/osbuild-composer/dnf-json", line 75, in _dnfrepo
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]:     assert False
      Sep 11 15:05:36 rhel9-fc7 osbuild-composer[4974]: AssertionError 

      However if delete the custom repository from the cockpit, and add it with the CLI instead:

      $ cat >epel9.toml <<EOF
      check_gpg = false
      check_repogpg = false
      check_ssl = false
      id = "epel-9"
      name = "epel-9"
      rhsm = false
      system = false
      type = "yum-baseurl"
      url = "https://dl.fedoraproject.org/pub/epel/9/Everything/x86_64"
      EOF  
      $ composer-cli sources add epel9.toml
      

      then the query for packages works again!

      The issue appears to be caused by the fact that the Cockpit module saves the source with type  yum instead of yum-baseurl (see first attachment).

       

            gzuccare@redhat.com Gianluca Zuccarelli
            rh-ee-fcharett François Charette
            Jacob Kozol Jacob Kozol
            Yi He Yi He
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: