Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1523799

Summary: registries_migrator redirection does not work
Product: Red Hat Enterprise Linux 7 Reporter: Brent Baude <bbaude>
Component: atomicAssignee: Jindrich Novy <jnovy>
Status: CLOSED WONTFIX QA Contact: atomic-bugs <atomic-bugs>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.4CC: adimania, ajia, amurdaca, bbaude, Bert.Deknuydt, ddarrah, dwalsh, extras-qa, lsm5, walters
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1523224 Environment:
Last Closed: 2021-02-15 07:33:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1523224, 1627614    
Bug Blocks:    

Description Brent Baude 2017-12-08 18:42:02 UTC
+++ This bug was initially created as a clone of Bug #1523224 +++

Description of problem:

When you have your /etc/containers/registries.conf file in the 'old' YAML format, the registries.service gives a warning you should convert it to TOML:

Dec 04 15:18:13 coco.esat.kuleuven.be registries.log_warning[751]: /etc/containers/registries.conf is in YAML format and should be in TOML format. Back this file up and then use /usr/libexec/registries_migrator > /etc/containers/registries.conf to convert it to TOML.

However:

*) When you follow the recipe, it will simply wipe out your
   file (replaced with an essentially empty file).  Probably 
   the redirection problem (start outputting while still reading 
   the same file). Tool should read first the complete input file, 
   then spit out the result.
   
*) When you circumvent this problem by redirecting somewhere else, 
   it still fails to produce a correct file, as it puts quotes in
   the wrong place.

Version-Release number of selected component (if applicable):

F27: atomic-registries-1.20.1-3.fc27.x86_64
F26: atomic-registries-1.20.1-1.fc26.x86_64

How reproducible:

Always

Steps to Reproduce:
1. Check original correct YAML file: (I removed the comment)
 
   >> cat /etc/containers/registries.conf
   registries:
   - docker-registry.esat.kuleuven.be:5000
   - registry.fedoraproject.org
   - registry.access.redhat.com

2. Follow the recipe literally:

   >> /usr/libexec/registries_migrator > /etc/containers/registries.conf
 
   See the file gone:

   >> cat /etc/containers/registries.conf
   ["registries.search"]
   registries = []

   ["registries.insecure"]
   registries = []

   ["registries.block"]
   registries = []

3. Follow the recipe, but redirect elsewhere

   (After putting back the original obviously)
 
   >> /usr/libexec/registries_migrator > /etc/containers/registries.conf.new
   
   >> cat /etc/containers/registries.conf.new
   ["registries.search"]
   registries = ["docker-registry.esat.kuleuven.be:5000",    "registry.fedoraproject.org", "registry.access.redhat.com"]

   ["registries.insecure"]
   registries = []

   ["registries.block"]
   registries = []

   No it's not empty, but ... the quotes inside the []'s are afaik not
   valid TOML.

4. Try start registries service

   >> mv /etc/containers/registries.conf.new /etc/containers/registries.conf

   >> systemctl start registries.service
   Job for registries.service failed because the control process exited with error code.
   See "systemctl  status registries.service" and "journalctl  -xe" for details.

   Error is:
   Dec 07 13:39:11 coco.esat.kuleuven.be registries[11347]: Unable to load and parse /etc/containers/registries.conf

5. Remove the incorrect quotes from the file, so that it looks like;

   [registries.search]
   registries = ["docker-registry.esat.kuleuven.be:5000", "registry.fedoraproject.org", "registry.access.redhat.com"]

   [registries.insecure]
   registries = []

   [registries.block]
   registries = []
   
Additional info:

Not really convinced the the move from YAML to TOML was really worth the trouble. Keeping in mind that the only
thing it does, is output a single bash line for an environment variable ...

--- Additional comment from Brent Baude on 2017-12-07 10:38:10 EST ---

Hey Bert,

Thanks for the bugzilla report.  I built new Fedora binaries to resolve this yesterday but it looks like Fedora is still having infrastructure issues.  I still am not able to log into bodhi to release them.

When koji's web interfaces work again, I'll drop a pointer here for the new packages.

--- Additional comment from Brent Baude on 2017-12-07 10:40:23 EST ---

Bert, oh wait, this is a different issue.  Lemme dive into this.

--- Additional comment from Brent Baude on 2017-12-07 11:48:20 EST ---

@Bert, I'm about to build what I think is a fixed package.  I'm curious if you are on IRC freenode? If so, /query me (rangerpb) and maybe we can collaborate to make sure it works for you.

--- Additional comment from Fedora Update System on 2017-12-07 15:33:19 EST ---

atomic-1.20.1-8.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ae5e48371f

--- Additional comment from Fedora Update System on 2017-12-07 15:33:27 EST ---

atomic-1.20.1-8.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-11adc9ee2c

--- Additional comment from Brent Baude on 2017-12-07 15:34:45 EST ---

@Bert, would you mind checking the newly built packages out and providing karma (links above in the bz) if they work for you?

BTW, thanks for your thorough bug description.

--- Additional comment from Bert DeKnuydt on 2017-12-08 03:32:12 EST ---


Hi Brent,

Just tested atomic-registries-1.20.1-8.fc26.x86_64.  It makes no change
whatsoever:

* When used with redirect: 'empty' file.
* When used otherwise:  invalid TOML file.

So no Karma yet :P

--- Additional comment from Fedora Update System on 2017-12-08 10:39:34 EST ---

atomic-1.20.1-9.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-7f99dc8add

--- Additional comment from Fedora Update System on 2017-12-08 10:39:43 EST ---

atomic-1.20.1-9.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-7150e3f48f

--- Additional comment from Brent Baude on 2017-12-08 10:41:17 EST ---

After working with Bert, the migration looks good and we decided to add an output option to the migration tool to avoid the piping issues.

--- Additional comment from Bert DeKnuydt on 2017-12-08 10:43:41 EST ---

All fixed now.  Thanks Brent.

Comment 4 RHEL Program Management 2021-02-15 07:33:58 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.