{"record":{"id":"433335c2cbb1d6fe","repo":"quarkusio/quarkus","slug":"failed-to-convert-value-for-property-property-t","errorCode":null,"errorMessage":"Failed to convert value for property ${property} to String","messagePattern":"Failed to convert value for property (.+?) to String","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ConfigUtils.java","lineNumber":70,"sourceCode":"     * Obtains the value of the {@param propertyName} name, meaning that the name must NOT start with '${' or end with '}'\n     */\n    public static String doGetConfigValue(String configPropertyName, boolean required, String propertyName) {\n        try {\n            Optional<String> optionalValue = ConfigProvider.getConfig().getOptionalValue(propertyName, String.class);\n            if (optionalValue.isEmpty()) {\n                String message = String.format(\"Failed to find value for config property %s in application configuration. \"\n                        + \"Please provide the value for the property, e.g. by adding %s=<desired-value> to your application.properties\",\n                        configPropertyName, propertyName);\n                if (required) {\n                    throw new IllegalArgumentException(message);\n                }\n                log.warn(message);\n            }\n            return optionalValue.orElse(null);\n        } catch (IllegalArgumentException e) {\n            String message = \"Failed to convert value for property \" + configPropertyName + \" to String\";\n            if (required) {\n                throw new IllegalArgumentException(message, e);\n            } else {\n                log.warn(message);\n                return null;\n            }\n        }\n    }\n\n    private static String stripPrefixAndSuffix(String configProperty) {\n        // by now we know that configProperty is of form ${...}\n        return configProperty.substring(2, configProperty.length() - 1);\n    }\n}\n","sourceCodeStart":52,"sourceCodeEnd":83,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/resteasy-reactive/rest-client/runtime/src/main/java/io/quarkus/rest/client/reactive/runtime/ConfigUtils.java#L52-L83","documentation":"doGetConfigValue retrieves config properties as String via ConfigProvider.getConfig().getOptionalValue(...). If the underlying config value exists but cannot be converted to String, an IllegalArgumentException from config lands here and is rethrown (or warned if not required) as 'Failed to convert value for property X to String'. It indicates a corrupt or non-convertible config source entry.","triggerScenarios":"A config source (e.g. YAML/TOML config file, KV store) supplies the rest-client property in a format MicroProfile Config cannot convert to String — often nested/structured values or null-typed entries in non-properties config sources.","commonSituations":"SmallRye YAML/TOML config files where the property ends up as a mapping/list instead of a scalar; quoting/encoding issues in the config file; custom ConfigSource returning an object type that fails conversion.","solutions":["Inspect the config source and make the property a plain scalar string value","Flatten the entry in YAML/TOML config (e.g. url: http://host:port instead of a nested block)","Remove duplicate definitions across config sources that conflict and choose a single valid source"],"exampleFix":"# before (application.yaml)\nquarkus:\n  rest-client:\n    my-client:\n      url: {host: localhost, port: 8080}\n# after\nquarkus:\n  rest-client:\n    my-client:\n      url: http://localhost:8080","handlingStrategy":"validation","validationCode":"String v = ConfigProvider.getConfig().getOptionalValue(\"quarkus.rest-client.my-client.url\", String.class).orElse(null);\nif (v == null || !(v instanceof String) || v.isBlank()) {\n    throw new IllegalStateException(\"Config value for my-client.url is missing or not a plain string\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    // build/invoke client\n} catch (IllegalArgumentException e) {\n    if (e.getMessage().startsWith(\"Failed to convert value for property\")) {\n        log.error(\"Check YAML/TOML config: the property must be a scalar string, not a nested mapping\");\n    }\n    throw e;\n}","preventionTips":["Keep url/uri entries as scalar strings in YAML/TOML config files","Do not nest the property under an object in structured config formats","Audit config sources (files, env, KV stores) for conflicting definitions"],"tags":["rest-client","config","type-conversion"],"backgroundTag":"config-conversion-failed","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"}