Bug 859329 - [CFSE GUI] Unexpected code is displayed in the error message when uploading an empty file or no gpg file to GPG Key.
[CFSE GUI] Unexpected code is displayed in the error message when uploading a...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: WebUI (Show other bugs)
6.0.1
x86_64 Linux
high Severity high (vote)
: Unspecified
: --
Assigned To: David Davis
Sachin Ghai
: Reopened, Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-21 03:24 EDT by Lijun Li
Modified: 2014-09-18 11:32 EDT (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
uploading an empty file or no GPG file to GPG Key produces unexpected code in the error message. This raised an error ("Content can't be blank") without throwing any UI exception. This fix corrects the error message, which displays without unexpected code.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-04 14:56:08 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Unexpected code is displayed in the error message when uploading an empty file or no gpg file to GPG Key (85.36 KB, image/png)
2012-09-21 03:26 EDT, Lijun Li
no flags Details
importing a blank gpg key file raised 'Content can't be blank' (47.27 KB, image/png)
2012-10-17 09:44 EDT, Sachin Ghai
no flags Details

  None (edit)
Description Lijun Li 2012-09-21 03:24:49 EDT
Description of problem:
Unexpected code is displayed in the error message when uploading an empty file or no gpg file to GPG Key

Version-Release number of selected component (if applicable):
katello-1.1.12-7.el6cf.noarch
katello-cli-1.1.8-4.el6cf.noarch

How reproducible:
100%

Steps to Reproduce:
1. Install latest CloudForms System Engine build.
2. Log in CFSE.
3. Click the Content->Repositories->GPG Keys application subtab
4. Click New GPG Key, type name and click Browse to upload an empty file or no gpg file.
5. Click Upload.

  
Actual results:
Unexpected code is displayed in the error message when uploading an empty file or no gpg file to GPG Key

Expected results:
Should have an error message without the unexpected code page to say cannot upload empty file or no gpg file to GPG Keys.

Additional info:
Comment 1 Lijun Li 2012-09-21 03:26:10 EDT
Errors::UserNotSet in Gpg_keys#create

Showing /usr/share/katello/app/views/layouts/katello.haml where line #24 raised:

current user is not set

Extracted source (around line #24):

21:       = yield
22:   - else
23:     %nav.subnav#subnav
24:       = render_main_sub_menu
25:     .inner.container_16
26:       = yield
27: 

Rails.root: /usr/share/katello

Also please refer to the attached screenshot.
Comment 2 Lijun Li 2012-09-21 03:26:54 EDT
Created attachment 615295 [details]
Unexpected code is displayed in the error message when uploading an empty file or no gpg file to GPG Key
Comment 3 Lijun Li 2012-09-21 03:29:20 EDT
OR Steps to Reproduce:
1. Install latest CloudForms System Engine build.
2. Log in CFSE.
3. Click the Content->Repositories->GPG Keys application subtab
4. Click New GPG Key, click Upload button directly.
Comment 5 David Davis 2012-10-04 11:45:58 EDT
Hmm. I get the following when I click Upload with no gpg key or a blank file:

Validation Failed:
Name can't be blank
Name must contain at least 2 characters
Content can't be blank

It could either be:

1. This has since been fixed.
2. This may be only happening in certain browsers.

Can you retest and if it's still happening, let me know what browser you're using? 

Thank you!
Comment 9 David Davis 2012-10-05 13:34:37 EDT
So it looks like the original error is related to #829437 as the stacktrace is the same.

I'll take a look into uploading an empty file though.
Comment 10 David Davis 2012-10-05 13:59:40 EDT
I can't reproduce on the SE 1.1 branch. I'm trying Puddle #1 next.
Comment 12 David Davis 2012-10-08 08:29:19 EDT
Oh, I was able to reproduce uploading a non-gpgkey file and have not had a problem doing that or received any validation regarding that.
Comment 13 David Davis 2012-10-08 08:30:37 EDT
Tried with existing gpg keys--still received expected error validation message.
Comment 15 Og Maciel 2012-10-09 17:33:34 EDT
Should have provided better steps to reproduce this, my bad.

* Import a non-GPG key file (could be a text file
  * You should now see the contents from that text file displayed
* Create an empty file:  touch /tmp/foo
* From the Details tab, now try to import /tmp/foo

You should see the web ui all mangled and a javascript (assuming you're running firebug or equivalent)
Comment 16 David Davis 2012-10-09 17:36:16 EDT
Og, your steps were clear. I went through your steps and wasn't able to reproduce though. I didn't get a mangled UI or a javascript error. I'll reopen though and I'll try taking a look again tomorrow.
Comment 17 Mike McCune 2012-10-09 17:40:45 EDT
re-opening since I can reproduce reliably.

as Og mentions above the error condition only occurs if you re-upload a blank key file to an *existing* GPG key.

It detects the blank condition on the 1st upload but the 2nd upload will fail with the strange error
Comment 18 Mike McCune 2012-10-09 17:43:22 EDT
another screenshot that I got after re-uploading a blank file to an already existing GPG key:

http://mmccune.fedorapeople.org/scratch/busted-gpg.png
Comment 19 David Davis 2012-10-09 18:06:28 EDT
how exactly do you re-open an open bug?
Comment 20 Og Maciel 2012-10-09 18:10:51 EDT
It is already ASSIGNED so you're good to go :)
Comment 21 David Davis 2012-10-09 18:37:13 EDT
Opened pull request although I'm having an issue with notify.js:

https://github.com/Katello/katello/pull/823
Comment 22 David Davis 2012-10-10 12:05:17 EDT
Katello commits:

4c5cc6635713e64fde0f552ff91e781690bc1afa
27f2807cd650edf23ea2b3f53f9acebc2ee4fafd

Test fixes:

eff04a8b2fac2858269dd9a5399155ef5f3dfa7c
c8cb4df1958a24b75dc52f418ce4854ec44ff102
Comment 25 Sachin Ghai 2012-10-17 09:43:25 EDT
Verified this defect with following CFSE build:

katello-configure-1.1.9-7.el6cf.noarch
katello-common-1.1.12-16.el6cf.noarch
katello-1.1.12-16.el6cf.noarch
katello-candlepin-cert-key-pair-1.0-1.noarch
katello-cli-1.1.8-7.el6cf.noarch
katello-certs-tools-1.1.8-1.el6cf.noarch
katello-glue-candlepin-1.1.12-16.el6cf.noarch
katello-qpid-broker-key-pair-1.0-1.noarch
katello-cli-common-1.1.8-7.el6cf.noarch
katello-glue-pulp-1.1.12-16.el6cf.noarch
katello-qpid-client-key-pair-1.0-1.noarch
katello-selinux-1.1.1-1.el6cf.noarch
katello-all-1.1.12-16.el6cf.noarch


Re-importing a blank gpg-key file, when one gpgkey is already imported in UI, raised an error "Content can't be blank" without throwing any UI exception. Please see the attachment in next comment.

However UI successfully imports any dummy text file with some random text so I'll log a separate defect for this.
Comment 26 Sachin Ghai 2012-10-17 09:44:54 EDT
Created attachment 628825 [details]
importing a blank gpg key file raised 'Content can't be blank'
Comment 27 Sachin Ghai 2012-11-06 09:42:53 EST
verified as per comment25.
Comment 29 errata-xmlrpc 2012-12-04 14:56:08 EST
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
Comment 30 Mike McCune 2013-08-16 13:59:53 EDT
getting rid of 6.0.0 version since that doesn't exist

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