Description of problem: hammer package list with option environment and content-view-version-id raise an exception. root@sat ~]# hammer package list --content-view upmc-6.7-x86_64 --environment test --organization Redhat --content-view-version 16 ERROR: bind message supplies 2 parameters, but prepared statement "a124" requires 1 Version-Release number of selected component (if applicable): How reproducible: always Actual results: bind message supplies 2 parameters, but prepared statement "a124" requires 1 Expected results: should list packages of given content view version Additional info:
Hi Ranjan, Were you able to reproduce the issue described? Would it be possible to obtain the debug output from hammer? (e.g. -vd) In addition, the specific section of the production.log when the command is executed would be useful.
Created attachment 1214814 [details] Hammer log
Created attachment 1214815 [details] Production log
Hello Brad, Uploaded required log files.
Hi Ranjan, Looking at the hammer log, it appears that the package listing is being done on content view version with id=53. In that log, I also see it retrieve the list of versions (GET /katello/api/content_views/8/content_view_versions) and it looks like the following error may have been reported for that version: [0] "PLP0034: The distributor Redhat-Library-ranjan indicated a failed response when publishing repository Redhat-Library-ranjan." It is very likely that the package listing is failing due to the error publishing the version. Can you confirm that the content view version was published correctly?
Yes, content view was published correctly. This issue occurs only when the options environment-id is used. uploaded debug log with environment and without environment and screen shot of content view publish task.
Created attachment 1216851 [details] publish task
Created attachment 1216852 [details] latest debug log
Basically it seems that it doesn't like the --environment switch in the hammer command WORKING :- # hammer package list --content-view-id 11 --content-view-version-id 1 ------|--------------------------------------------- ID | FILENAME ------|--------------------------------------------- 4313 | 389-ds-base-1.3.1.6-25.el7.x86_64.rpm 5975 | 389-ds-base-1.3.1.6-26.el7_0.x86_64.rpm 16474 | 389-ds-base-1.3.3.1-13.el7.x86_64.rpm 9965 | 389-ds-base-1.3.3.1-13.el7.x86_64.rpm 1696 | 389-ds-base-1.3.3.1-15.el7_1.x86_64.rpm 332 | 389-ds-base-1.3.3.1-16.el7_1.x86_64.rpm 1219 | 389-ds-base-1.3.3.1-20.el7_1.x86_64.rpm 3191 | 389-ds-base-1.3.3.1-23.el7_1.x86_64.rpm 15391 | 389-ds-base-1.3.4.0-19.el7.x86_64.rpm 570 | 389-ds-base-1.3.4.0-19.el7.x86_64.rpm 7377 | 389-ds-base-1.3.4.0-21.el7_2.x86_64.rpm 3228 | 389-ds-base-1.3.4.0-26.el7_2.x86_64.rpm 7667 | 389-ds-base-1.3.4.0-29.el7_2.x86_64.rpm 10532 | 389-ds-base-1.3.4.0-30.el7_2.x86_64.rpm 18309 | 389-ds-base-1.3.4.0-32.el7_2.x86_64.rpm 18411 | 389-ds-base-1.3.4.0-33.el7_2.x86_64.rpm 21609 | 389-ds-base-1.3.5.10-11.el7.x86_64.rpm 20007 | 389-ds-base-1.3.5.10-11.el7.x86_64.rpm 19436 | 389-ds-base-1.3.5.10-12.el7_3.x86_64.rpm 20919 | 389-ds-base-1.3.5.10-15.el7_3.x86_64.rpm 8385 | 389-ds-base-libs-1.3.1.6-25.el7.x86_64.rpm 6227 | 389-ds-base-libs-1.3.1.6-26.el7_0.x86_64.rpm 17668 | 389-ds-base-libs-1.3.3.1-13.el7.x86_64.rpm 9412 | 389-ds-base-libs-1.3.3.1-13.el7.x86_64.rpm 3187 | 389-ds-base-libs-1.3.3.1-15.el7_1.x86_64.rpm 238 | 389-ds-base-libs-1.3.3.1-16.el7_1.x86_64.rpm 6996 | 389-ds-base-libs-1.3.3.1-20.el7_1.x86_64.rpm 4261 | 389-ds-base-libs-1.3.3.1-23.el7_1.x86_64.rpm 14221 | 389-ds-base-libs-1.3.4.0-19.el7.x86_64.rpm 7856 | 389-ds-base-libs-1.3.4.0-19.el7.x86_64.rpm ------|--------------------------------------------- NON-WORKING :- # hammer package list --content-view-id 11 --content-view-version-id 1 --environment Library --organization-id 1 ERROR: bind message supplies 2 parameters, but prepared statement "a42" requires 1
Created redmine issue http://projects.theforeman.org/issues/20046 from this bug
PR just merged upstream, moving to POST.
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/20046 has been resolved.
Failed QA: katello-3.4.4-2.el7sat.noarch tfm-rubygem-katello-3.4.4-1.el7sat.noarch Initial PR that marked as one that resolving current defect: https://github.com/Katello/hammer-cli-katello/pull/501 In its description next problem is mentioned: $ hammer package list --organization-id 1 Error: found more than one repository It is fixed properly: hammer -v -u admin -p changeme package list --organization-id='3' ------|-------------------------------|--------------------------- ID | FILENAME | SOURCE RPM ------|-------------------------------|--------------------------- 22032 | bear-4.1-1.noarch.rpm | bear-4.1-1.src.rpm 22041 | camel-0.1-1.noarch.rpm | camel-0.1-1.src.rpm 22038 | cat-1.0-1.noarch.rpm | cat-1.0-1.src.rpm 22029 | cheetah-1.25.3-5.noarch.rpm | cheetah-1.25.3-5.src.rpm ... But problem in current BZ and in http://projects.theforeman.org/issues/20046 is not fixed: hammer package list --content-view upmc-6.7-x86_64 --environment test --organization Redhat --content-view-version 16 Error: Unrecognised option '--content-view' hammer package list --organization "Default Organization" --environment dev --content-view-version "1.0" Error: found more than one content_view_version hammer -v -u admin -p changeme package list --content-view-version="1.0" environment-id="3" [ERROR 2017-08-07 15:07:02 Exception] Error: too many arguments hammer -v -u admin -p changeme package list --content-view-version="1.0" organization-id='3' [ERROR 2017-08-07 15:07:48 Exception] Error: too many arguments hammer -v -u admin -p changeme package list --content-view-version="1.0" organization='hT5SCE' [ERROR 2017-08-07 15:08:11 Exception] Error: too many arguments
I linked Foreman issue 20091. It is required along with 20046 to fix this issue.
*** Bug 1410243 has been marked as a duplicate of this bug. ***
Running command with no pagination may take a while but it does return all packages. Here's a sample: # hammer package list --organization 'São Paulo' --content-view rhel-7-server-x86_64-cv --environment Library --content-view-version '1.0' ------|----------------------------------------------------------------------------------|------------------------------------------------------------------------------ ID | FILENAME | SOURCE RPM ------|----------------------------------------------------------------------------------|------------------------------------------------------------------------------ 62949 | 389-ds-base-1.3.1.6-25.el7.x86_64.rpm | 389-ds-base-1.3.1.6-25.el7.src.rpm 71998 | 389-ds-base-1.3.1.6-26.el7_0.x86_64.rpm | 389-ds-base-1.3.1.6-26.el7_0.src.rpm 55972 | 389-ds-base-1.3.3.1-13.el7.x86_64.rpm | 389-ds-base-1.3.3.1-13.el7.src.rpm 65121 | 389-ds-base-1.3.3.1-15.el7_1.x86_64.rpm | 389-ds-base-1.3.3.1-15.el7_1.src.rpm 64742 | 389-ds-base-1.3.3.1-16.el7_1.x86_64.rpm | 389-ds-base-1.3.3.1-16.el7_1.src.rpm 80874 | 389-ds-base-1.3.3.1-20.el7_1.x86_64.rpm | 389-ds-base-1.3.3.1-20.el7_1.src.rpm 68149 | 389-ds-base-1.3.3.1-23.el7_1.x86_64.rpm | 389-ds-base-1.3.3.1-23.el7_1.src.rpm 63199 | 389-ds-base-1.3.4.0-19.el7.x86_64.rpm | 389-ds-base-1.3.4.0-19.el7.src.rpm 63353 | 389-ds-base-1.3.4.0-21.el7_2.x86_64.rpm | 389-ds-base-1.3.4.0-21.el7_2.src.rpm 67915 | 389-ds-base-1.3.4.0-26.el7_2.x86_64.rpm | 389-ds-base-1.3.4.0-26.el7_2.src.rpm Pagination also works: # hammer package list --organization 'São Paulo' --content-view rhel-7-server-x86_64-cv --environment Library --content-view-version '1.0' --per-page 10 --page 1 ------|-----------------------------------------|------------------------------------- ID | FILENAME | SOURCE RPM ------|-----------------------------------------|------------------------------------- 62949 | 389-ds-base-1.3.1.6-25.el7.x86_64.rpm | 389-ds-base-1.3.1.6-25.el7.src.rpm 71998 | 389-ds-base-1.3.1.6-26.el7_0.x86_64.rpm | 389-ds-base-1.3.1.6-26.el7_0.src.rpm 55972 | 389-ds-base-1.3.3.1-13.el7.x86_64.rpm | 389-ds-base-1.3.3.1-13.el7.src.rpm 65121 | 389-ds-base-1.3.3.1-15.el7_1.x86_64.rpm | 389-ds-base-1.3.3.1-15.el7_1.src.rpm 64742 | 389-ds-base-1.3.3.1-16.el7_1.x86_64.rpm | 389-ds-base-1.3.3.1-16.el7_1.src.rpm 80874 | 389-ds-base-1.3.3.1-20.el7_1.x86_64.rpm | 389-ds-base-1.3.3.1-20.el7_1.src.rpm 68149 | 389-ds-base-1.3.3.1-23.el7_1.x86_64.rpm | 389-ds-base-1.3.3.1-23.el7_1.src.rpm 63199 | 389-ds-base-1.3.4.0-19.el7.x86_64.rpm | 389-ds-base-1.3.4.0-19.el7.src.rpm 63353 | 389-ds-base-1.3.4.0-21.el7_2.x86_64.rpm | 389-ds-base-1.3.4.0-21.el7_2.src.rpm 67915 | 389-ds-base-1.3.4.0-26.el7_2.x86_64.rpm | 389-ds-base-1.3.4.0-26.el7_2.src.rpm ------|-----------------------------------------|------------------------------------- Page 1 of 2255 (use --page and --per-page for navigation) # hammer package list --organization 'São Paulo' --content-view rhel-7-server-x86_64-cv --environment Library --content-view-version '1.0' --per-page 10 --page 2253 ------|------------------------------------|---------------------------- ID | FILENAME | SOURCE RPM ------|------------------------------------|---------------------------- 59049 | zlib-devel-1.2.7-13.el7.i686.rpm | zlib-1.2.7-13.el7.src.rpm 42811 | zlib-devel-1.2.7-13.el7.x86_64.rpm | zlib-1.2.7-13.el7.src.rpm 77631 | zlib-devel-1.2.7-15.el7.x86_64.rpm | zlib-1.2.7-15.el7.src.rpm 65132 | zlib-devel-1.2.7-15.el7.i686.rpm | zlib-1.2.7-15.el7.src.rpm 68660 | zlib-devel-1.2.7-17.el7.i686.rpm | zlib-1.2.7-17.el7.src.rpm 50089 | zlib-devel-1.2.7-17.el7.x86_64.rpm | zlib-1.2.7-17.el7.src.rpm 18447 | zlib-devel-1.2.7-17.el7.i686.rpm | zlib-1.2.7-17.el7.src.rpm 11366 | zlib-devel-1.2.7-17.el7.x86_64.rpm | zlib-1.2.7-17.el7.src.rpm 38928 | zsh-5.0.2-7.el7.x86_64.rpm | zsh-5.0.2-7.el7.src.rpm 57610 | zsh-5.0.2-7.el7_1.1.x86_64.rpm | zsh-5.0.2-7.el7_1.1.src.rpm ------|------------------------------------|---------------------------- Page 2253 of 2255 (use --page and --per-page for navigation)
Verified on satellite-6.3.0-21.0.beta.el7sat.noarch
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-2018:0336