{"record":{"id":"c8a9238643c16db9","repo":"RocketChat/Rocket.Chat","slug":"error-provider-not-found","errorCode":null,"errorMessage":"error-provider-not-found","messagePattern":"error-provider-not-found","errorType":"exception","errorClass":"ProviderNotFoundError","httpStatus":null,"severity":"warning","filePath":"apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/forms/RecipientForm/RecipientForm.tsx","lineNumber":167,"sourceCode":"\n\tuseEffect(() => {\n\t\tisDirty && onDirty && onDirty();\n\t}, [isDirty, onDirty]);\n\n\tconst submit = useStableCallback(async (values: RecipientFormData) => {\n\t\ttry {\n\t\t\t// Wait if contact or provider is still being fetched in background\n\t\t\tconst [updatedContact, updatedProvider] = await Promise.all([\n\t\t\t\tisFetchingContact ? refetchContact().then((r) => r.data) : Promise.resolve(contact),\n\t\t\t\tisFetchingProvider ? refetchProvider().then((r) => r.data) : Promise.resolve(provider),\n\t\t\t]);\n\n\t\t\tif (!updatedContact) {\n\t\t\t\tthrow new ContactNotFoundError();\n\t\t\t}\n\n\t\t\tif (!updatedProvider) {\n\t\t\t\tthrow new ProviderNotFoundError();\n\t\t\t}\n\n\t\t\tonSubmit({ ...values, provider: updatedProvider, contact: updatedContact });\n\t\t} catch (error) {\n\t\t\tif (error instanceof ContactNotFoundError) {\n\t\t\t\tvalidateContactField(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (error instanceof ProviderNotFoundError) {\n\t\t\t\tvalidateProviderField(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdispatchToastMessage({ type: 'error', message: t('Something_went_wrong') });\n\t\t}\n\t});\n","sourceCodeStart":149,"sourceCodeEnd":185,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/client/views/omnichannel/components/outboundMessage/components/OutboundMessageWizard/forms/RecipientForm/RecipientForm.tsx#L149-L185","documentation":"Provider counterpart of the contact guard in RecipientForm submit: after the awaited provider refetch, a falsy provider throws ProviderNotFoundError ('error-provider-not-found', a FormFetchError subclass). The catch maps it to validateProviderField(true), flagging the provider selection field. Providers are outbound-message integrations (SMS/WhatsApp gateways etc.) registered with the Apps-Engine; none resolved for the selection.","triggerScenarios":"Submitting the recipient step while the provider query (omnichannelQueryKeys by providerId) is fetching and resolves empty, or when the selected provider app was removed/disabled between selection and submit.","commonSituations":"No outbound provider apps installed/enabled, so provider lookup returns nothing; provider app uninstalled mid-wizard; stale providerId from a previous session.","solutions":["Install and enable at least one outbound messaging provider app (Admin > Apps) and restart the wizard.","Re-select the provider after changes to installed apps.","Disable submit until the provider query is settled and non-empty."],"exampleFix":"// before\nif (!updatedProvider) {\n  throw new ProviderNotFoundError();\n}\n\n// after: gate the step on provider availability\nconst canSubmit = !isFetchingProvider && !isErrorProvider && Boolean(provider);\n{!provider && <Banner>{t('No_providers_available')}</Banner>}\n<ActionButton disabled={!canSubmit} onClick={submit} />","handlingStrategy":"validation","validationCode":"const canSubmit = !isFetchingProvider && !isErrorProvider && Boolean(provider);\nif (!provider) { /* install/enable an outbound provider app, then restart wizard */ }","typeGuard":"const hasProvider = (p: unknown): p is { id: string } =>\n  Boolean(p && typeof (p as any).id === 'string');","tryCatchPattern":null,"preventionTips":["Install and enable at least one outbound provider app.","Re-select providers after app installs/uninstalls.","Block submit until the provider query settles."],"tags":["rocket-chat","omnichannel","outbound-message","apps-engine"],"backgroundTag":"entity-not-found","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}