Bug 1785654 - [UI] Importing job templates from throws NonUniqueInputsError
Summary: [UI] Importing job templates from throws NonUniqueInputsError
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Templates Plugin
Version: 6.7.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: 6.7.0
Assignee: Ondřej Pražák
QA Contact: Jitendra Yejare
URL:
Whiteboard:
Depends On:
Blocks: 1778146
TreeView+ depends on / blocked
 
Reported: 2019-12-20 15:07 UTC by Jitendra Yejare
Modified: 2020-04-14 13:28 UTC (History)
4 users (show)

Fixed In Version: tfm-rubygem-foreman_remote_execution-2.0.8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-14 13:28:12 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
cycle in foreign input sets metadata (998 bytes, text/plain)
2020-01-31 08:11 UTC, Ondřej Pražák
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 28647 0 Normal Closed [UI] Improve errors when template references self for foreign input sets 2020-10-26 19:08:44 UTC
Red Hat Product Errata RHSA-2020:1454 0 None None None 2020-04-14 13:28:22 UTC

Description Jitendra Yejare 2019-12-20 15:07:49 UTC
Description of problem:
Getting this error when importing job templates from local dir - "This template is locked. Please clone it to a new template to customize.ERF45-3514 [JobTemplate::NonUniqueInputsError]: Duplicated inputs detected: ["pre_script", "package", "post_script"]".

Version-Release number of selected component (if applicable):
Satellite 6.7 snap 6

How reproducible:
Always

Steps to Reproduce:
1. Attempt to import the job templates from local/git repo.

Actual results:
Job Template import throws an error "This template is locked. Please clone it to a new template to customize.ERF45-3514 [JobTemplate::NonUniqueInputsError]: Duplicated inputs detected: ["pre_script", "package", "post_script"]".
"

Expected results:
Successful import of job template or the appropriate human-readable error.

Additional info:

Comment 3 Ondřej Pražák 2020-01-03 12:46:57 UTC
Community templates sync without problems, I tried to add template input with a duplicate name to a job template, but I did not get error as described. Do we have a template (or a whole template repo) that causes this?

Comment 5 Ondřej Pražák 2020-01-06 14:37:55 UTC
Created redmine issue https://projects.theforeman.org/issues/28647 from this bug

Comment 6 Bryan Kearney 2020-01-07 15:02:00 UTC
Upstream bug assigned to oprazak

Comment 7 Bryan Kearney 2020-01-07 15:02:10 UTC
Upstream bug assigned to oprazak

Comment 8 Bryan Kearney 2020-01-29 09:01:36 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28647 has been resolved.

Comment 9 Ondřej Pražák 2020-01-31 08:11:52 UTC
Created attachment 1656674 [details]
cycle in foreign input sets metadata

The issue is caused by invalid metadata - when template uses itself as a source for foreign input sets, an attempt is made to create duplicate template inputs. While it is correct that template is not imported, the error message does not point to the cause of the problem. I added a validation that checks for this kind of cyclic dependencies.

Comment 10 Jitendra Yejare 2020-02-27 09:01:40 UTC
Verified!

@ Satellite 6.7 snap 13


Steps:
----------------
1.  Attempt to import the job templates from local/git repo that has invalid metadata as per comment 9.


Observation:
-----------------

The template is not being imported and Satellite is showing the correct reason for it as below:

ERF45-3514 [JobTemplate::NonUniqueInputsError]: Duplicated inputs detected: ["errata"]

Comment 13 errata-xmlrpc 2020-04-14 13:28:12 UTC
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/RHSA-2020:1454


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