Bug 803370 - ISE on creating Snapshot Tag in WebUI
ISE on creating Snapshot Tag in WebUI
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: WebUI (Show other bugs)
1.7
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Milan Zazrivec
Red Hat Satellite QA List
:
: 859330 (view as bug list)
Depends On:
Blocks: 820204 space18
  Show dependency treegraph
 
Reported: 2012-03-14 11:06 EDT by Matej Kollar
Modified: 2015-07-26 18:20 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 820204 (view as bug list)
Environment:
Last Closed: 2012-11-01 12:17:59 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Matej Kollar 2012-03-14 11:06:31 EDT
Description of problem:

  Trying to create snapshot tag leads to ISE, producing ugly traceback in Apache error_log.

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

  Spacewalk 1.7
  (Reproduced also on nightly)

How reproducible: always/deterministic

Steps to Reproduce:

  1. Register client, add Provisioning entitlement
  2. Under Provisioning -> Snapshot Tags, create new system tag.
  3. Fill in some tag name, Tag Current Snapshot
  
Actual results:

  ISE, in error log

    [Dow Mth dd hh:mm:ss yyyy] [error] Execution of /var/www/html/network/systems/details/history/snapshots/add_system_tag.pxt failed at Dow Mth dd hh:mm:ss yyyy: RHN::Exception: DBD::Pg::st execute failed: ERROR:  function quote_literal(numeric, unknown) does not exist\nLINE 1: ...es (' ||  $1  || ', ' ||  $2  || ', ' || coalesce(quote_lite...\n                                                             ^\nHINT:  No function matches the given name and argument types. You might need to add explicit type casts.\nQUERY:  SELECT  pg_dblink_exec( 'insert into rhnTag(id, org_id, name_id) values (' ||  $1  || ', ' ||  $2  || ', ' || coalesce(quote_literal(lookup_tag_name( $3 ), 'NULL')) || ')')\nCONTEXT:  PL/pgSQL function "lookup_tag" line 13 at PERFORM\nSQL statement "insert into rhnSnapshotTag (snapshot_id, server_id, tag_id) select  $1 , server_id, lookup_tag( $2 ,  $3 ) from rhnSnapshot where id =  $1 "\nPL/pgSQL function "tag_snapshot" line 2 at SQL statement\n  RHN::DB /usr/share/perl5/vendor_perl/RHN/DB.pm 121 RHN::Exception::DB::throw\n  RHN::DB::db /usr/share/perl5/vendor_perl/RHN/DB.pm 355 RHN::DB::handle_error\n  RHN::DB::db /usr/share/perl5/vendor_perl/RHN/DB.pm 319 RHN::DB::db::call_function\n  RHN::DB::SystemSnapshot /usr/share/perl5/vendor_perl/RHN/DB/SystemSnapshot.pm 233 RHN::DB::db::call_procedure\n  RHN::DB::Server /usr/share/perl5/vendor_perl/RHN/DB/Server.pm 454 RHN::DB::SystemSnapshot::add_tag_to_snapshot\n  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 247 RHN::DB::Server::add_system_tag\n  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 246 (eval)\n  PXT::ApacheHandler /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 482 Sniglets::Snapshot::add_system_tag_cb\n  PXT::ApacheHandler /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 103 PXT::ApacheHandler::pxt_parse_data\n  PXT::ApacheHandler /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 103 (eval)\n  main -e 0 PXT::ApacheHandler::handler\n  main -e 0 (eval)

Expected results:

  Tag is created
Comment 2 Jan Pazdziora 2012-03-14 11:20:21 EDT
Milan, since lookup_tag_name is defined as returns numeric, do we need to quote_literal at all in

           coalesce(quote_literal(lookup_tag_name(name_in), 'NULL')) || ')');

? Or the whole coalesce?
Comment 3 Milan Zazrivec 2012-03-14 13:33:19 EDT
(In reply to comment #2)
> Milan, since lookup_tag_name is defined as returns numeric, do we need to
> quote_literal at all in
> 
>            coalesce(quote_literal(lookup_tag_name(name_in), 'NULL')) || ')');
> 
> ? Or the whole coalesce?

I think the problem here is caused by a syntax error in quote_literal.

The line should correctly read:

    coalesce(quote_literal(lookup_tag_name(name_in)), 'NULL')


Although we can certainly discuss whether or not is the quote_literal()
actually needed here.
Comment 7 Milan Zazrivec 2012-06-06 10:51:19 EDT
spacewalk.git master:

6cd7d4d03d1e0a29c320619a80e6b8bb80507b6c
09267c86b26ca550c1bdfac1ca21d26ea11b1899
b6dc4c1de89c2092c5a5fe70472595d78c0b1ca9
Comment 8 Jan Pazdziora 2012-06-15 10:00:46 EDT
This is Spacewalk bugzilla -- could we have it public?
Comment 9 Jan Pazdziora 2012-09-21 09:39:04 EDT
*** Bug 859330 has been marked as a duplicate of this bug. ***
Comment 10 Jan Pazdziora 2012-10-30 15:22:57 EDT
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Comment 11 Jan Pazdziora 2012-11-01 12:17:59 EDT
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18

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