Bug 786438

Summary: [package info] failure - 705: unexpected token at 'null'
Product: Red Hat Satellite Reporter: Garik Khachikyan <gkhachik>
Component: katello-agentAssignee: Tomas Strachota <tstrachota>
Status: CLOSED CURRENTRELEASE QA Contact: Sachin Ghai <sghai>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.0CC: hbrock, mkoci, sghai, tstrachota
Target Milestone: UnspecifiedKeywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: katello-0.1.227-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-08-22 18:24:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Garik Khachikyan 2012-02-01 13:05:24 UTC
Description of problem:
Doing package info --repo zoo-x86_64 --product zoo-18 --id wolf fails.
Error is:
---
705: unexpected token at 'null'

Version-Release number of selected component (if applicable):
katello-0.1.208-1.git.0.93b84c2.el6.noarch
katello-cli-0.1.49-1.git.0.6962a71.el6.noarch
pulp-0.0.263-1.el6.noarch


How reproducible:
always in recent versions

Steps to Reproduce:
1.create provider=zoo
2.create product=zoo-18
3.create repo=zoo-x86_64 (url: http://inecas.fedorapeople.org/fakerepos/cds/content/zoo/18/x86_64/rpms/)
4. sync the repo
5. invoke: package info --repo zoo-x86_64 --product zoo-18 --id wolf
  
Actual results:
exception above

Expected results:
no error, result of package info should be shown

Additional info:
Traceback in katello/production.log:
---

Started GET "/katello//api/repositories/9/packages/wolf" for 127.0.0.1 at Wed Feb 01 14:06:10 +0100 2012
  Processing by Api::PackagesController#show as JSON
  Parameters: {"repository_id"=>"9", "id"=>"wolf"}
JSON::ParserError: 705: unexpected token at 'null'
/usr/lib/ruby/gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:in `parse'
/usr/lib/ruby/gems/1.8/gems/json-1.4.6/lib/json/common.rb:146:in `parse'
/usr/share/katello/lib/resources/pulp.rb:89:in `find'
/usr/share/katello/app/controllers/api/packages_controller.rb:47:in `find_package'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:448:in `_run__2076619623__process_action__416302193__callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:221:in `_conditional_callback_around_2762'
/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_2762'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:441:in `_run__2076619623__process_action__416302193__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'

(...and more)

Comment 1 Garik Khachikyan 2012-02-01 13:10:13 UTC
huh: one need to specify the *exact* ID of the package (do the package list in advance).

Otherwise: this error.

Package id is something like: 8dee4215-1b7a-438e-89cc-7b3347fd6eb8

Comment 2 Tomas Strachota 2012-02-08 12:13:21 UTC
I changed the error message in katello-0.1.227-1 to be "Package with id 'XXX' not found".

Selecting packages by name is a feature request. I'm lowering the priority to medium.

Comment 3 Tomas Strachota 2012-02-22 14:10:55 UTC
I created new RFE bug for supporting search by names in package info: 796220

Putting this one on qa.

Comment 4 Sachin Ghai 2012-03-19 11:02:15 UTC
verified with following CFSE build.

[root@perceptor ~]# rpm -qa | grep -ie katello-0 -ie katello-cli
katello-0.1.304-1.el6.noarch
katello-cli-common-0.1.105-1.el6.noarch
katello-cli-0.1.105-1.el6.noarch

Error message has been changed as below:
====================
katello> package info --repo pulp_64 --product pulp --id grinder --org sghai
Package with id 'grinder' not found


katello> package info --repo pulp_64 --product pulp --id a098d845-811f-4530-a5f0-1dd18e0e02a1 --org sghai
--------------------------------------------------------------------------------
                              Package Information
--------------------------------------------------------------------------------

Id:           a098d845-811f-4530-a5f0-1dd18e0e02a1
Name:         grinder
Filename:     grinder-0.0.138-1.el6.noarch.rpm
Arch:         noarch
Release:      1.el6
Version:      0.0.138
Vendor:       
Download Url: https://perceptor.lab.eng.pnq.redhat.com//pulp/repos/sghai/Library/custom/pulp/pulp_64/grinder-0.0.138-1.el6.noarch.rpm
Description:
    A tool for synchronizing content such as packages, distributions, and
    errata from yum repositories.
Provides:
    grinder
    config(grinder)
Requires:
    python-hashlib
    python(abi)
    nss
    python
    PyYAML
    curl
    python-pycurl
    /usr/bin/python
    createrepo

katello>

Comment 7 Hayk Hovsepyan 2012-12-05 11:47:58 UTC
Automated in method: "com.redhat.qe.katello.tests.cli.PackageTests.test_packageSearch()".