RocketChat/Rocket.Chat · error · Error
error-registering-provider
Error message
error-registering-provider
What it means
Generic wrapper thrown by OutboundCommunicationBridge.registerPhoneProvider when the underlying getOutboundService().outboundMessageProvider.registerPhoneProvider call throws for any reason. The original error is logged via the Rocket.Chat logger with appId and msg 'Failed to register phone provider', but the rethrown error discards the original so callers only see 'error-registering-provider'. It is a catch-all signal that phone provider registration failed, not a specific cause.
Source
Thrown at apps/meteor/app/apps/server/bridges/outboundCommunication.ts:22
IOutboundEmailMessageProvider,
IOutboundMessageProviders,
IOutboundPhoneMessageProvider,
} from '@rocket.chat/apps-engine/definition/outboundCommunication';
import { getOutboundService } from '../../../../server/lib/omnichannel/outboundcommunication';
export class OutboundCommunicationBridge extends OutboundMessageBridge {
constructor(private readonly orch: IAppServerOrchestrator) {
super();
}
protected async registerPhoneProvider(provider: IOutboundPhoneMessageProvider, appId: string): Promise<void> {
try {
this.orch.debugLog(`App ${appId} is registering a phone outbound provider.`);
getOutboundService().outboundMessageProvider.registerPhoneProvider(provider);
} catch (err) {
this.orch.getRocketChatLogger().error({ appId, err, msg: 'Failed to register phone provider' });
throw new Error('error-registering-provider');
}
}
protected async registerEmailProvider(provider: IOutboundEmailMessageProvider, appId: string): Promise<void> {
try {
this.orch.debugLog(`App ${appId} is registering an email outbound provider.`);
getOutboundService().outboundMessageProvider.registerEmailProvider(provider);
} catch (err) {
this.orch.getRocketChatLogger().error({ appId, err, msg: 'Failed to register email provider' });
throw new Error('error-registering-provider');
}
}
protected async unRegisterProvider(provider: IOutboundMessageProviders, appId: string): Promise<void> {
try {
this.orch.debugLog(`App ${appId} is unregistering an outbound provider.`);
getOutboundService().outboundMessageProvider.unregisterProvider(appId, provider.type);
} catch (err) {View on GitHub (pinned to f9d3ec372b)
Solutions
- Inspect the server logs for the original `err` logged just before this throw — it contains the real cause (line: this.orch.getRocketChatLogger().error({ appId, err, msg: 'Failed to register phone provider' })).
- Verify Omnichannel and the outbound communication service are enabled on the workspace.
- Ensure your provider implements IOutboundPhoneMessageProvider fully (type field unique, required methods present).
- Register providers in onPostInstall / onEnable only once and unregister them in onDisable to avoid duplicate-key failures.
Example fix
// before
try {
await outbound.registerPhoneProvider(myProvider, appId);
} catch (e) {
// 'error-registering-provider' — no detail
}
// after
// First: check server logs for the original err.
// Then ensure provider has a unique type and Omnichannel is enabled.
const provider = { type: 'my-sms', ...methods };
if (!outbound.isRegistered(provider.type)) {
await outbound.registerPhoneProvider(provider, appId);
} Defensive patterns
Strategy: try-catch
Validate before calling
// validate provider shape before registering
function isValidPhoneProvider(p: any): boolean {
return p && typeof p.type === 'string' && p.type.length > 0 && typeof p.send === 'function';
}
if (!isValidPhoneProvider(provider)) {
throw new Error('Phone provider missing required fields (type, send)');
}
await outbound.registerPhoneProvider(provider, appId); Type guard
function isPhoneProvider(p: unknown): p is IOutboundPhoneMessageProvider {
return typeof p === 'object' && p !== null && typeof (p as any).type === 'string' && typeof (p as any).send === 'function';
} Try / catch
try {
await outbound.registerPhoneProvider(provider, appId);
} catch (e) {
// the real cause is in the server log under msg 'Failed to register phone provider'
this.app.getLogger().error({ msg: 'Phone provider registration failed', providerType: provider.type, err: e });
throw e;
} Prevention
- Check server logs for the original err — the bridge swallows the cause.
- Register providers in onPostInstall/onEnable and unregister in onDisable to keep state symmetric.
- Confirm Omnichannel and the outbound communication service are enabled before registering.
- Use a globally unique provider type to avoid duplicate-registration failures.
When it happens
Trigger: An App's enable/onInit hook registers a phone outbound provider whose object does not conform to IOutboundPhoneMessageProvider, the outbound service is uninitialized (Omnichannel/outbound plugin not loaded), or the same provider type was already registered and the registry rejected a duplicate.
Common situations: Omnichannel/Omnichannel outbound feature disabled or license missing on the workspace; duplicate registration across App reinstalls without cleanup; provider implementation throwing in its constructor or type field; version skew between the App's apps-engine API and the server's outbound service contract.
Related errors
- error-unregistering-provider
- Errors occurred while deleting an app user: ${err}
- Invalid type
- error-invalid-provider
- Invalid Api parameter provided, it must be a valid IApi obje
AI-assisted analysis of RocketChat/Rocket.Chat@f9d3ec372b (2026-08-12).
Data as JSON: /api/errors/1ac09851ee864ee8.
Report an issue: GitHub.