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.
Description of problem:
The lorax-composer backend does not seem to properly validate the TOML that is passed to it. The resulting errors are cryptic to nonexistent in the event that malformed TOML is passed.
Version-Release number of selected component (if applicable):
lorax-composer-28.14.23-1.el8.x86_64
How reproducible:
Easily
Steps to Reproduce:
1. Import malformed TOML
1.a Example 1 - Capitalized "Name" where it should be "name"
name = "cmake-image"
description = "Just including cmake"
version = "0.0.1"
modules = []
groups = []
[[packages]]
Name = "cmake"
version = "*"
1.b Example 2 - Correct "name" but missing a second closing square-brace for "packages"
name = "cmake-image"
description = "Just including cmake"
version = "0.0.1"
modules = []
groups = []
[[packages]
name = "cmake"
version = "*"
2. Push the blueprint to lorax-composer via composer-cli
# composer-cli blueprints push <malformed TOML>
Actual results:
Example 1.a:
# composer-cli blueprints push cmake.toml
2019-06-03 13:52:27,033: 'NoneType' object has no attribute 'lower'
Example 1.b:
# composer-cli blueprints push cmake.toml
2019-06-03 13:49:37,157: <string>(7, 1): msg
Expected results:
# composer-cli blueprints push cmake.toml
2019-06-03 13:52:27,033: Malformed TOML: Unable to import.
Additional info:
If possible, it would be great if we could pass the TOML through some sort of linter and emit an accurate error as to what is malformed.
This works nicely for the mentioned example 1.a and similar cases, but in case of example 1.b the message is still the same. Would it be possible to change it to something more user friendly like "Syntax error on line 30" instead of "2019-12-06 09:06:27,092: <string>(30, 11): msg" ?
Tested with:
composer-cli-28.14.35-1.el8.x86_64
lorax-composer-28.14.35-1.el8.x86_64
(In reply to Jakub Rusz from comment #4)
> This works nicely for the mentioned example 1.a and similar cases, but in
> case of example 1.b the message is still the same. Would it be possible to
> change it to something more user friendly like "Syntax error on line 30"
> instead of "2019-12-06 09:06:27,092: <string>(30, 11): msg" ?
> Tested with:
> composer-cli-28.14.35-1.el8.x86_64
> lorax-composer-28.14.35-1.el8.x86_64
Not really. At this point I don't want to get into trying to parse the toml error strings into something else.
(In reply to Brian Lane from comment #5)
> (In reply to Jakub Rusz from comment #4)
> > This works nicely for the mentioned example 1.a and similar cases, but in
> > case of example 1.b the message is still the same. Would it be possible to
> > change it to something more user friendly like "Syntax error on line 30"
> > instead of "2019-12-06 09:06:27,092: <string>(30, 11): msg" ?
> > Tested with:
> > composer-cli-28.14.35-1.el8.x86_64
> > lorax-composer-28.14.35-1.el8.x86_64
>
> Not really. At this point I don't want to get into trying to parse the toml
> error strings into something else.
Alright, since everything else looks ok, I can verify this bug.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHBA-2020:1597
Description of problem: The lorax-composer backend does not seem to properly validate the TOML that is passed to it. The resulting errors are cryptic to nonexistent in the event that malformed TOML is passed. Version-Release number of selected component (if applicable): lorax-composer-28.14.23-1.el8.x86_64 How reproducible: Easily Steps to Reproduce: 1. Import malformed TOML 1.a Example 1 - Capitalized "Name" where it should be "name" name = "cmake-image" description = "Just including cmake" version = "0.0.1" modules = [] groups = [] [[packages]] Name = "cmake" version = "*" 1.b Example 2 - Correct "name" but missing a second closing square-brace for "packages" name = "cmake-image" description = "Just including cmake" version = "0.0.1" modules = [] groups = [] [[packages] name = "cmake" version = "*" 2. Push the blueprint to lorax-composer via composer-cli # composer-cli blueprints push <malformed TOML> Actual results: Example 1.a: # composer-cli blueprints push cmake.toml 2019-06-03 13:52:27,033: 'NoneType' object has no attribute 'lower' Example 1.b: # composer-cli blueprints push cmake.toml 2019-06-03 13:49:37,157: <string>(7, 1): msg Expected results: # composer-cli blueprints push cmake.toml 2019-06-03 13:52:27,033: Malformed TOML: Unable to import. Additional info: If possible, it would be great if we could pass the TOML through some sort of linter and emit an accurate error as to what is malformed.