{"record":{"id":"b3ea840ed997ea29","repo":"apache/shardingsphere","slug":"12011","errorCode":"12011","errorMessage":"Invalid variable value '%s'.","messagePattern":"Invalid variable value '(.+?)'\\.","errorType":"exception","errorClass":"InvalidVariableValueException","httpStatus":null,"severity":"warning","filePath":"proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutor.java","lineNumber":79,"sourceCode":"    private void handleConfigurationProperty(final ContextManager contextManager, final TypedPropertyKey propertyKey, final String value) {\n        MetaDataContexts metaDataContexts = contextManager.getMetaDataContexts();\n        Properties props = new Properties();\n        props.putAll(metaDataContexts.getMetaData().getProps().getProps());\n        props.putAll(metaDataContexts.getMetaData().getTemporaryProps().getProps());\n        props.put(propertyKey.getKey(), getValue(propertyKey, value));\n        contextManager.getPersistServiceFacade().getModeFacade().getMetaDataManagerService().alterProperties(props);\n    }\n    \n    private Object getValue(final TypedPropertyKey propertyKey, final String value) {\n        try {\n            Object propertyValue = new TypedPropertyValue(propertyKey, value).getValue();\n            checkProxyMetaDataCollectorCron(propertyKey, value);\n            if (Enum.class.isAssignableFrom(propertyKey.getType())) {\n                return propertyValue.toString();\n            }\n            return TypedSPI.class.isAssignableFrom(propertyKey.getType()) ? ((TypedSPI) propertyValue).getType().toString() : propertyValue;\n        } catch (final TypedPropertyValueException ignored) {\n            throw new InvalidVariableValueException(value);\n        }\n    }\n    \n    private void checkProxyMetaDataCollectorCron(final TypedPropertyKey propertyKey, final String value) {\n        if (TemporaryConfigurationPropertyKey.PROXY_META_DATA_COLLECTOR_CRON == propertyKey) {\n            ShardingSpherePreconditions.checkState(!Strings.isNullOrEmpty(value) && CronExpression.isValidExpression(value), () -> new InvalidVariableValueException(value));\n        }\n    }\n    \n    @Override\n    public Class<SetDistVariableStatement> getType() {\n        return SetDistVariableStatement.class;\n    }\n}\n","sourceCodeStart":61,"sourceCodeEnd":94,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/proxy/backend/core/src/main/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/updatable/variable/SetDistVariableExecutor.java#L61-L94","documentation":"InvalidVariableValueException (error code 12011) thrown by SetDistVariableExecutor.getValue when the raw string value cannot be converted to the property's declared type: TypedPropertyValue(propertyKey, value) raises TypedPropertyValueException (caught and ignored), which is rethrown as this exception. A second source is checkProxyMetaDataCollectorCron: for TemporaryConfigurationPropertyKey.PROXY_META_DATA_COLLECTOR_CRON the value must be non-empty AND a valid Quartz CronExpression.","triggerScenarios":"SET DIST VARIABLE with a value that fails typed conversion, e.g. NAME='max-connections-size-per-query', VALUE='abc' (not an int), or an enum/SPI-typed key given an unknown constant; or NAME='proxy_meta_data_collector_cron' with a malformed/empty cron string that CronExpression.isValidExpression rejects.","commonSituations":"Passing quoted numerics with stray characters or wrong units; assuming cron formats from other schedulers (5-field Unix cron) are accepted when Quartz 6/7-field expressions are required; copy-pasting property values between incompatible keys.","solutions":["Supply a value matching the key's type: plain int/long/boolean for numeric/flag keys, exact enum/SPI type names for typed keys","For proxy_meta_data_collector_cron use a valid Quartz cron expression (e.g. '0/5 * * * * ?'), not Unix 5-field cron, and never empty","Consult the property key's documented data type before setting, and remove quotes only as the grammar requires"],"exampleFix":"-- before\nSET DIST VARIABLE WHERE NAME = 'proxy_meta_data_collector_cron' AND VALUE = '*/5 * * * *';\n\n-- after\nSET DIST VARIABLE WHERE NAME = 'proxy_meta_data_collector_cron' AND VALUE = '0/5 * * * * ?';","handlingStrategy":"validation","validationCode":"public void validateValue(final TypedPropertyKey key, final String value) {\n    try {\n        new TypedPropertyValue(key, value);\n    } catch (final TypedPropertyValueException ex) {\n        throw new IllegalArgumentException(\"Value '\" + value + \"' does not match type of \" + key.getKey());\n    }\n    if (TemporaryConfigurationPropertyKey.PROXY_META_DATA_COLLECTOR_CRON == key\n            && !CronExpression.isValidExpression(value)) {\n        throw new IllegalArgumentException(\"Value must be a valid Quartz cron: \" + value);\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Send values in the property's declared type (bare int/boolean, exact enum names)","Use Quartz cron syntax (6-7 fields, e.g. '0/5 * * * * ?') — never Unix 5-field cron"],"tags":["distsql","ral","variables","validation","cron","type-conversion"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}