Unable to mirror Ubuntu Cloud Archive due to incompatibility with path name fragment

Bug #2041667 reported by David A. Desrosiers
20
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Landscape Server
New
Undecided
Unassigned

Bug Description

The naming convention of the paths found in a 'standard' Ubuntu archive are supported by Landscape when mirroring, but the paths that are used in Ubuntu Cloud Archive (uca) contain an additional fragment which is not supported by Landscape's repo parser.

We have at least one customer directly impacted by this and they cannot move forward without this being addressed.

For example, mirroring Jammy would include a repository path that looks like:

ubuntu/jammy/{main,universe,restricted}

While attempting to mirror the Jammy-Yoga UCA endpoint for OpenStack packages, looks like:

ubuntu/jammy-proposed/yoga/{main}

Note the additional branch for the OpenStack release in this fragment (/yoga/). This currently breaks Landscape's ability to mirror this repository.

One workaround proposed would be to make a change on the _infrastructure_ side, inside the actual UCA repository hierarchy itself, by creating a symlink tree back to the collapsed naming convention so Landscape isn't confused and can mirror those packages.

A working pseudocode shell snippet that would create this looks like:

for series in *; do
    if [[ -d "${series}" ]]; then
        for pocket in "${series}"/*; do
            pocket_name=$(basename "${pocket}")
            ln -sf "${series}/${pocket_name}" "${series}-${pocket_name}"
        done
    fi
done

This effectively will collapse one child directory into a symlink (/jammy-proposed/yoga/ => /jammy-proposed-yoga/) that then allows customers using Landscape to mirror UCA respositories without the issue of that additional directory throwing off LDS.

As Landscape is a first-class citizen product, it should be able to handle the package repositories used by Canonical products, including the main repositories and the cloud-archive repositories.

This is only a stopgap, but the problem really does lie on the Landscape server side, not the repository layout itself.

Or whatever tooling is appropriate to merge that naming into a symlink at that level. It would be unique to each of the pockets.

information type: Proprietary → Public
Revision history for this message
Alan Baghumian (alanbach) wrote :
Download full text (3.3 KiB)

Hello Landscape Team!

I was also struggling with this issue and finally had some time to spare to get to the bottom of it.

It appears that some sort of input validation is blocking "--pockets" parameter from accepting slashes. If we modify the code to allow that, everything else should work fine after that.

Example input and the error:

$ landscape-api create-series --pockets updates/yoga --components main --architectures amd64 --gpg-key secret-key --mirror-gpg-key cloud-archive-key --mirror-uri http://ubuntu-cloud.archive.canonical.com/ubuntu/ --mirror-series focal focal-yoga cloud

Got server error:
Status: 400
Error code: InvalidParameterValue
Error message: Invalid unicode value updates/yoga

I discovered a simple workaround, which is manually updating the record in the PostgreSQL DB. Essentially, pass a "valid" value to --pockets, then fix it in the DB:

$ landscape-api create-series --pockets updates --components main --architectures amd64 --gpg-key secret-key --mirror-gpg-key cloud-archive-key --mirror-uri http://ubuntu-cloud.archive.canonical.com/ubuntu/ --mirror-series focal focal-yoga cloud

(Fix Path in Database / Juju deployed example here)

$ juju ssh postgresql/0
$ sudo -u postgres psql -d landscape-account-1

landscape-account-1=# select * from pocket where mirror_uri like '%cloud%';
 id | series_id | name | mode | gpg_key_id | mirror_uri | mirror_suite | mirror_gpg_key_id | pull_pocket_id | upload_allow_unsigned | components | archs | include_udeb | filter_type | filters | creation_time
----+-----------+---------+------+------------+---------------------------------------------------+---------------+-------------------+----------------+-----------------------+------------+---------+--------------+-------------+---------+----------------------------
 18 | 14 | updates | 0 | 2 | http://ubuntu-cloud.archive.canonical.com/ubuntu/ | focal-updates | 4 | | | {main} | {amd64} | f | | {} | 2023-10-29 20:52:58.989255
(1 row)

landscape-account-1=# update pocket set mirror_suite='focal-updates/yoga' where id=18;
UPDATE 1

(Sync)
$ landscape-api sync-mirror-pocket updates focal-yoga cloud

Also a side note, today I found out that the "name" parameter in the create-series command has the same validation and does not accept dots:

Example input:

$ landscape-api create-series --pockets updates --components main --architectures amd64 --gpg-key secret-key --mirror-gpg-key cloud-archive-key --mirror-uri http://ubuntu-cloud.archive.canonical.com/ubuntu/ --mirror-series focal focal-ovn-22.03 cloud

This command fails with the same "Invalid unicode value" error.

After the database updates are done, everything else should work as normal going forward:

(Initial Association)
$ landscape-api create-repository-profile --description "Cloud Archive Repos - Focal" focal-cloud-repo-profile
$ landscape-api add-pockets-to-repository-profile focal-cloud-repo-profile updates focal-yoga cloud

(Then from Juju)
$ juju config lds-client-focal tags="vstack,focal,focal-cloud"

(Final Association...

Read more...

Revision history for this message
Alan Baghumian (alanbach) wrote :
tags: added: low-hanging-fruit
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.