Red Hat Satellite engineering is moving the tracking of its product development work on Satellite 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 "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. 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 "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-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 1023062 - Architectures etc: resources created/modified should not use multibyte names in URLs
Summary: Architectures etc: resources created/modified should not use multibyte names ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Provisioning
Version: 6.0.2
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: Unspecified
Assignee: Dmitri Dolguikh
QA Contact: Tazim Kolhar
URL: http://projects.theforeman.org/issues...
Whiteboard:
: 1023137 (view as bug list)
Depends On: 1121755
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-24 14:25 UTC by Corey Welton
Modified: 2017-02-23 21:19 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-08-12 05:07:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Compute resource not found (35.90 KB, image/png)
2014-08-20 05:55 UTC, Tazim Kolhar
no flags Details
compute resource (47.55 KB, image/png)
2014-10-17 14:43 UTC, Tazim Kolhar
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 3516 0 None None None 2016-04-22 16:05:18 UTC
Red Hat Bugzilla 1023093 0 unspecified CLOSED User can break Domains UI by entering a nasty string for 'name' 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHSA-2015:1592 0 normal SHIPPED_LIVE Important: Red Hat Satellite 6.1.1 on RHEL 6 2015-08-12 09:04:35 UTC

Internal Links: 1023093

Description Corey Welton 2013-10-24 14:25:28 UTC
Description of problem:
when a user creates or renames a compute resource which has multibyte characters, the resulting namespace used by URL consists of nothing but resource id and a dash.  


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


How reproducible:


Steps to Reproduce:
1.  Use hammer cli to quickly create a couple compute resources for comparison (though the same thing happens when you create/edit in UI)
hammer -u admin -p admin compute_resource create --name my_resource --url qemu+tcp://localhost:16509/system --provider Libvirt
hammer -u admin -p admin compute_resource create --name Jalapeño --url qemu+tcp://localhost:16509/system --provider Libvirt
hammer -u admin -p admin compute_resource create --name 大傻瓜 --url qemu+tcp://localhost:16509/system --provider Libvirt
2.  Navigate to compute resource view to see all the CRs you just created.
3.  Observe URLs for each 

Actual results:
For the regular and extended latin-1 entries ('my_resource', 'Jalapeño'), URL namespace is basically 'normal' compute resource name, prepended with the id. The 'ñ' in Jalapeño gets converted to 'n' in the URL, but that's probably OK.

However, you'll note the entry which contains multibyte characters has only '<id>-' -- no strings after.

It doesn't /seem/ to cause real problems with usability here immediately, but it seems to me it could cause issues elsewhere.  Also, it'll possibly make eventually automating this code more difficult in QE since the URLs won't be created in a uniform manner.

Expected results:

Actually, I'm not sure whether we should be using the resource name in the URL at all -- ID alone might suffice, or perhaps some other sort of UUID along with it -- but whatever the case, we should be handling compute resource names in a sane, congruent manner.

Additional info:

Comment 1 Corey Welton 2013-10-24 14:33:42 UTC
It should be noted that this is handled differently in other areas of foreman, e.g., Architectures. Here, each string, regular ascii, extended latin-1 or multibyte -- appears 'correctly' in URL.

Comment 3 Dominic Cleal 2013-10-25 13:15:53 UTC
Ok, I'm going to flip this BZ around and say that compute resources are operating correctly, but the bug is in architectures etc.

The way it's intended to work is:

1. resources that have very restrictive name validation may use the name as a parameter
2. resources with more free-form text should use "id-name" and find the resource just based on the ID, then the name is run through .parameterize to ensure it contains plain ASCII chars (the stripping behaviour you see).

So we're not consistently calling .parameterize on all of our resource names, causing multibyte chars to appear in URLs, which they generally shouldn't.  The idea is that the URLs are then copy/paste safe etc, but give a hint to the user as to the resource name if possible.

As for automation, you can just use the ID and leave off the name portion.

Comment 4 Dominic Cleal 2013-10-25 13:17:11 UTC
*** Bug 1023137 has been marked as a duplicate of this bug. ***

Comment 5 Dominic Cleal 2013-11-13 12:01:53 UTC
Merged as 39558b7200a7e1d4d5976ee62e25491d9016e56f in develop.

As per comment #3, we've tried to make this "id-name" behaviour more consistent across the application but are retaining the behaviour to strip non-ASCII characters for URL safety.

Comment 9 Tazim Kolhar 2014-08-20 05:55:09 UTC
Created attachment 928623 [details]
Compute resource not found

# hammer -u admin -p *** compute-resource create --name  大傻瓜 -urrl qemu+tcp://localhost:16509/system --provider Libvirt
Compute resource created

In UI it shows Compute Resource not found

Comment 10 Tomas Strachota 2014-10-13 09:01:54 UTC
The problem got fixed with introduction of friendly_id:

commit 8b737c9c7648b3726dadb3b2e4708fcb43af02a8
Author: Joseph Magen <jmagen>
Date:   Tue Sep 23 12:02:52 2014 +0300

    fixes #4386 - gem friendly_id to simplify find by id, name, label, etc

Comment 11 Tazim Kolhar 2014-10-17 14:42:09 UTC
VERIFIED:


*** This bug is verified in upstream.  This fix should eventually land in future downstream builds ***

# rpm -qa | grep foreman
foreman-release-1.7.0-0.develop.201410150839gitb948163.el6.noarch
foreman-gce-1.7.0-0.develop.201410150839gitb948163.el6.noarch
foreman-selinux-1.7.0-0.develop.201409301113git2f345de.el6.noarch
rubygem-hammer_cli_foreman_tasks-0.0.3-2.201409091410gitc96619d.git.0.37f3704.el6.noarch
qe-foreman-rhel65.usersys.redhat.com-foreman-proxy-1.0-1.noarch
foreman-postgresql-1.7.0-0.develop.201410150839gitb948163.el6.noarch
qe-foreman-rhel65.usersys.redhat.com-qpid-broker-1.0-1.noarch
qe-foreman-rhel65.usersys.redhat.com-qpid-client-cert-1.0-1.noarch
foreman-1.7.0-0.develop.201410150839gitb948163.el6.noarch
foreman-ovirt-1.7.0-0.develop.201410150839gitb948163.el6.noarch
foreman-vmware-1.7.0-0.develop.201410150839gitb948163.el6.noarch
ruby193-rubygem-foreman_hooks-0.3.7-2.el6.noarch
ruby193-rubygem-foreman_discovery-1.4.0-0.1.rc4.el6.noarch
rubygem-hammer_cli_foreman-0.1.3-1.201410151235gitbc8c449.el6.noarch
ruby193-rubygem-foreman_bootdisk-4.0.0-1.el6.noarch
foreman-proxy-1.7.0-0.develop.201410101404git7961640.el6.noarch
qe-foreman-rhel65.usersys.redhat.com-puppet-client-1.0-1.noarch
qe-foreman-rhel65.usersys.redhat.com-foreman-client-1.0-1.noarch
qe-foreman-rhel65.usersys.redhat.com-apache-1.0-1.noarch
qe-foreman-rhel65.usersys.redhat.com-parent-cert-1.0-1.noarch
foreman-compute-1.7.0-0.develop.201410150839gitb948163.el6.noarch
ruby193-rubygem-foreman-tasks-0.6.10-1.el6.noarch
foreman-libvirt-1.7.0-0.develop.201410150839gitb948163.el6.noarch

Compute resource names are retained congruent manner

Comment 12 Tazim Kolhar 2014-10-17 14:43:00 UTC
Created attachment 947902 [details]
compute resource

Comment 13 Bryan Kearney 2015-01-09 14:48:49 UTC
Upstream bug assigned to ddolguik

Comment 14 Bryan Kearney 2015-08-11 13:36:04 UTC
This bug is slated to be released with Satellite 6.1.

Comment 15 errata-xmlrpc 2015-08-12 05:07:48 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-2015:1592


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