adoptium / installer

Installer scripts for Eclipse Temurin binaries
Apache License 2.0
148 stars 73 forks source link

Unable to use repo with Red Hat Satellite: Katello::Errors::Pulp3Error: Treeinfo file should have INI format #787

Open msnellen opened 8 months ago

msnellen commented 8 months ago

In our organization we prefer that Linux servers not communicate directly with the outside world. Servers should have no custom repo definitions in /etc/yum.repos.d but get install packages from our internal Red Hat Satellite server. Normally we have no issue mimicking the configuration of the repository as represented in a repo-definition in Satellite (version 6.13.4.1). With your repo's for RHEL7, 8, and 9 however, we run into the problem that Satellite will not synchronize the repository. The error we get is: Katello::Errors::Pulp3Error: Treeinfo file should have INI format After doing some research, it turns out that yum repository's may contain a file named '.treeinfo', but since there is no standardized way to get a directory listing within the http-protocol, the only logical method to find out if this file exists is to simply request it with an http GET. If the file does not exit, the http server should return a 404 error code. The webserver at https://packages.adoptium.net/ui/native/rpm/ however doesn't do that and instead first gives a JFrog logo followed by text output that looks like json and does content-wise report that it doesn't exist, even mentioning the error-code 404, but that's not the same as http reply 404. On account of the reply to this request actually yielding output, Satellite concludes the file actually does exist and tries to process its contents, which fails because a true .treeinfo file should be in INI-format, not json. Can something be done about the webserver used to host this repository so it complies with normal http protocol guidelines?

karianna commented 8 months ago

@gdams One to request with JFrog?

msnellen commented 8 months ago

Meanwhile I found out that Red Hat has made an update to Red Hat Satellite (6.14.1) that allows me to tell it not to try to find the Treeinfo file on a repository, which is basically a work-around for all http-servers that serve an alternative 404-errorpage instead of simply issuing a http protocol level error. Unfortunately that only gets me one step further as I'm subsequently confronted with an error regarding the repomd.xml file where Satellite complains about an invalid element name in line 1. One difference I've seen is that the repomd.xml starts with a bare <repomd> tag, without any parameters in the tag, other repo's I see all have an xml-version tag line as the first line and specify parameters in de <repomd> tag: <repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm"&gt; I just did a test on my personal Rocky Linux VPS putting some RPMs in a directory and running the standard createrepo command to generate a repodata folder and the repomd.xml file that is generated does start with: <?xml version="1.0" encoding="UTF-8"?> <repomd xmlns="http://linux.duke.edu/metadata/repo" xmlns:rpm="http://linux.duke.edu/metadata/rpm"&gt; So I am really wondering what is being used to create your repodata as it doesn't seem to be following the regular standards. Also, mostly when I manually request a repomd.xml file from a repo using Firefox or some other browser, it immediately offers to save the file, with your web server it displays the xml in the browser window. Additionally, if I try to use wget on one of my company Red Hat Linux hosts I'm not getting a file at all; instead I'm confronted with a single line of html code that has a message embedded somewhere that the jfrog webapp requires javascript. Seriously? A web server hosting a yum repo should not require javascript support if you ask me.