- Shipped
- August 27, 2026 at 6:51 PM UTC
- Author
- Kamo
- Commit
- a143d40
An org's KamoPBX server has been reporting Error: Phone provider instance not found: **************** since it was created. The instance was never missing — that row is in voip_provider_instance, active, with the right org. Two separate defects. 1. The message was false. buildKamoPBXProvider threw **************** whose UUID constructor renders "Phone provider instance not found: <id>". Every one of those throw sites had ALREADY found the instance; the id in the message is the one the caller just looked up successfully. The real condition was config_json IS NULL — provisioning never completed. Each site now says what is actually wrong and what to do about it. The UUID constructor stays for getInstance(UUID), which is the one place the instance genuinely is not found. 2. There was no way to finish it. Provisioning runs once, at create time. If it fails the row is deliberately kept — the realm is derived from its id, so a retry must reuse it — but nothing ever retried. test and sync both need a provider, and building one is exactly what fails without an account, so the server reported the same error forever. The comment on the create path even claimed "the operator can retry from the instance page"; no such retry existed. Adds POST /{id}/provision, idempotent — a server that already has an account is returned untouched rather than having a second one created against it — and makes /test finish provisioning first, so the button an admin already reaches for repairs the server instead of restating the error. Tests cover the retry, its idempotence, that a failed retry keeps the row with the reason recorded, and that non-KamoPBX providers are refused. 294 pass.