[freeside-users] Install 1.9 on CentOS 5.3 DBD::mysql::db do failed

Jamuel P. Starkey jamuel at hcvoip.com
Sun Oct 25 15:29:17 PDT 2009


Thanks, Ivan.

So I've gone and patched other, similar MySQL errors that I see during
the install--please advise if I should choose different values for the
statustext column size but I've set all instances to varchar(512):
$ freeside-setup -d hcvoip.com
NO CONFIGURATION TABLE FOUND at /usr/lib/perl5/site_perl/5.8.8/FS/UID.pm
line 131.
DBD::mysql::db do failed: BLOB/TEXT column 'statustext' used in key
specification without a key length [for Statement "CREATE  INDEX
h_cust_bill_event4 ON h_cust_bill_event ( statustext )"] at
/usr/bin/freeside-setup line 109.
CREATE error: BLOB/TEXT column 'statustext' used in key specification
without a key length
doing statement: CREATE  INDEX h_cust_bill_event4 ON h_cust_bill_event (
statustext )

diff -Bbup
--- Schema.pm        2009-10-09 16:59:24.000000000 -0700
+++ Schema.pm 2009-10-25 14:38:02.000000000 -0700
@@ -431,7 +431,7 @@ sub tables_hashref {
         'eventpart',   'int',  '', '', '', '',
         '_date',     @date_type, '', '',
         'status', 'varchar', '', $char_d, '', '',
-        'statustext', 'text', 'NULL', '', '', '',
+        'statustext', 'varchar', 'NULL', 512, '', '',
       ],
       'primary_key' => 'eventnum',
       #no... there are retries now #'unique' => [ [ 'eventpart',
'invnum' ] ],
@@ -530,7 +530,7 @@ sub tables_hashref {
         'tablenum',   'int',  '', '', '', '',
         '_date',     @date_type, '', '',
         'status', 'varchar', '', $char_d, '', '',
-        'statustext', 'text', 'NULL', '', '', '',
+        'statustext', 'varchar', 'NULL', 512, '', '',
       ],
       'primary_key' => 'eventnum',
       #no... there are retries now #'unique' => [ [ 'eventpart',
'invnum' ] ],
@@ -985,7 +985,7 @@ sub tables_hashref {
         'pkgnum', 'int', 'NULL', '', '', '', #desired pkgnum for
pkg-balances
         'status',       'varchar',     '', $char_d, '', '',
         'session_id',   'varchar', 'NULL', $char_d, '', '', #only need 32
-        'statustext',   'text',    'NULL',  '', '', '',
+        'statustext',   'varchar',    'NULL',  512, '', '',
         'gatewaynum',   'int',     'NULL',  '', '', '',
         #'cust_balance', @money_type,            '', '',
         'paynum',       'int',     'NULL',  '', '', '',
@@ -1641,10 +1641,10 @@ sub tables_hashref {
     'queue' => {
       'columns' => [
         'jobnum',      'serial',     '',      '', '', '',
-        'job',           'text',     '',      '', '', '',
+        'job',           'varchar',  '',      '512', '', '',
         '_date',          'int',     '',      '', '', '',
         'status',     'varchar',     '', $char_d, '', '',
-        'statustext',    'text', 'NULL',      '', '', '',
+        'statustext',    'varchar', 'NULL',      512, '', '',
         'svcnum',         'int', 'NULL',      '', '', '',
         'custnum',        'int', 'NULL',      '', '', '',
         'secure',        'char', 'NULL',       1, '', '',.

Then I ran into this regarding multiple auto index columns:

NO CONFIGURATION TABLE FOUND at /usr/lib/perl5/site_perl/5.8.8/FS/UID.pm
line 131.
DBD::mysql::db do failed: Incorrect table definition; there can be only
one auto column and it must be defined as a key [for Statement "CREATE
TABLE part_pkg_taxoverride (
  taxoverridenum INTEGER NOT NULL  AUTO_INCREMENT,
  pkgpart INTEGER NOT NULL  AUTO_INCREMENT,
  taxclassnum INTEGER NOT NULL  AUTO_INCREMENT,
  usage_class varchar(80) NULL  ,
  PRIMARY KEY (taxoverridenum)
)
TYPE=InnoDB"] at /usr/bin/freeside-setup line 109.
CREATE error: Incorrect table definition; there can be only one auto
column and it must be defined as a key
doing statement: CREATE TABLE part_pkg_taxoverride (
  taxoverridenum INTEGER NOT NULL  AUTO_INCREMENT,
  pkgpart INTEGER NOT NULL  AUTO_INCREMENT,
  taxclassnum INTEGER NOT NULL  AUTO_INCREMENT,
  usage_class varchar(80) NULL  ,
  PRIMARY KEY (taxoverridenum)
)
TYPE=InnoDB

I jury-rigged this by changing 2 of 3 the columns typed as SERIAL to
type BIGINT--this undoubtedly will break something so thoughts on this
would be especially appreciated.
diff -Bbup
--- Schema.pm        2009-10-09 16:59:24.000000000 -0700
+++ Schema.pm 2009-10-25 14:38:02.000000000 -0700
@@ -1348,8 +1348,8 @@ sub tables_hashref {
     'part_pkg_taxoverride' => {
       'columns' => [
         'taxoverridenum', 'serial', '', '', '', '',
-        'pkgpart',        'serial', '', '', '', '',
-        'taxclassnum',    'serial', '', '', '', '',
+        'pkgpart',        'bigint', '', '', '', '',
+        'taxclassnum',    'bigint', '', '', '', '',
         'usage_class',    'varchar', 'NULL', $char_d, '', '',
       ],
       'primary_key' => 'taxoverridenum',

Next I ran into logo.eps fails binary comparison;  at
/usr/bin/freeside-setup line 135:
$ freeside-setup -d hcvoip.com -v
NO CONFIGURATION TABLE FOUND at /usr/lib/perl5/site_perl/5.8.8/FS/UID.pm
line 131.
Freeside schema initialized - commiting transaction
Database schema committed successfully
Initializing freeside configuration
NO CONFIGURATION TABLE FOUND at /usr/lib/perl5/site_perl/5.8.8/FS/UID.pm
line 131.
logo.eps fails binary comparison;  at /usr/bin/freeside-setup line 135.

I commented out the offending perl since a binary comparison failure of
a logo seems trivial (pls tell me if I'm wrong):
diff -Bbup
--- Conf.pm     2009-10-07 18:15:06.000000000 -0700
+++ Conf.pm   2009-10-25 14:52:52.000000000 -0700
@@ -13,7 +13,7 @@ use FS::conf;
use FS::Record qw(qsearch qsearchs);
use FS::UID qw(dbh datasrc use_confcompat);

-$base_dir = '%%%FREESIDE_CONF%%%';
+$base_dir = '/opt/freeside';

$DEBUG = 0;

@@ -394,8 +394,8 @@ sub verify_config_item {

   } else {

-    $error .= "$key fails binary comparison; "
-      unless scalar($self->config_binary($key)) eq
scalar($compat->config_binary($key));
+#    $error .= "$key fails binary comparison; "
+#      unless scalar($self->config_binary($key)) eq
scalar($compat->config_binary($key));

   }

Finally I see these which I've chosen to ignore:

$ freeside-setup -d hcvoip.com -v
NO CONFIGURATION TABLE FOUND at /usr/lib/perl5/site_perl/5.8.8/FS/UID.pm
line 131.
Freeside schema initialized - commiting transaction
Database schema committed successfully
Initializing freeside configuration
NO CONFIGURATION TABLE FOUND at /usr/lib/perl5/site_perl/5.8.8/FS/UID.pm
line 131.
Freeside configuration initialized - commiting transaction
Freeside configuration committed successfully
NO CONFIGURATION TABLE FOUND at /usr/lib/perl5/site_perl/5.8.8/FS/UID.pm
line 131.
Invalid country code: AX chosen at
/usr/lib/perl5/site_perl/5.8.8/Locale/SubCountry.pm line 518.
Invalid country code: FX chosen at
/usr/lib/perl5/site_perl/5.8.8/Locale/SubCountry.pm line 518.
Invalid country code: HK chosen at
/usr/lib/perl5/site_perl/5.8.8/Locale/SubCountry.pm line 518.
Invalid country code: NC chosen at
/usr/lib/perl5/site_perl/5.8.8/Locale/SubCountry.pm line 518.
Invalid country code: PF chosen at
/usr/lib/perl5/site_perl/5.8.8/Locale/SubCountry.pm line 518.
Invalid country code: PW chosen at
/usr/lib/perl5/site_perl/5.8.8/Locale/SubCountry.pm line 518.
Invalid country code: RE chosen at
/usr/lib/perl5/site_perl/5.8.8/Locale/SubCountry.pm line 518.
Invalid country code: SM chosen at
/usr/lib/perl5/site_perl/5.8.8/Locale/SubCountry.pm line 518.
Invalid country code: TO chosen at
/usr/lib/perl5/site_perl/5.8.8/Locale/SubCountry.pm line 518.
Freeside database initialized - commiting transaction
Database initialization committed successfully

I'd be happy to test any patches that you might provide.

Cheers,

JPS

Ivan Kohler wrote:
> On Wed, Oct 14, 2009 at 08:43:10AM -0700, Jamuel P. Starkey wrote:
>   
>> $ freeside-setup -d hcvoip.com
>>
>> DBD::mysql::db do failed: BLOB/TEXT column 'job' used in key
>> specification without a key length [for Statement "CREATE  INDEX
>> h_queue3 ON h_queue ( job )"] at /usr/bin/freeside-setup line 110.
>> CREATE error: BLOB/TEXT column 'job' used in key specification without a
>> key length
>> doing statement: CREATE  INDEX h_queue3 ON h_queue ( job ) at
>> /usr/bin/freeside-setup line 110.
>>
>> I believe the offending SQL is:
>>
>> CREATE  INDEX h_queue3 ON h_queue ( job )
>>     
>
> Looks like the index on a text field (queue.job) is tickling MySQL the 
> wrong way
>
> You could try Postgres, or this patch:
>
> Index: Schema.pm
> ===================================================================
> RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
> retrieving revision 1.169
> diff -u -r1.169 Schema.pm
> --- Schema.pm	12 Oct 2009 01:45:12 -0000	1.169
> +++ Schema.pm	21 Oct 2009 07:05:35 -0000
> @@ -1643,7 +1643,7 @@
>      'queue' => {
>        'columns' => [
>          'jobnum',      'serial',     '',      '', '', '', 
> -        'job',           'text',     '',      '', '', '', 
> +        'job',        'varchar',     '',     512, '', '', 
>          '_date',          'int',     '',      '', '', '', 
>          'status',     'varchar',     '', $char_d, '', '', 
>          'statustext',    'text', 'NULL',      '', '', '', 
>
>
> We could certainly use help keeping the MySQL support current if folks 
> are interested in using it.  We had work sponsored not too long ago to 
> bring it basically up-to-date but could use assistance with ongoinging 
> testing and maintenence.
>
>   




More information about the freeside-users mailing list