Bug 803370 - ISE on creating Snapshot Tag in WebUI
Summary: ISE on creating Snapshot Tag in WebUI
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Spacewalk
Classification: Community
Component: WebUI
Version: 1.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Milan Zázrivec
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
: 859330 (view as bug list)
Depends On:
Blocks: 820204 space18
TreeView+ depends on / blocked
 
Reported: 2012-03-14 15:06 UTC by Matej Kollar
Modified: 2015-07-26 22:20 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
: 820204 (view as bug list)
Environment:
Last Closed: 2012-11-01 16:17:59 UTC
Embargoed:


Attachments (Terms of Use)

Description Matej Kollar 2012-03-14 15:06:31 UTC
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 (Red Hat) 2012-03-14 15:20:21 UTC
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 Zázrivec 2012-03-14 17:33:19 UTC
(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 Zázrivec 2012-06-06 14:51:19 UTC
spacewalk.git master:

6cd7d4d03d1e0a29c320619a80e6b8bb80507b6c
09267c86b26ca550c1bdfac1ca21d26ea11b1899
b6dc4c1de89c2092c5a5fe70472595d78c0b1ca9

Comment 8 Jan Pazdziora (Red Hat) 2012-06-15 14:00:46 UTC
This is Spacewalk bugzilla -- could we have it public?

Comment 9 Jan Pazdziora (Red Hat) 2012-09-21 13:39:04 UTC
*** Bug 859330 has been marked as a duplicate of this bug. ***

Comment 10 Jan Pazdziora (Red Hat) 2012-10-30 19:22:57 UTC
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 (Red Hat) 2012-11-01 16:17:59 UTC
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.