Problem:
I am trying to properly setup by-hash for my apt mirrors of Ubuntu archive (and other repos that support it). I am setting up the Pulp “server” using the docker-compose setup from the Pulp OCI images repository. The feature overview page mentions that the option has to be enabled, which I did in settings/settings.py
(base file here) by appending APT_BY_HASH = True
and that a reverse proxy and cache must be setup for that.
At first, I took the reverse proxy and cache for granted since the docker-compose setup comes with the nginx configuration already in place and redis for caching. However, upon closer inspection of the logs, all by-hash requests made via apt failed, and in fact, the by-hash
directory is not created in the repository either. So, I would appreciate more guidance in how to modify the setup, in particular the nginx.conf.template from the official repo’s docker-compose setup.
Here is an example of a request and answer:
Answer for: http://***/pulp/content/archive-focal/prod/dists/focal/main/binary-amd64/by-hash/SHA256/f25bb719a900d962a4df25cbb20f0a54a23d9f16c3fcdc4f4872ead131f5a604
HTTP/1.1 404 Not Found
Server: nginx/1.16.1
Date: Mon, 13 May 2024 11:29:50 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 14
Connection: keep-alive
Expected outcome:
Apt working normall with the by-hash
requests to return an OK status (200), the by-hash directory to be created in the repository, and consumption of the corresponding mirrors with only rare occurrences of the Hash Sum mismatch error.
Pulpcore version:
3.13.0 (for the application managing the repositories)
Pulp plugins installed and their versions:
Management scripts:
- pulp-cli==0.25.1
- pulp-cli-deb==0.1.0
- pulp-glue==0.25.1
- pulp-glue-deb==0.1.0
Server:
- deb: 3.2.0
- rpm: 3.25.3
- core: 3.52.0
- file: 3.52.0
- maven: 0.8.0
- ostree: 2.3.0
- python: 3.11.1
- ansible: 0.21.3
- certguard: 3.52.0
- container: 2.19.3
Operating system - distribution and version:
Server:
- Ubuntu Server 22.04 (jammy)
- Pulp-minimal: 3.52
Clients (consumers):
- Ubuntu 20.04 (focal) with apt 2.0.10
- Ubuntu 22.04 (jammy) with apt 2.4.12
Other relevant data:
No error information, just 404 codes. The mirror can still be used, but is very prone to the Hash Sum mismatch issue.