Bug 851033 - when rolling back a package "'500 Error - Internal Server Error""
when rolling back a package "'500 Error - Internal Server Error""
Status: CLOSED CURRENTRELEASE
Product: Spacewalk
Classification: Community
Component: WebUI (Show other bugs)
1.7
x86_64 Linux
unspecified Severity urgent
: ---
: ---
Assigned To: Tomas Lestach
Red Hat Satellite QA List
:
Depends On:
Blocks: space18
  Show dependency treegraph
 
Reported: 2012-08-23 02:41 EDT by Sebastian
Modified: 2012-11-01 12:21 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-01 12:21:19 EDT
Type: Bug
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 Sebastian 2012-08-23 02:41:22 EDT
Description of problem:
when rolling back a package "'500 Error - Internal Server Error""

Version-Release number of selected component (if applicable):
spacewalk-postgresql-1.7.3-1.el6.noarch
postgresql-server-8.4.12-1.el6_2.x86_64


How reproducible:


Steps to Reproduce:
1.Newly install Rhel 6 server
2.Newly install postgres
3.yum update package on client
4.Attempt to roll back.
  
Actual results:
Returns the following error 
"'500 Error - Internal Server Error""
Expected results:


Additional info:
/var/log/httpd/error_log:
[error] Execution of /var/www/html/network/systems/details/history/snapshots/rollback.pxt failed at Mon Aug 20 10:07:52 2012: RHN::Exception: DBD::Pg::st execute failed: ERROR:  inconsistent types deduced for parameter $1\nLINE 4:   ($1, 'delta-' || $1)\n           ^\nDETAIL:  text versus numeric\n  RHN::DB /usr/share/perl5/vendor_perl/RHN/DB.pm 121 RHN::Exception::DB::throw\n  RHN::DB::st /usr/share/perl5/vendor_perl/RHN/DB.pm 452 RHN::DB::handle_error\n  RHN::DB::Scheduler /usr/share/perl5/vendor_perl/RHN/DB/Scheduler.pm 1255 RHN::DB::st::execute_h\n  RHN::DB::SystemSnapshot /usr/share/perl5/vendor_perl/RHN/DB/SystemSnapshot.pm 404 RHN::DB::Scheduler::schedule_package_sync\n  RHN::DB::SystemSnapshot /usr/share/perl5/vendor_perl/RHN/DB/SystemSnapshot.pm 352 (eval)\n  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 301 RHN::DB::SystemSnapshot::rollback_to_snapshot\n  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 300 (eval)\n  PXT::ApacheHandler /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 482 Sniglets::Snapshot::system_snapshot_rollback_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)
Comment 1 Tomas Lestach 2012-08-23 04:04:35 EDT
This has already been fixed by TomasK ...

spacewalk.git: a10f88192e6564a594087ca1fc182779e0da9612
Comment 2 Sebastian 2012-08-23 05:28:44 EDT
Hi Tomas

After update 
RHN/DB/Scheduler.pm
@@ -1250,7 +1250,7 @@ EOS
 INSERT INTO rhnPackageDelta
   (id, label)
 VALUES
-  (:id, 'delta-' || :id)
+  (cast(:id as numeric), 'delta-' || :id)
 EOS
   $sth->execute_h(id => $delta_id);

I'm getting the following error

[error] Execution of /var/www/html/network/systems/details/history/snapshots/rollback.pxt failed at Thu Aug 23 11:24:22 2012: RHN::Exception: DBD::Pg::db do failed: ERROR:  no such savepoint\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 185 RHN::DB::handle_error\n  RHN::DB::SystemSnapshot /usr/share/perl5/vendor_perl/RHN/DB/SystemSnapshot.pm 458 RHN::DB::db::rollback\n  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 301 RHN::DB::SystemSnapshot::rollback_to_snapshot\n  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 300 (eval)\n  PXT::ApacheHandler /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 482 Sniglets::Snapshot::system_snapshot_rollback_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)
[Thu Aug 23 11:24:22 2012] [error] Traceback sent to MidrangeLinux@fnb.co.za at /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm line 563.
Comment 3 Sebastian 2012-08-23 06:41:27 EDT
(In reply to comment #1)
> This has already been fixed by TomasK ...
> 
> spacewalk.git: a10f88192e6564a594087ca1fc182779e0da9612

Hi Tomas

After update 
RHN/DB/Scheduler.pm
@@ -1250,7 +1250,7 @@ EOS
 INSERT INTO rhnPackageDelta
   (id, label)
 VALUES
-  (:id, 'delta-' || :id)
+  (cast(:id as numeric), 'delta-' || :id)
 EOS
   $sth->execute_h(id => $delta_id);

I'm getting the following error

[error] Execution of /var/www/html/network/systems/details/history/snapshots/rollback.pxt failed at Thu Aug 23 11:24:22 2012: RHN::Exception: DBD::Pg::db do failed: ERROR:  no such savepoint\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 185 RHN::DB::handle_error\n  RHN::DB::SystemSnapshot /usr/share/perl5/vendor_perl/RHN/DB/SystemSnapshot.pm 458 RHN::DB::db::rollback\n  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 301 RHN::DB::SystemSnapshot::rollback_to_snapshot\n  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 300 (eval)\n  PXT::ApacheHandler /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 482 Sniglets::Snapshot::system_snapshot_rollback_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)
[Thu Aug 23 11:24:22 2012] [error] Traceback sent to MidrangeLinux@fnb.co.za at /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm line 563.
Comment 4 Tomáš Kašpárek 2012-08-27 10:06:24 EDT
Hello Sebastian

I haven't managed to reproduce problem you've encountered in Spacewalk 1.8 nightly, so it has been fixed in Spacewalk 1.8 nightly and we won't be probably putting this bugfix into Spacewalk 1.7.
Comment 5 jrentz 2012-08-30 20:58:25 EDT
Tomas,

I am getting the very same results as Sebastian.  I would get the same error when doing rollbacks. Traceback showed the error in Scheduler.pm.  I updated it per suggestions.  Now i get the very same error.  I understand this does not seem to be an issue with Spacewalk 1.8; however, as this is a production server I cannot use nightly builds.  Do you have any suggestions?

Form variables:
  pxt:trap => rhn:system_snapshot_rollback_cb
  sid => 1000010002
  ss_id => 70

User Information:
  User satadmin (id 1, org_id 1)

Error notes:
  (none)

Initial Request:
  Yes

Error message:
  RHN::Exception: DBD::Pg::db do failed: ERROR:  no such savepoint
  RHN::DB /usr/share/perl5/vendor_perl/RHN/DB.pm 121 RHN::Exception::DB::throw
  RHN::DB::db /usr/share/perl5/vendor_perl/RHN/DB.pm 185 RHN::DB::handle_error
  RHN::DB::SystemSnapshot /usr/share/perl5/vendor_perl/RHN/DB/SystemSnapshot.pm 458 RHN::DB::db::rollback
  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 301 RHN::DB::SystemSnapshot::rollback_to_snapshot
  Sniglets::Snapshot /usr/share/perl5/vendor_perl/Sniglets/Snapshot.pm 300 (eval)
  PXT::ApacheHandler /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 482 Sniglets::Snapshot::system_snapshot_rollback_cb
  PXT::ApacheHandler /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 103 PXT::ApacheHandler::pxt_parse_data
  PXT::ApacheHandler /usr/share/perl5/vendor_perl/PXT/ApacheHandler.pm 103 (eval)
  main -e 0 PXT::ApacheHandler::handler
  main -e 0 (eval)
Comment 6 Jan Pazdziora 2012-10-30 15:25:29 EDT
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Comment 7 Jan Pazdziora 2012-11-01 12:21:19 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.