Bug 803702 - Synchronizing a repo with i18n characters in name fails for second time
Summary: Synchronizing a repo with i18n characters in name fails for second time
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: Unspecified
Assignee: Mike McCune
QA Contact: Garik Khachikyan
URL:
Whiteboard:
: 858000 (view as bug list)
Depends On:
Blocks: 804610 835586 cfse-object-labels, katello-object-label
TreeView+ depends on / blocked
 
Reported: 2012-03-15 13:08 UTC by Tomas Strachota
Modified: 2019-09-25 21:09 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Synchronizing a repository with non-ASCII characters worked on first execution but failed on subsequent attempts because of limitations identifying objects such as organizations, environments, products, and repositories with UTF-8 characters. This update properly parses repositories containing non-ASCII characters. Repository synchronization works correctly on both first and subsequent attempts, regardless of the characters included.
Clone Of:
Environment:
Last Closed: 2012-12-04 19:42:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Relevant part of pulp.log (10.05 KB, text/x-log)
2012-03-15 13:08 UTC, Tomas Strachota
no flags Details
Proposed fix (1.01 KB, patch)
2012-03-15 14:43 UTC, Tomas Strachota
no flags Details | Diff
reproducer script (526 bytes, application/x-sh)
2012-03-23 10:47 UTC, Tomas Strachota
no flags Details
katello logs (2.19 MB, application/x-gzip)
2012-09-25 12:11 UTC, Garik Khachikyan
no flags Details
Updated reproducer script (531 bytes, application/x-shellscript)
2012-09-25 13:28 UTC, Brad Buckingham
no flags Details
Reproducer with i18n username. (740 bytes, text/plain)
2012-09-25 23:52 UTC, Og Maciel
no flags Details
reproducer without utf8 usernames (524 bytes, application/x-shellscript)
2012-10-01 19:36 UTC, Mike McCune
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2012:1543 0 normal SHIPPED_LIVE Important: CloudForms System Engine 1.1 update 2012-12-05 00:39:57 UTC

Description Tomas Strachota 2012-03-15 13:08:41 UTC
Created attachment 570290 [details]
Relevant part of pulp.log

Description of problem:
Synchronizing a repo with international characters works for first time but fails on second attempt due to missing updateinfo.xml.


Version-Release number of selected component (if applicable):
pulp-1.0.2-1
katello-0.2.13-1


Steps to Reproduce:
1. create a repo with i18n name
2. sync it - should work
3. sync it for second time - fails
  

Actual results:

#katello repo synchronize --id 95
Repo [ repo_žabička_ec450ca ] failed to sync: Could not add metadata from file /var/lib/pulp//repos/org_žabička_ec450ca/Library/custom/fewups_product_žabička_ec450ca/repo_žabička_ec450ca//updateinfo.xml: /var/lib/pulp//repos/org_žabička_ec450ca/Library/custom/fewups_product_žabička_ec450ca/repo_žabička_ec450ca//updateinfo.xml not found

Comment 1 Tomas Strachota 2012-03-15 14:43:45 UTC
Created attachment 570314 [details]
Proposed fix

Comment 2 Sayli Karmarkar 2012-03-22 17:55:22 UTC
Tomas, Can you share repo feed and id/relative path used? I am not able to reproduce it. 

$ sudo pulp-admin repo create --id सायली --feed http://repos.fedorapeople.org/repos/pulp/pulp/dev/testing/fedora-15/x86_64/
Successfully created repository [ सायली ]

$ sudo pulp-admin repo sync --id सायली  -F
Sync for repository सायली started
Sync: Finished
21/21 new items downloaded
0/21 existing items processed

Item Details: 
RPMs: 21/21

$ sudo pulp-admin repo sync --id सायली  -F
Sync for repository सायली started
Sync: Finished
0/21 new items downloaded
21/21 existing items processed

Item Details: 
RPMs: 21/21

All the logs are clean as well.

Comment 3 Tomas Strachota 2012-03-23 10:47:00 UTC
Created attachment 572238 [details]
reproducer script

Sayli, this bug is seen from katello perspective. All actions were made through katello cli and therefore communication with Pulp was via it's api. Reproducer script is attached.
Sorry for not being 100% specific from the start.

Comment 5 Mike McCune 2012-08-03 17:20:43 UTC
we are going to be doing a bunch of fixes in 1.1 for i18 repo names, will validate this one as well.

Comment 6 Mike McCune 2012-09-17 18:42:38 UTC
*** Bug 858000 has been marked as a duplicate of this bug. ***

Comment 7 Og Maciel 2012-09-17 19:13:54 UTC
BLOCKED by https://bugzilla.redhat.com/show_bug.cgi?id=858011

Comment 8 Mike McCune 2012-09-19 18:03:29 UTC
https://github.com/Katello/katello/pull/705

Comment 11 Garik Khachikyan 2012-09-25 12:07:35 UTC
# REOPEN

recent rpm-s provided in this errata seem not have the fix for CLI commands mentioned in: comment#3 script.

It still fails (logs will follow)

checked on packages:
----
katello-1.1.12-9.el6cf.noarch
katello-cli-1.1.8-5.el6cf.noarch
----

Comment 12 Garik Khachikyan 2012-09-25 12:11:51 UTC
Created attachment 617001 [details]
katello logs

[ERROR: 2012-09-25 07:58:11 #16038] *** ERROR: Couldn't find organization 'žába1' (404) ***
[ERROR: 2012-09-25 07:58:11 #16038] REQUEST URL: /cfse/api/organizations/%C5%BE%C3%A1ba1/providers?name=Red+Hat
[ERROR: 2012-09-25 07:58:11 #16038] HttpErrors::NotFound: Couldn't find organization 'žába1'
/usr/share/katello/app/controllers/api/api_controller.rb:98:in `find_optional_organization'
/usr/share/katello/app/controllers/api/api_controller.rb:92:in `find_organization'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:458:in `_run__1237688956__process_action__815841437__callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:221:in `_conditional_callback_around_3384'
/usr/share/katello/lib/util/threadsession.rb:79:in `thread_locals'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:220:in `_conditional_callback_around_3384'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:446:in `_run__1237688956__process_action__815841437__callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:410:in `send'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:94:in `send'
(...)

Comment 13 Brad Buckingham 2012-09-25 13:27:49 UTC
With the changes to resolve this BZ, a 'label' attribute had to be added for objects such as org, env, product and repo.  In cases where the object needs to be passed as part of the REST resource, the label must be used.  From a Katello user point of view, this will most commonly be the organization label.  The failure above is one such case.  

Will attach an 'updated' script where the label is provided during org creation.  If one isn't provided, the user can still obtain the label that was automatically assigned using 'org list' command.

The following is an example scenario, based on the original reproducer:

katello> org create --name žába --label zaba
Successfully created org [ žába ]

katello> provider create --name test_prov --org zaba
Successfully created provider [ test_prov ]

katello> product create --name žába_prod --provider test_prov --url http://tstrachota.fedorapeople.org/dummy_repos/zoo/ --assumeyes --org zaba
Successfully created product [ žába_prod ]
Discovering repository urls, this could take some time...
(+)  [1] http://tstrachota.fedorapeople.org/dummy_repos/zoo
Successfully created repository [ žába_prod_dummy_repos_zoo ]

katello> repo synchronize --name žába_prod_dummy_repos_zoo --org zaba --product žába_prod
Repo [ žába_prod_dummy_repos_zoo ] synced                             

katello> repo synchronize --name žába_prod_dummy_repos_zoo --org zaba --product žába_prod
Repo [ žába_prod_dummy_repos_zoo ] synced

Comment 14 Brad Buckingham 2012-09-25 13:28:59 UTC
Created attachment 617048 [details]
Updated reproducer script

Comment 15 Og Maciel 2012-09-25 23:49:19 UTC
[root@qetello02 ~]# katello -u admin -p admin user create --username "Mané" --password redhat --email "mane"
Successfully created user [ Mané ]
[root@qetello02 ~]# katello -u admin -p admin user assign_role --username "Mané" --role "Administrator"
User 'Mané' assigned to role 'Administrator'
[root@qetello02 ~]# katello -u Mané -p redhat org create --name Cuiabá --label Cuiaba
Successfully created org [ Cuiabá ]
[root@qetello02 ~]# katello -u Mané -p redhat provider create --name test_prov --org Cuiaba
Successfully created provider [ test_prov ]
[root@qetello02 ~]# katello -u Mané -p redhat product create --name Cuiabá_prod --provider test_prov --url http://tstrachota.fedorapeople.org/dummy_repos/zoo/ --assumeyes --org Cuiaba
Successfully created product [ Cuiabá_prod ]
Discovering repository urls, this could take some time...
undefined method `[]' for nil:NilClass

Comment 16 Og Maciel 2012-09-25 23:52:51 UTC
Created attachment 617322 [details]
Reproducer with i18n username.

If the user performing the actions has a i18n username, then sync fails.

Comment 17 Mike McCune 2012-10-01 04:50:29 UTC
I'm working on fixing the issues found in comments 12-16

Comment 18 Mike McCune 2012-10-01 19:34:29 UTC
the below pull request moves the API to actually use the name as the param in the search:

https://github.com/Katello/katello/pull/770

the above reproducer scripts will fail because of the UTF8 usernames which is unrelated to the above bug and pull request.  That is tracked in this bz here:

https://bugzilla.redhat.com/show_bug.cgi?id=862068

Comment 19 Mike McCune 2012-10-01 19:36:03 UTC
Created attachment 619973 [details]
reproducer without utf8 usernames

This updated reproducer script sticks to utf8 username/passwords.  It does have utf8 org/product/repo names

Comment 22 Garik Khachikyan 2012-10-03 15:11:48 UTC
# VERIFIED

the scenario together with making promotion to the env and consuming yum install of the rpm from that repo works now without an issue:

---
yum install penguin
Loaded plugins: product-id, pulp-profile-update, rhnplugin, security, subscription-manager
Updating certificate-based repositories.
zaba_f346e256-f24d-4b96-8cd8-7723f6eab462_f346e256-f24d-4b96-8cd8-7723f6eab462_dummy_repos_zoo       | 3.7 kB     00:00     
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package penguin.noarch 0:0.9.1-1 will be installed
--> Processing Dependency: dolphin for package: penguin-0.9.1-1.noarch
--> Running transaction check
---> Package dolphin.noarch 0:3.10.232-1 will be installed
--> Processing Dependency: tiger for package: dolphin-3.10.232-1.noarch
--> Processing Dependency: bear for package: dolphin-3.10.232-1.noarch
--> Running transaction check
---> Package bear.noarch 0:4.1-1 will be installed
---> Package tiger.noarch 0:1.0-4 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================
 Package Arch   Version
                       Repository                                                                                      Size
============================================================================================================================
Installing:
 penguin noarch 0.9.1-1
                       zaba_f346e256-f24d-4b96-8cd8-7723f6eab462_f346e256-f24d-4b96-8cd8-7723f6eab462_dummy_repos_zoo 2.2 k
Installing for dependencies:
 bear    noarch 4.1-1  zaba_f346e256-f24d-4b96-8cd8-7723f6eab462_f346e256-f24d-4b96-8cd8-7723f6eab462_dummy_repos_zoo 2.2 k
 dolphin noarch 3.10.232-1
                       zaba_f346e256-f24d-4b96-8cd8-7723f6eab462_f346e256-f24d-4b96-8cd8-7723f6eab462_dummy_repos_zoo 2.3 k
 tiger   noarch 1.0-4  zaba_f346e256-f24d-4b96-8cd8-7723f6eab462_f346e256-f24d-4b96-8cd8-7723f6eab462_dummy_repos_zoo 2.2 k

Transaction Summary
============================================================================================================================
Install       4 Package(s)

Total download size: 8.9 k
Installed size: 168  
Is this ok [y/N]: y
Downloading Packages:
(1/4): bear-4.1-1.noarch.rpm                                                                         | 2.2 kB     00:00     
(2/4): dolphin-3.10.232-1.noarch.rpm                                                                 | 2.3 kB     00:00     
(3/4): penguin-0.9.1-1.noarch.rpm                                                                    | 2.2 kB     00:00     
(4/4): tiger-1.0-4.noarch.rpm                                                                        | 2.2 kB     00:00     
----------------------------------------------------------------------------------------------------------------------------
Total                                                                                        50 kB/s | 8.9 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : tiger-1.0-4.noarch                                                                                       1/4 
  Installing : bear-4.1-1.noarch                                                                                        2/4 
  Installing : dolphin-3.10.232-1.noarch                                                                                3/4 
  Installing : penguin-0.9.1-1.noarch                                                                                   4/4 
Installed products updated.
Consumer Id could not be found. Cannot update consumer profile.
  Verifying  : bear-4.1-1.noarch                                                                                        1/4 
  Verifying  : penguin-0.9.1-1.noarch                                                                                   2/4 
  Verifying  : tiger-1.0-4.noarch                                                                                       3/4 
  Verifying  : dolphin-3.10.232-1.noarch                                                                                4/4 

Installed:
  penguin.noarch 0:0.9.1-1                                                                                                  

Dependency Installed:
  bear.noarch 0:4.1-1                   dolphin.noarch 0:3.10.232-1                   tiger.noarch 0:1.0-4                  

Complete!
---

checked on:
katello-1.1.12-12.el6cf.noarch
katello-cli-1.1.8-6.el6cf.noarch

Comment 24 errata-xmlrpc 2012-12-04 19:42: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, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-1543.html


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