Bug 2053329

Summary: content-view import fails with Error: PG::StringDataRightTruncation: ERROR: value too long for type character varying(255)
Product: Red Hat Satellite Reporter: matt jia <mjia>
Component: Inter Satellite SyncAssignee: Jeremy Lenz <jlenz>
Status: CLOSED ERRATA QA Contact: Radek Mynar <rmynar>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.10.2CC: ahumbe, jlenz, vsedmik, zhunting
Target Milestone: 6.11.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-4.3.0.5-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 2059390 (view as bug list) Environment:
Last Closed: 2022-07-05 14:32:53 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 matt jia 2022-02-11 01:34:45 UTC
Description of problem:

Importing a content view with long name + long path into a disconnected Satellite failed with:


Exception:
ActiveRecord::ValueTooLong: PG::StringDataRightTruncation: ERROR:  value too long for type character varying(255)
Backtrace:

/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:291:in `block in write_audit'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:112:in `block in run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/activesupport-6.0.3.7/lib/active_support/callbacks.rb:139:in `run_callbacks'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:290:in `write_audit'
/opt/theforeman/tfm/root/usr/share/gems/gems/audited-4.9.0/lib/audited/auditor.rb:269:in `audit_create'


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

6.10.2

How reproducible:

East

Steps to Reproduce:
1. create a content view with a long name, for example:

XXXX_Red_Hat_Software_Collections_RPMs_for_Red_Hat_Enterprise_Linux_7_Server_x86_64_7Server

2. export and copy the archive to:

/XXX/XXX_Red_Hat_Software_Collections_RPMs_for_Red_Hat_Enterprise_Linux_7_Server_x86_64_7Server/1.0/2022-01-29T02-54-30-10-30/


3. run the import:

hammer content-import version --organization-id 1 --path /var/lib/pulp/imports/XXX/XXXX_Red_Hat_Software_Collections_RPMs_for_Red_Hat_Enterprise_Linux_7_Server_x86_64_7Server/1.0/2022-01-29T02-54-30-10-30/


Actual results:

The import failed with:

ActiveRecord::ValueTooLong: PG::StringDataRightTruncation: ERROR:  value too long for type character varying(255)


Expected results:

The import should be successfully. 


Additional info:

Comment 2 Jeremy Lenz 2022-02-14 18:50:58 UTC
Created redmine issue https://projects.theforeman.org/issues/34448 from this bug

Comment 3 Bryan Kearney 2022-02-17 16:06:53 UTC
Moving this bug to POST for triage into Satellite since the upstream issue https://projects.theforeman.org/issues/34448 has been resolved.

Comment 5 Radek Mynar 2022-04-13 13:36:54 UTC
Content view with long name was successfully imported on Satellite 6.11.0 SNAP 15.0 using the steps from description.

VERIFIED

Comment 8 errata-xmlrpc 2022-07-05 14:32:53 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 (Moderate: Satellite 6.11 Release), 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-2022:5498