[freeside-users] Help please.. Emergency..

Jeff Finucane jeff at cmh.net
Tue Sep 18 15:50:36 PDT 2012


On Tue, Sep 18, 2012 at 04:35:32PM -0600, Ryan Ghering <rghering at gmail.com> wrote:
+----------
| On upgrading to latest from 2.1.3 we are getting
| 
| Upgrading cust_pkg...
| DBD::Pg::st execute failed: ERROR:  more than one row returned by a
| subquery used as an expression [for Statement "update cust_pkg set
| order_date = (select history_date from h_cust_pkg
|         where h_cust_pkg.pkgnum = cust_pkg.pkgnum and
|         history_action = 'insert') where order_date is null"] at
| /usr/local/share/perl/5.10.1/FS/cust_pkg.pm line 3685.
| ERROR:  more than one row returned by a subquery used as an expression at
| /usr/local/share/perl/5.10.1/FS/cust_pkg.pm line 3685.
| 
| Our system is completely defunct at the moment, can't process payments, can
| add services nada...
| 
| Does anyone have an answer for this error??
+----------

>From what version are you upgrading?

It is curious that you have packages that have been inserted more than
once.  Perhaps the best approach is to first determine the severity of
the problem with something like

select pkgnum, count(*) as number from h_cust_pkg where history_action='insert' group by pkgnum having count(*) > 1;

If the number of rows is small (1?) perhaps removing offending
h_cust_pkg rows is appropriate.  Alternatively one could set the
order_date column in the corresponding cust_pkg row.  Perhaps prior
intervention of this sort caused the problem.

-- 
jeff at cmh.net

"There is no worse tyranny than to force a man to pay for what he does
 not want merely because you think it would be good for him." 

 Professor Bernardo de le Paz
  [ R.A. Heinlein -- "The Moon is a Harsh Mistress" ]



More information about the freeside-users mailing list