{"record":{"id":"b60f4d12e8705fa9","repo":"quarkusio/quarkus","slug":"unable-to-find-credentials-provider-for-the-mailer","errorCode":null,"errorMessage":"Unable to find credentials provider for the mailer {{mailerName}}.","messagePattern":"Unable to find credentials provider for the mailer (.+?)\\}\\.","errorType":"exception","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"extensions/mailer/runtime/src/main/java/io/quarkus/mailer/runtime/Mailers.java","lineNumber":164,"sourceCode":"            TlsConfigurationRegistry tlsRegistry) {\n        io.vertx.ext.mail.MailConfig cfg = toVertxMailConfig(name, config, tlsRegistry);\n        MailClientBuilder clientBuilder = MailClient.builder(vertx).with(cfg);\n        if (config.credentialsProvider().isPresent()) {\n            String beanName = config.credentialsProviderName().orElse(null);\n            CredentialsProvider credentialsProvider = findCredentialsProvider(name, beanName);\n            String providerName = config.credentialsProvider().get();\n            MailCredentialsSupplier credentialsSupplier = new MailCredentialsSupplier(credentialsProvider, providerName);\n            clientBuilder.withCredentialsSupplier(credentialsSupplier);\n        }\n        // Do not create a shared instance, as we want separated connection pool for each SMTP servers.\n        return clientBuilder.build();\n    }\n\n    private CredentialsProvider findCredentialsProvider(String mailerName, String beanName) {\n        try {\n            return CredentialsProviderFinder.find(beanName);\n        } catch (Exception e) {\n            throw new ConfigurationException(\"Unable to find credentials provider for the mailer \" + mailerName + \".\", e);\n        }\n    }\n\n    private io.vertx.ext.mail.DKIMSignOptions toVertxDkimSignOptions(DkimSignOptionsConfig optionsConfig) {\n        DKIMSignOptions vertxDkimOptions = new io.vertx.ext.mail.DKIMSignOptions();\n\n        String sdid = optionsConfig.sdid()\n                .orElseThrow(() -> {\n                    throw new ConfigurationException(\"Must provide the Signing Domain Identifier (sdid).\");\n                });\n        vertxDkimOptions.setSdid(sdid);\n\n        String selector = optionsConfig.selector()\n                .orElseThrow(() -> {\n                    throw new ConfigurationException(\"Must provide the selector.\");\n                });\n        vertxDkimOptions.setSelector(selector);\n","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/mailer/runtime/src/main/java/io/quarkus/mailer/runtime/Mailers.java#L146-L182","documentation":"Mailers resolves mail credentials through a CredentialsProvider looked up by bean name via CredentialsProviderFinder. If the finder throws (typically because no provider bean with that name is registered), findCredentialsProvider wraps the failure in this ConfigurationException naming the mailer.","triggerScenarios":"Setting quarkus.mailer.<mailer>.credentials-provider-name (or credentials-provider bean lookup) to a name for which no CredentialsProvider bean exists; a custom provider failing to initialize inside CredentialsProviderFinder.find(beanName).","commonSituations":"Typo in the credentials-provider-name config value; the CredentialsProvider bean was removed or not registered as a @Named bean; using named mailers where the provider is only registered for the default mailer; missing a credentials provider extension dependency (e.g. quarkus-credentials or vault).","solutions":["Register a CredentialsProvider bean with the exact name referenced: a @Named(\"myProvider\") class implementing CredentialsProvider (e.g. @ApplicationScoped).","Verify quarkus.mailer.credentials-provider-name matches the bean's @Name / provider name exactly.","Add the extension providing the provider (e.g. quarkus-vault, or your own module) to the application dependencies.","If no custom provider is needed, remove the credentials-provider-name property and configure username/password directly."],"exampleFix":"// before: config references a provider that does not exist\nquarkus.mailer.credentials-provider-name=mailCreds\n\n// after: register the matching bean\n@ApplicationScoped\n@Named(\"mailCreds\")\npublic class MailCredsProvider implements CredentialsProvider {\n    @Override\n    public Credentials getCredentials(CredentialsProviderContext context) {\n        return new Credentials(\"user\", \"secret\");\n    }\n}","handlingStrategy":"validation","validationCode":"// At startup, verify the named provider bean exists before the mailer uses it\nboolean found = Arc.container().instance(CredentialsProvider.class)\n        .select(NameLiteral.of(\"mailCreds\")).isResolvable();\nif (!found) throw new IllegalStateException(\"CredentialsProvider 'mailCreds' is not registered\");","typeGuard":null,"tryCatchPattern":"try {\n    mailer.send(mail).await().indefinitely();\n} catch (ConfigurationException e) {\n    if (e.getMessage().startsWith(\"Unable to find credentials provider\")) {\n        LOG.error(\"Check quarkus.mailer.credentials-provider-name and the @Named provider bean\", e);\n    }\n    throw e;\n}","preventionTips":["Keep provider names in a shared constants class referenced by both config and @Named","Add a startup check (StartupEvent observer) that resolves each configured provider","Document the required dependency extension next to the config property"],"tags":["quarkus","mailer","credentials-provider","configuration","startup"],"backgroundTag":"credentials-provider-not-found","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}