Provisioning broken after restore: "Template .ph.xml not found" for every phone brand (V20, Linux)

AndrejRC

Customer
Joined
Nov 11, 2026
Messages
2
Reaction score
0
Hi all,

On a self-hosted V20 (Debian 12, 20.0.9.995, AI 8SC) provisioning never generates a config file for any phone: the PBX cannot find the phone TEMPLATE, and this happens for EVERY brand, not just one.

Logs:
3cxSystemService.log -> Warn| PS Template fanvil.ph.xml not found for Amministrazione 0CXXXXXXXXX
3cxSystemService.log -> Warn| PS Template yealinkT4x.ph.xml not found for Amministrazione 0CXXXXXXXXX
3cxManagementConsole.log -> Warn| [_3CX.Provisioning.Provisioning] PRV: Phone template is not found for device Amministrazione(0CXXXXXXXXX), ext.101, template=fanvil.ph.xml

Result: GET https://fqdn/provisioning/KEY/MAC.cfg returns 404, because MAC.cfg is never created.

What I already checked, so the template FILES look fine:
- the 44 template files exist in all three locations: /usr/share/3cxpbx/skel/Data/Http/Templates/phones/, /var/lib/3cxpbx/Data/Http/Templates/phones/ and /var/lib/3cxpbx/Instance1/Data/Http/Templates/phones/ (fanvil.ph.xml is 341692 bytes and does contain the X6U-V2 model)
- owner and permissions are correct (owner phonesystem, group phonesystem, 640 on files / 750 on the folder) and all services run as phonesystem
- GET /xapi/v1/PhoneTemplates DOES list them, so the management console sees the templates but the provisioning engine does not
- it is not brand specific: yealinkT4x.ph.xml gives the identical error
- the provisioning web endpoint itself works: other files in the provisioning folder (fanvil_phonebook.xml, 000000000000.cfg) are served with HTTP 200
- the extdevice row looks right (mac address, templateused=fanvil.ph.xml, correct interface), while devinfo is empty

Already tried, with no change:
- restart of 3CXPhoneSystem01 / 3CXSystemService01 / 3CXPhoneSystemMC01
- full OS reboot
- copying fanvil.ph.xml into the provisioning CustomTemplates folder and into CustomTemplates/phones
- assigning the phone with different TemplateName values via XAPI
- strace on 3CXPhoneSystem and 3cxSystemService during a re-provision: the services never even try to open a template file, which makes me think the in-memory template index is empty rather than a path or permission problem

Possibly relevant history: this instance was rebuilt on 4 November with 3CXCleanup plus an apt reinstall, then a fresh install from a PBX Express config URL, and finally a NEUTRAL backup (3CXBackupCmd with options MIN,PROMPTS,VM,REC,CH,FW, so without licence and FQDN) restored from the console. Everything else works perfectly - trunks, inbound and outbound calls, AI receptionist, recordings - only provisioning is dead, so the three new phones had to be configured by hand.

Is there a supported way to rebuild or re-register the phone template index without reinstalling the PBX from scratch?

Thanks a lot for any hint.
 
On a self-hosted V20 (Debian 12, 20.0.9.995, AI 8SC) provisioning never generates a config file for any phone:
Hi @AndrejRC are you trying to provision these phones behind a 3CX SBC or router phone? or are you using any VPN connection from the remote site to the PBX site?
 
Hi @AndrejRC are you trying to provision these phones behind a 3CX SBC or router phone? or are you using any VPN connection from the remote site to the PBX site?
Hi Alejandro, thanks for picking this up.

No SBC, no router phone, no VPN. The three phones (Fanvil X6U-V2) are in our office LAN behind a MikroTik router, and the PBX is a self-hosted VPS with a public FQDN. The phones register directly over the internet to port 5060 using SIP over TCP, and calls work perfectly in both directions - only provisioning is broken.

What makes me think the topology is not the cause: the warning "PS Template fanvil.ph.xml not found" is written by the PBX itself as soon as a device is assigned to an extension, before the phone sends any provisioning request at all. The same warning appears for every brand I try (yealinkT4x.ph.xml gives an identical message), GET /xapi/v1/PhoneTemplates does list all 44 templates that exist on disk in the three Templates/phones folders, and strace on 3CXPhoneSystem and 3cxSystemService during a re-provision shows the services never even attempt to open a template file.

So from here it looks like the in-memory template index is empty, rather than a network or file problem. Happy to send logs or run any test you suggest.
 
This sounds more like a permissions issue; you should look into that. The templates appear to be present, after all. Furthermore, if the PBX is not located on-site, the phones must be connected via either an SBC or a VPN.
 
No SBC, no router phone, no VPN. The three phones (Fanvil X6U-V2) are in our office LAN behind a MikroTik router, and the PBX is a self-hosted VPS with a public FQDN. The phones register directly over the internet to port 5060 using SIP over TCP, and calls work perfectly in both directions - only provisioning is broken
Hi @AndrejRC If you are using Stun this is not supported. The provisioning methods for remote phones are via the 3CX SBC, using router phones or connected via VPN.

There is not Stun provisioning anymore.

Please try to provisioning them using the supported methods.
 
Is there a supported way to rebuild or re-register the phone template index without reinstalling the PBX from scratch?

Nope, no supported way to do that. Start with a new VM and fresh install. Confirm that works fine first. Once confirmed, restore the backup. If the issue returns at least you can isolate it down to the backup being corrupted. Otherwise if the backup is not the issue then something else was likely modified that prevents the system from generating configs.

PS: This is not a known 3CX folder: /usr/share/3cxpbx/skel/Data/Http/Templates/phones/ therefore something was indeed touched on this installation. You also mention database tables, I'm assuming some tinkering took place at some point which may have led to this ;)