Bug 859330

Summary: Exception when Creating snapshot tag
Product: [Community] Spacewalk Reporter: paul.wickham
Component: ServerAssignee: Michael Mráka <mmraka>
Status: CLOSED DUPLICATE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 1.7CC: jpazdziora
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-09-21 13:39:04 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 871344    

Description paul.wickham 2012-09-21 07:30:33 UTC
Description of problem:


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

Spacewalk-1.7 

How reproducible:
Every time



Steps to Reproduce:
1. In spacewalk gui, navigate to Systems>System Name>Provisioning>Snapshot>Snapshot Tags>Create New System Tag>Enter Tag name>Tag Current Snapshot

  
Actual results:
Server gives 500 execption and emails log:
The following exception occurred while executing this request:
 POST /network/systems/details/history/snapshots/add_system_tag.pxt HTTP/1.1 (from browser)  /network/systems/details/history/snapshots/add_system_tag.pxt (from Apache)

Date:
  Fri Sep 21 17:19:51 2012

Headers:
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Encoding: gzip, deflate
  Accept-Language: en-us,en;q=0.5
  Connection: keep-alive
  Content-Length: 59
  Content-Type: application/x-www-form-urlencoded
  Cookie: pxt-session-cookie=25195x0c1dfb9e64e4ab61a47b7dfc0ee23250
  Host: spacewalk
  Referer: https://spacewalk/network/systems/details/history/snapshots/add_system_tag.pxt?sid=1000010201
  User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1

Form variables:
  pxt:trap => rhn:add_system_tag_cb
  sid => 1000010201
  tag => Hello

User Information:
  User AWickhaPa (id 112, org_id 1)

Error notes:
  (none)

Initial Request:
  Yes

Error message:
  RHN::Exception: DBD::Pg::st execute failed: ERROR:  function quote_literal(numeric, unknown) does not exist at character 120
HINT:  No function matches the given name and argument types. You might need to add explicit type casts.
QUERY:  SELECT  pg_dblink_exec( 'insert into rhnTag(id, org_id, name_id) values (' ||  $1  || ', ' ||  $2  || ', ' || coalesce(quote_literal(lookup_tag_name( $3 ), 'NULL')) || ')')
CONTEXT:  PL/pgSQL function "lookup_tag" line 13 at PERFORM SQL statement "insert into rhnSnapshotTag (snapshot_id, server_id, tag_id) select  $1 , server_id, lookup_tag( $2 ,  $3 ) from rhnSnapshot where id =  $1 "
PL/pgSQL function "tag_snapshot" line 2 at SQL statement

  RHN::DB /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm 121 RHN::Exception::DB::throw
  RHN::DB::db /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm 355 RHN::DB::handle_error
  RHN::DB::db /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB.pm 319 RHN::DB::db::call_function
  RHN::DB::SystemSnapshot /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB/SystemSnapshot.pm 233 RHN::DB::db::call_procedure
  RHN::DB::Server /usr/lib/perl5/vendor_perl/5.8.8/RHN/DB/Server.pm 454 RHN::DB::SystemSnapshot::add_tag_to_snapshot
  Sniglets::Snapshot /usr/lib/perl5/vendor_perl/5.8.8/Sniglets/Snapshot.pm 247 RHN::DB::Server::add_system_tag
  Sniglets::Snapshot /usr/lib/perl5/vendor_perl/5.8.8/Sniglets/Snapshot.pm 246 (eval)
  PXT::ApacheHandler /usr/lib/perl5/vendor_perl/5.8.8/PXT/ApacheHandler.pm 482 Sniglets::Snapshot::add_system_tag_cb
  PXT::ApacheHandler /usr/lib/perl5/vendor_perl/5.8.8/PXT/ApacheHandler.pm 103 PXT::ApacheHandler::pxt_parse_data
  PXT::ApacheHandler /usr/lib/perl5/vendor_perl/5.8.8/PXT/ApacheHandler.pm 103 (eval)
  main -e 0 PXT::ApacheHandler::handler
  main -e 0 (eval)



Expected results:
Current Snapshot is tagged

Additional info:

Also unable to delete snapshots:

The following exception occurred while executing this request:
 POST /network/systems/details/history/snapshots/remove_confirm.pxt HTTP/1.1 (from browser)  /network/systems/details/history/snapshots/remove_confirm.pxt (from Apache)

Date:
  Fri Sep 21 17:12:28 2012

Headers:
  Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  Accept-Encoding: gzip, deflate
  Accept-Language: en-us,en;q=0.5
  Connection: keep-alive
  Content-Length: 485
  Content-Type: application/x-www-form-urlencoded
  Cookie: pxt-session-cookie=25195x0c1dfb9e64e4ab61a47b7dfc0ee23250
  Host: spacewalk
  Referer: https://spacewalk/network/systems/details/history/snapshots/remove_confirm.pxt?sid=1000010201&set_label=removable_snapshot_tag_list
  User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:15.0) Gecko/20100101 Firefox/15.0.1

Form variables:
  alphabar_column =>
  first_lower => 1
  first_upper => 25
  formvars => set_label
  formvars => set_label
  formvars => set_label
  last_lower => 1
  last_upper => 1
  list_action_label_confirm_snapshot_tag_removal => Confirm
  list_action_url_confirm_snapshot_tag_removal => /network/systems/details/history/snapshots/system_tags.pxt
  list_mode => snapshot_tags_in_set
  lower => 1
  next_lower => 1
  next_upper => 1
  prev_lower => 1
  prev_upper => 25
  pxt:trap => rhn:general_list_cb
  set_label => removable_snapshot_tag_list
  sid => 1000010201
  upper => 1

User Information:
  User AWickhaPa (id 112, org_id 1)

Error notes:
  (none)

Initial Request:
  Yes

Error message:
  Please use DBI functions for transaction handling at /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi/DBD/Pg.pm line 190.

Comment 1 Jan Pazdziora 2012-09-21 13:35:34 UTC
Fixing product, moving to Spacewalk.

Comment 2 Jan Pazdziora 2012-09-21 13:38:33 UTC
Fixed in Spacewalk master, 5b0ecc46bd12c14a68ed8450f65d06b79a85e343.

Comment 3 Jan Pazdziora 2012-09-21 13:39:04 UTC

*** This bug has been marked as a duplicate of bug 803370 ***