Bug 1523224 - registries_migrator is badly broken in F26 and F27
Summary: registries_migrator is badly broken in F26 and F27
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: atomic
Version: 27
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Brent Baude
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1523799 1627614
TreeView+ depends on / blocked
 
Reported: 2017-12-07 12:52 UTC by Bert DeKnuydt
Modified: 2018-09-11 03:54 UTC (History)
7 users (show)

Fixed In Version: atomic-1.20.1-9.fc27 atomic-1.20.1-9.fc26
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1523799 1627614 (view as bug list)
Environment:
Last Closed: 2017-12-19 19:47:42 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Bert DeKnuydt 2017-12-07 12:52:19 UTC
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 ...

Comment 1 Brent Baude 2017-12-07 15:38:10 UTC
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.

Comment 2 Brent Baude 2017-12-07 15:40:23 UTC
Bert, oh wait, this is a different issue.  Lemme dive into this.

Comment 3 Brent Baude 2017-12-07 16:48:20 UTC
@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.

Comment 4 Fedora Update System 2017-12-07 20:33:19 UTC
atomic-1.20.1-8.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-ae5e48371f

Comment 5 Fedora Update System 2017-12-07 20:33:27 UTC
atomic-1.20.1-8.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-11adc9ee2c

Comment 6 Brent Baude 2017-12-07 20:34:45 UTC
@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.

Comment 7 Bert DeKnuydt 2017-12-08 08:32:12 UTC
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

Comment 8 Fedora Update System 2017-12-08 15:39:34 UTC
atomic-1.20.1-9.fc27 has been submitted as an update to Fedora 27. https://bodhi.fedoraproject.org/updates/FEDORA-2017-7f99dc8add

Comment 9 Fedora Update System 2017-12-08 15:39:43 UTC
atomic-1.20.1-9.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-7150e3f48f

Comment 10 Brent Baude 2017-12-08 15:41:17 UTC
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.

Comment 11 Bert DeKnuydt 2017-12-08 15:43:41 UTC
All fixed now.  Thanks Brent.

Comment 12 Fedora Update System 2017-12-09 07:28:54 UTC
atomic-1.20.1-9.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-7150e3f48f

Comment 13 Fedora Update System 2017-12-10 00:33:31 UTC
atomic-1.20.1-9.fc27 has been pushed to the Fedora 27 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-7f99dc8add

Comment 14 Fedora Update System 2017-12-19 19:47:42 UTC
atomic-1.20.1-9.fc27 has been pushed to the Fedora 27 stable repository. If problems still persist, please make note of it in this bug report.

Comment 15 Fedora Update System 2017-12-19 21:35:03 UTC
atomic-1.20.1-9.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.