[Spacewalk-list] Ubuntu and Spacewalk 2.8 : Error 500 on Release file

Robert Paschedag robert.paschedag at web.de
Tue Sep 11 19:46:27 UTC 2018


On 09/11/18 20:08, Paul-Andre Panon wrote:
> On Thu, 06 Sep 2018 17:18:54 +0200, Robert Paschedag
> <robert.paschedag at web.de> wrote:
>>
>> Am 6. September 2018 10:36:15 MESZ schrieb Simon DESEE
> <simon at dedisoft.com>:
>>> Hi,
>>>
>>>
>>> Thanks for your reply, but this has already been done.
>>>
>>>
>>> The lines concerned by the patch are after the lines who generates the
>>> error :
>>>
>>>
>>>
>>>
>>> if file_name == "repomd.xml":
>>> content_type = "text/xml"
>>> output = repo.get_repomd_file()
>>> elif file_name == "primary.xml.gz":
>>> output = repo.get_primary_xml_file()
>>> elif file_name == "other.xml.gz":
>>> output = repo.get_other_xml_file()
>>> elif file_name == "filelists.xml.gz":
>>> output = repo.get_filelists_xml_file() elif file_name ==
>>> "updateinfo.xml.gz":
>>> output = repo.get_updateinfo_xml_file() elif file_name == "comps.xml":
>>> content_type = "text/xml"
>>> output = repo.get_comps_file()
>>> elif file_name == "modules.yaml":
>>> output = repo.get_modules_file()
>>> else:
>>> log_debug(2, "Unknown repomd file requested: %s" % file_name) raise
>>> rhnFault(6)
>>>
>>

These are just smaller modifications that may be changed, but it does
not break the functionality.

This is the section from my SW 2.7 server

rhnRepository.py

...

   def _repodata_taskomatic(self, file_name):
        log_debug(3, 'repodata', file_name)

        content_type = "application/x-gzip"

        if file_name in ["repomd.xml", "comps.xml"]:
            content_type = "text/xml"
        elif file_name not in ["primary.xml.gz", "other.xml.gz",
            "filelists.xml.gz", "updateinfo.xml.gz", "Packages.gz",
                 "InRelease", "Release", "Release.gpg"]:
            log_debug(2, "Unknown repomd file requested: %s" % file_name)
            raise rhnFault(6)


...

This is the exact same code as in the "master" branch.

And with the modifications needed within "apt-transport-spacewalk" on
the clients, this is what "apt-get update" looks like

root at server:~# apt-get update
Apt-Spacewalk: Updating sources.list
Holen:1 spacewalk://spacewalk.domain.com stretch_main_main InRelease
[2.109 B]
Holen:2 spacewalk://spacewalk.domain.com stretch_domain InRelease [2.049 B]
Holen:3 spacewalk://spacewalk.domain.com stretch_main_contrib InRelease
[2.085 B]
Holen:4 spacewalk://spacewalk.domain.com stretch_security_contrib
InRelease [2.081 B]
Holen:5 spacewalk://spacewalk.domain.com stretch_security_main InRelease
[2.105 B]
Holen:6 spacewalk://spacewalk.domain.com stretch_updates_contrib
InRelease [2.043 B]
Holen:7 spacewalk://spacewalk.domain.com stretch_updates_main InRelease
[2.079 B]
Holen:8 spacewalk://spacewalk.domain.com stretch_main_main/repodata
amd64 Packages [17,2 MB]
Holen:9 spacewalk://spacewalk.domain.com stretch_main_contrib/repodata
amd64 Packages [96,1 kB]
Holen:10 spacewalk://spacewalk.domain.com
stretch_security_contrib/repodata amd64 Packages [3.001 B]
Holen:11 spacewalk://spacewalk.domain.com stretch_security_main/repodata
amd64 Packages [1.568 kB]
Holen:12 spacewalk://spacewalk.domain.com stretch_updates_main/repodata
amd64 Packages [16,6 kB]
Paketlisten werden gelesen... Fertig
root at server:~#

Now...what is the problem?

Robert



>> I cannot find your traceback logs...
>>
>> Now... Did you apply the patch or not
>>>
>>> Perhaps there's some other required modification missing...
>>
>> All I can say is that applying PR 636 and 637 works for me (and I think
> others, too)
>>
>> Robert
>>>
>>>
>>> Regards,
>>>
>>
> Although I don't think the tip version code from those PRs is correct.
> InRelease, Release, Release.gpg, and modules.yaml are not MIME type
> appplication/x-gzip, which is what the current code identifies them as
> since that is the default content-type set before the if statement chain.
> The section in _repodata_taskomatic should at least  look like
> 
>          content_type = "application/x-gzip"
> 
>          if file_name in ["repomd.xml", "comps.xml"]:
>              content_type = "text/xml"
> +        elif file_name in ["InRelease", "Release", "Release.gpg"]:
> +            content_type = "text/plain"
> +        elif file_name in ["modules.yaml"]:
> +            content_type = "text/yaml"
>          elif file_name not in ["primary.xml.gz", "other.xml.gz",
>                                 "filelists.xml.gz", "updateinfo.xml.gz",
> "Packages.gz"]:
>              log_debug(2, "Unknown repomd file requested: %s" % file_name)
>              raise rhnFault(6)
> 
> 
> although maybe Release.gpg's content type should be
> application/pgp-signature? The content-type should also be overridden for
> modules.yaml in _repodata_python for the same reason
> 
>         elif file_name == "modules.yaml":
> +            content_type = "text/yaml"
>             output = repo.get_modules_file()
> 
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
> 




More information about the Spacewalk-list mailing list