Koozali.org: home of the SME Server

Upgrading to 3.1 from 2.6.1-3

Offline compsos

  • *
  • 472
  • +0/-0
Upgrading to 3.1 from 2.6.1-3
« on: September 26, 2010, 09:40:50 AM »
Hi

On upgrading the following error was returned
Code: [Select]
  " perl /opt/sark/scripts/srkinsertdbdata.pl
  DBD::SQLite::db do failed: near ",": syntax error(1) at dbdimp.c line 271 at /opt/sark/perl/modules/sark/SarkSubs.pm line 1185.
  DBD::SQLite::db do failed: near ",": syntax error(1) at dbdimp.c line 271 at /opt/sark/perl/modules/sark/SarkSubs.pm line 1185.
  Issuing rollback() for database handle being DESTROY'd without explicit disconnect()."

The COS was deleted from the old version. But just a note about the wiki, it says to remove sail post-upgrade, reboot and then as a post script after installing 3.1 that COS should be removed. Maybe the removal instruction should be before removing old version of sail?

A manual search of the selintra-work file does not turn up any references to "COS".

I guess the error is about the format of the current selintra-work, just not sure which "," is causing the issue.

The ref appears to be this routine.

Code: [Select]
sub SQLiteDo($$) {
#
#   do the SQL and return nothing
#
    my ($dbh, $sqlcmd) = @_;
#    print STDERR "SQLDO - $sqlcmd\n";
    $dbh->do($sqlcmd);
}

Thanks.

Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #1 on: September 26, 2010, 06:51:53 PM »
Hi Gordon

I don't think it is COS related.  Possibly a corruption in your selintra-work file (or a bug in the converter).

Easiest thing to do is uncomment the debug print in SQLiteDo so you can see what caused it to croak. 

:)

Best

S

Offline compsos

  • *
  • 472
  • +0/-0
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #2 on: September 27, 2010, 12:02:05 AM »
OK will try it. For the moment have taken the system back to 2.6.1-4.
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #3 on: September 27, 2010, 03:06:19 PM »
OK

Let me know what you find when you run it again.

Best

S

Offline compsos

  • *
  • 472
  • +0/-0
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #4 on: September 28, 2010, 10:32:29 AM »
OK set it up in a VM to convert the file this time so I can play in the sand pit.

It appears to be stopped by the line
allow=ulaw'  ,'SIP'  ,'gordon@domainname'   );
This appears to be coming from line 22 in the selintra-work file for my extension a Yealink TP26P. Although not an exact match.

Looking at all the preceding output I can not see a similar line. Would seem that is getting more than it should for this input. What is the separator "|" in the selintra-work file?

As for COS there are parts like "| openAH|NO|" but all the "|closedBH|" are gone.

If it running down the file sequentially then the only other point is that this is the 3rd phone (IAXmodem, Aastra, yealink) The Yealink configuration files have blank lines "/n /n" separating the code blocks.

What else can I dig out that may help the converter?

Ver 3.1 looks good. Well done.
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #5 on: September 28, 2010, 12:47:48 PM »
Hi Gordon

looks like a corruption.  There should probabaly be a quote to open allow=ulaw'.  What is on the preceding line? 

Separator | is the SME server database field delimiter.  The SME database is formatted as keyvalue=sometype|field1|somevalue|field2|somevalue|... |fieldn|somevalue

Suggest you remove all COS references manually if you can't shift 'em by deletion.  Suggest you just manually delete the records.  There are no controls on these databases; so as long as they fit the format above, you can do anything you like and it will still work.

Blank lines should not be a problem (they don't look nice in the database when but that's no big)

I think that's about it.  We've tested the converter on lots of different DB images and it generally does OK but file corruptions will kill it.  Usually just best to find the bad row and delete it.  You can always add it manually in the 3.1 app.

Thanks for the nice comments on the visuals.  The design company did a nice job, particularly with Tux :)

Kind Regards

S

Offline compsos

  • *
  • 472
  • +0/-0
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #6 on: September 29, 2010, 12:53:12 AM »
Thanks Jeff

Can not see any ' marks that might be missing but is the following code correct seeing as the only place with line feeds is the codec section?

Code: [Select]
5005=IPphone||NO|callerid||channel|4|cluster|default|desc|DAHDI Ext(FXS)4|device|AnalogFXS|devicerec|default|dvrvmail|None|extalert||iaxextn|NA|location|local|macaddr|NA|num|5005|openAH|NO|passwd||sipiaxfriend|\ndisallow=all\nallow=gsm\nallow=ulaw\nallow=alaw|technology|Analogue|vmailfwd||zzeor|EOR

If we manually remove the "|openAH|NO|" should it be completly removed or left as "|||" or "| | |"?
Regards

Gordon............

Offline compsos

  • *
  • 472
  • +0/-0
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #7 on: September 29, 2010, 01:46:42 PM »
Now here is a test.

Still had trouble with the conversion. So as the system is not large just edit by hand and save the configuration.
But in the IP devices in Sail 3.1 clicked on y0000000000.cfg device. It opened and then not modifying anything click on save returns
Code: [Select]
DBD::SQLite::db prepare failed: unrecognized token: "'y000000000000.cfg"(1) at dbdimp.c line 271 at /opt/sark/perl/modules/sark/SarkSubs.pm line 1140. 
Notice the dreaded ' before the y. OK where do we start looking for this one.

The logs also had this entry

Code: [Select]
Sep 29 21:12:43 server-test logger: Regenerating Asterisk
Sep 29 21:12:43 server-test logger: Regenerating Asterisk Finished
Sep 29 21:12:43 server-test logger: Reloading Asterisk
Sep 29 21:12:43 server-test php: PHP Warning:  fsockopen(): unable to connect to 127.0.0.1:5038 (Connection refused) in /opt/sark/generator/astreload.php on line 9
Sep 29 21:12:43 server-test logger: Reloading Asterisk Finished
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #8 on: September 29, 2010, 06:40:41 PM »
OK -

The record doesn't look correct to me because you have an unamed variable at the beginning (5005=IPphone||NO) - I'm referring to the ||; there should be a variable name in there I think (probably a COS name).

I just tried to edit the yealink entry on our reference box and got the same failure. -  I'll come back to you as soon as I figure out why.

Best

Jeff

Offline compsos

  • *
  • 472
  • +0/-0
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #9 on: September 29, 2010, 11:38:46 PM »
Thanks Jeff
The sandpit was originally asterisk16 but the error (yoooo...cfg file) was the same when I dropped it back to asterisk14. Strange all the other IPdevices do not throw any error on save. I deleted and created a new y..cfg definition and got the error, even with no entries in the file. Looks like a file saving/naming failure. Hope that helps.

Also within the yealink ipdevice templates are a lot of "customised" values. It may be worth while sanitising the templates prior to release to avoid confusion.

G
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #10 on: September 30, 2010, 09:25:50 AM »
Thanks Gordon

It is the key.  Keys with '.' in them aren't being handled correctly.   

You'd think that would be easy to fix but it appears to be quite subtle.

Best

Jeff 

Offline compsos

  • *
  • 472
  • +0/-0
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #11 on: September 30, 2010, 09:33:18 AM »
Hi Jeff
OK see what you mean I had only tried ones without a period in the name.

Could the same be happening to the converter as I have trolled through the selintra-work file and taken out anything related to Open or closed and left the blank || but still sticks on the same section with a ' in the output?
G
« Last Edit: September 30, 2010, 09:35:51 AM by compsos »
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #12 on: September 30, 2010, 10:19:08 AM »
I don't think so.  Could you maybe send me your V2 selintra file?  I'd like to run it through and see where we get to.

send it to admin@aelintra.com

Best

Jeff

Offline compsos

  • *
  • 472
  • +0/-0
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #13 on: September 30, 2010, 10:27:36 AM »
Jeff
On the matter of the conversion, is it replacing all the | with , ? If so then where are the ' coming in? I deleted a non working extension it was spitting out on and of course it just moved to another part of the file. The last output line on the console is

"requirecalltoken=no'  ,'IAX2'  , ' '  ); "

which looks a similar construction to the other error and nothing like anything in the original file.
I think this is the matching part from the original file

"|requirecalltoken|NO|technology|IAX2|vmailfwd||zzero|EOR"

G
Just saw your reply. A sanitised copy (without passwords) on its way. Thanks
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: Upgrading to 3.1 from 2.6.1-3
« Reply #14 on: September 30, 2010, 02:06:03 PM »
HI Gordon

Tried to email your corrected files back but the mail bounced.

There were three issues...

Each of the extensions had a field with a blank name and this was causing the ","  error message.  The converter builds a string of comma separated variable names to give to sqlite.  The empty names meant it was sending two commas which was cauing sqlite to choke.

Also you had some dangling COS fields (called OPENAH) which I removed, and finally a fieldname called iaxetn which I suspect is from quite an old release of sail.  It doesn't exist anymore.

I will put fixes into the converter for these problems so this has been a very good exercise. 

I will update you as soon as I have a fix for the '.' issue in devices.


Best

Jeff