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
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?
(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.
spacewalk.git master: 6cd7d4d03d1e0a29c320619a80e6b8bb80507b6c 09267c86b26ca550c1bdfac1ca21d26ea11b1899 b6dc4c1de89c2092c5a5fe70472595d78c0b1ca9
This is Spacewalk bugzilla -- could we have it public?
*** Bug 859330 has been marked as a duplicate of this bug. ***
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18