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 1655876 - "composer-cli sources info" results in Internal Server error if gpgkey=file is included
Summary: "composer-cli sources info" results in Internal Server error if gpgkey=file i...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lorax
Version: 8.1
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Brian Lane
QA Contact: Release Test Team
Vladimír Slávik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-12-04 07:15 UTC by Ranjith Rajaram
Modified: 2019-06-14 01:36 UTC (History)
2 users (show)

Fixed In Version: lorax-28.14.18-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-14 01:36:03 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Ranjith Rajaram 2018-12-04 07:15:55 UTC
Description of problem:

# composer-cli sources list
appstream-beta
baseos-beta


# composer-cli sources info baseos-beta
**************

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>500 Internal Server Error</title>
<h1>Internal Server Error</h1>
<p>The server encountered an internal error and was unable to complete your request.  Either the server is overloaded or there is an error in the application.</p>

**************

From the logs:

Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]: [2018-12-04 02:00:56,992] ERROR in app: Exception on /api/v0/projects/source/info/baseos-beta [GET]
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]: Traceback (most recent call last):
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     response = self.full_dispatch_request()
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     rv = self.handle_user_exception(e)
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     reraise(exc_type, exc_value, tb)
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     raise value
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     rv = self.dispatch_request()
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     return self.view_functions[rule.endpoint](**req.view_args)
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/pylorax/api/crossdomain.py", line 48, in wrapped_function
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     resp = make_response(f(*args, **kwargs))
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/pylorax/api/checkparams.py", line 40, in wrapped_function
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     return f(*args, **kwargs)
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/pylorax/api/v0.py", line 1584, in v0_projects_source_info
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     return toml.dumps(sources)
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/pytoml/writer.py", line 11, in dumps
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     dump(obj, fout, sort_keys=sort_keys)
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/pytoml/writer.py", line 121, in dump
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     fout.write('{0} = {1}\n'.format(_escape_id(k), _format_value(v)))
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:   File "/usr/lib/python3.6/site-packages/pytoml/writer.py", line 91, in _format_value
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]:     raise RuntimeError(v)
Dec 04 02:00:56 localhost.localdomain lorax-composer[2045]: RuntimeError: ['file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release']

--------------------

If I remove "gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release" from repo configuration, then it works

composer-cli sources info baseos-beta
[baseos-beta]
name = "baseos-beta"
system = true
url = "http://192.168.122.1/rhel8/BaseOS/"
type = "yum-baseurl"
check_ssl = true
check_gpg = false





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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

test.repo from /etc/yum.repos.d/test.repo 

[baseos-beta]
name=baseosbeta
baseurl=http://download-node-02.eng.bos.redhat.com/released/RHEL-8/8.0-Beta/BaseOS/x86_64/os/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[appstream-beta]
name=appstreambeta
baseurl=http://download-node-02.eng.bos.redhat.com/released/RHEL-8/8.0-Beta/AppStream/x86_64/os/
#baseurl=http://192.168.122.1/rhel8/AppStream/
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

Comment 1 Ranjith Rajaram 2018-12-04 07:18:41 UTC
Providing the information that were missed

Version-Release number of selected component (if applicable):
lorax-templates-rhel-8.0-19.el8.noarch
lorax-28.14.16-1.el8.x86_64
lorax-composer-28.14.16-1.el8.x86_64
lorax-lmc-novirt-28.14.16-1.el8.x86_64
lorax-templates-generic-28.14.16-1.el8.x86_64

How reproducible:
Awlays

Steps to Reproduce:
1. Create a test.repo and point it towards a custom repo
2. enabled gpg key check and include file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release


Actual results:

composer-cli sources info <source-names> fails with an internal server error

Expected results:

composer-cli sources info <source-names> should work

Comment 2 Brian Lane 2018-12-04 22:08:20 UTC
Ugh. This is dnf changing how it returns elements of the repository object. It's leaking their backend types, like VectorString, into python and toml.dumps doesn't know how to handle it.

Backport patches from master.

https://github.com/weldr/lorax/pull/537

Comment 4 Alexander Todorov 2019-01-24 14:16:20 UTC
https://travis-ci.org/weldr/lorax/builds/483834721 - PASS


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