Bug 2150920
| Summary: | Image Builder fails with some customizations | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 8 | Reporter: | Christophe Besson <cbesson> |
| Component: | osbuild-composer | Assignee: | Brian Lane <bcl> |
| Status: | CLOSED ERRATA | QA Contact: | Release Test Team <release-test-team-automation> |
| Severity: | medium | Docs Contact: | Eliane Ramos Pereira <elpereir> |
| Priority: | medium | ||
| Version: | 8.7 | CC: | amepatil, atodorov, bcl, elpereir, jcastran, mmatsuya, obudai, sbarcomb, thozza |
| Target Milestone: | rc | Keywords: | Regression, Reproducer, Triaged |
| Target Release: | --- | Flags: | pm-rhel:
mirror+
|
| Hardware: | All | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | osbuild-composer-85-1.el8 | Doc Type: | Bug Fix |
| Doc Text: |
Cause:
The customizations.firewall example in the documentation at - https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/composing_a_customized_rhel_system_image/index#image-customizations_creating-system-images-with-composer-command-line-interface is incorrect.
It should be 'ports = ["PORTS"]' not 'port = ["PORTS"]'
Consequence:
Users construct blueprints that will not work correctly.
Fix:
Update the docs.
Result:
Happy Customers!
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2023-11-14 15:25:24 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: | |||
|
Description
Christophe Besson
2022-12-05 16:21:46 UTC
Two unrelated issues here, the first is that you should use 'ports = ["22"]' not 'port'. That won't fix the crash though. Until that is fixed you can work around the crash by viewing the blueprint as JSON with 'composer-cli --json blueprints show notworking'. This needs a toml library fix backported from upstream. Ah yep, port in singular was a typo. At a first glance I thought these directives were not taken into account anymore, but it's almost cosmetic. Hence reducing the severity to medium. Thanks for your prompt feedback! Late note. The doc needs to be amended, as it mentions "port" in singular whereas the code expects it in plural (as a list). https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html-single/composing_a_customized_rhel_system_image/index#image-customizations_creating-system-images-with-composer-command-line-interface Sorry to bother you again but the doc is also wrong on the expected value...
It tells:
"""
To enable lists, you can use numeric ports, or their names from the /etc/services file.
"""
Intuitively the user can define ports with ["22", "80"] or ["22/tcp", "80/tcp"] but both forms won't work, leading to a FAILED compose without any log explaining what happened ("log is empty").
This is problematic for the support as we need to rely on strace to figure out the problem:
/tmp/worker.strace:9697 15:06:08.743339 write(1<pipe:[164644]>, "{\"type\": \"https://osbuild.org/validation-error\", \"title\": \"JSON Schema validation failed\", \"success\": false, \"errors\": [{\"message\": \"'80/tcp' does not match '.:(tcp|udp|sctp|dccp)$'\", \"path\": [\"pipelines\", 1, \"stages\", 7, \"options\", \"ports\", 0]}]}\n", 248) = 248 <0.000030>
As per /usr/lib/osbuild/stages/org.osbuild.firewall, the expected pattern seems to be a numeric port or a port range followed by a dash and the protocol (which is mandatory).
34 SCHEMA = """
35 "additionalProperties": false,
36 "properties": {
37 "ports": {
38 "description": "Ports (or port ranges) to open",
39 "type": "array",
40 "items": {
41 "type": "string",
42 "description": "A port or port range: 'portid[-portid]:protocol'",
43 "pattern": ".:(tcp|udp|sctp|dccp)$"
44 }
45 },
Thanks!
The documentation for blueprints is here - https://www.osbuild.org/guides/image-builder-on-premises/blueprint-reference.html#firewall I'm not sure how we ended up with things getting out of sync. @elpereir This seems like an issue in the documentation. May I ask you to take a look? The upstream docs should be correct about the service customization. Many thanks! :) FTR, the crash was fixed upstream in https://github.com/osbuild/osbuild-composer/pull/3099. 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 (osbuild, osbuild-composer, and cockpit-composer bug fix and enhancement update), 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/RHEA-2023:6906 |