SOLVED: Database issue when updating from 15 to 16

,

In case anyone else has this issue…

Had to update a 15 system to 16 last week. The version update tool failed miserably so went onld school, created a snapshot for fallback then did a full backup on 15, installed 16 from scratch and restored the backup.

seemed to go ok until I had to change the endpoint manager templates and tried to save them. Got an error that the field plarNumber doesn’t exist in the table.

The template did save though and had the right info in it. Tried to get the sangoma phones to connect for a bit and they just didn’t seem to be getting the updated template info. Looked at a phone’s web ui and sure enough the old info was still there even after a factory reset.

Turns out because of the fields missing in the asterisk.endpoint_templates table:

| plarNumber | varchar(255) | YES | | NULL | |
| plarTimeout | varchar(2) | YES | | 0 | |
| ldapFNameFilter | varchar(100) | YES | | NULL | |
| ldapLNameFilter | varchar(100) | YES | | NULL | |
| ldapSearchFilter | varchar(100) | YES | | NULL | |
| ldapDialStringsToggle | varchar(2) | YES | | NULL | |
| ldapDialStringsConfig | varchar(4096) | YES | | NULL | |
| phonesWebUIToggle | varchar(2) | YES | | NULL | |

the template was saving in the EPM UI but the phone configs were not rewriting.

I had to look at another Distro16 system’s table to get the fields and add them in manually to the table for things to work.

I haven’t encountered any other issues or db errors popping up but my confidence isn’t really high on there not being more issues.

After adding those fields in manually, then rebuilding all the templates in EPM the phones conneccted properly.

Hi @ashcortech We have recently released the fix to handle such database issues during restore process. Please try with below EPM version.

fwconsole ma downloadinstall endpoint --tag=17.0.2.4
fwconsole chown
fwconsole reload

Best Regards
Kapil

Kapil,

Thanks for the reply, just to be sure, this is a Distro16 system currently on EPM 16.0.88.2, no issues running a 17 level module on it?

Also, since this is something you are aware of, any other fields/tables I need to look for that may be missing? any other known issues?

Hi @ashcortech

For Freepvx 16 , please try 16.0.88.4 EPM version.

Fix was to take care of such compatibility DB schema issues in Endpoint manager module.

Best Regards,
Kapil

Done, thanks. I’ll push the updates to the phones and test after business hours.

Ok after getting the bulk of the sangoma D series phones online I updated to EPM 16.0.88.4 as recommended. There is a second location that I needed to get to in order to reset the phones and re-download the config.

These phones will not grab a new config file no matter what I do. If I try to duplicate the good template from the main location, the new (duplicated) template appears twice in EPM.

After setting the phones config in EPM to that new template and factory resetting the phones they still keep grabbing the old config. I can tell because when log into the web ui of the phone it has the old pbx IP.

I rolled back EPM to a prior version 16.0.88.2 then duplicated the working template again. This time EPM Only created one duplicated template. Went through the process again and the phones are still grabbing an old config.

Created a new template from scratch… same issue.

I’m at a loss here. Something is really screwed up in EPM. Where do the config files reside? my thought is that if I can manually delete the old file it may allow a new one to be created?

Hi @ashcortech If phone still having old config then first ensure that phone is pointing to the v17 pbx to pull the right configuration.

EPM in v17 generating configuration in /tftpboot directory only so you can check the generated files in this location to ensure EPM generating new configuration every time you try to generate new configuration.

Best Regards
Kapil

Kapil,

This is a V16 system, Not V17. Unfortunately I do not feel 17 is ready for production as of yet.

Okay so check tftpboot directory if you are getting new config or not.

new config files are being created but only contain:

(IP and port hidden on purpose)

are there other files I should be looking for?

There are no other files that have the phones mac address in their names. I see plenty of xml files in the /tftpboot directory but none for the phones in question.

Hi @ashcortech May be easy to raise support ticket and DM me your ticket# , that will allow us to ssh to your system to debug the issue directly.

Best Regards
Kapil

Case 01790725

done thanks, will work with you via support case.

thanks

1 Like

The original issue with the database tables not updating properly is a known EPM issue which is being addressed.

The subsequent issue with not being able to get the last few phones to connect was my own rookie mistake and @slobera from Sangoma did a great job sniffing out my screw up once he was logged in.

The phones used to connect via the system OpenVPN. In V16 I moved them all to TLS connections. There are two sites that connect to this phone system, the main office and a satellite office they only use once a week. When I upgrade the main office phones I went into EPM and in each phone turned off it’s VPN client. What I should have done was delete all the clients from the VPN server when I turned that off but…

Not having the keys for the satellite office and knowing they wouldn’t be in that office until the end of the week I just took care of the main office phones and moved on to other issues.

When I went back to do the satellite office phones I completely forgot that I didn’t change the satellite office phone’s config to turn off VPN… Since the VPN server was no longer on they couldn’t connect and it appeared that their config file wasn’t updating… It was, it’s just that it was getting the VPN IP, not the IP that was in the template because I still had the VPN setting on.

When using DPMA, the config files will be under /etc/asterisk/dpma/phone_configs/ext-number/mac-address.cfg

Example: /etc/asterisk/dpma/phone_configs/1013-1/000FD3CCBBAA.cfg

The one inside /tftpboot only tells the phone where to go and register, or where to use phoneapps, etc.

Thanks for taking my call and work with me !
Have a nice day!

3 Likes

Glad to see your issue got resolved, @ashcortech.

Thanks @slobera for the prompt help.

Best Regards
Kapil

2 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.