{"record":{"id":"deae587c230cb397","repo":"apache/seatunnel","slug":"set-restart-strategy-failed-unknown-restart-strat","errorCode":null,"errorMessage":"set restart.strategy failed, unknown restart.strategy [{}],only support no,fixed-delay,failure-rate","messagePattern":"set restart\\.strategy failed, unknown restart\\.strategy \\[(.+?)\\],only support no,fixed-delay,failure-rate","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/utils/EnvironmentUtil.java","lineNumber":67,"sourceCode":"                    case \"fixed-delay\":\n                        int attempts = config.getInt(ConfigKeyName.RESTART_ATTEMPTS);\n                        long delay = config.getLong(ConfigKeyName.RESTART_DELAY_BETWEEN_ATTEMPTS);\n                        executionConfig.setRestartStrategy(\n                                RestartStrategies.fixedDelayRestart(attempts, delay));\n                        break;\n                    case \"failure-rate\":\n                        long failureInterval =\n                                config.getLong(ConfigKeyName.RESTART_FAILURE_INTERVAL);\n                        int rate = config.getInt(ConfigKeyName.RESTART_FAILURE_RATE);\n                        long delayInterval = config.getLong(ConfigKeyName.RESTART_DELAY_INTERVAL);\n                        executionConfig.setRestartStrategy(\n                                RestartStrategies.failureRateRestart(\n                                        rate,\n                                        Time.of(failureInterval, TimeUnit.MILLISECONDS),\n                                        Time.of(delayInterval, TimeUnit.MILLISECONDS)));\n                        break;\n                    default:\n                        log.warn(\n                                \"set restart.strategy failed, unknown restart.strategy [{}],only support no,fixed-delay,failure-rate\",\n                                restartStrategy);\n                }\n            }\n        } catch (Exception e) {\n            log.warn(\"set restart.strategy in config '{}' exception\", config, e);\n        }\n    }\n\n    public static CheckResult checkRestartStrategy(Config config) {\n        if (hasPathAndWaring(config, ConfigKeyName.RESTART_STRATEGY)) {\n            String restartStrategy = config.getString(ConfigKeyName.RESTART_STRATEGY);\n            switch (restartStrategy.toLowerCase()) {\n                case \"fixed-delay\":\n                    if (!(config.hasPath(ConfigKeyName.RESTART_ATTEMPTS)\n                            && config.hasPath(ConfigKeyName.RESTART_DELAY_BETWEEN_ATTEMPTS))) {\n                        return CheckResult.error(\n                                String.format(","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-core/seatunnel-flink-starter/seatunnel-flink-starter-common/src/main/java/org/apache/seatunnel/core/starter/flink/utils/EnvironmentUtil.java#L49-L85","documentation":"EnvironmentUtil.setRestartStrategy applies the 'restart.strategy' env option to the Flink ExecutionEnvironment. When the strategy name is not 'no', 'fixed-delay', or 'failure-rate' (case-sensitive), it logs this warning and leaves Flink's default restart strategy unchanged. The whole call is also wrapped in a try/catch that swallows other errors.","triggerScenarios":"env block sets restart.strategy to an unknown value such as 'fixed_delay', 'none', 'FixedDelay', or 'exponential-delay'; called during environment setup for Flink batch/stream jobs.","commonSituations":"Copying Flink YAML-style restart strategy names with different casing/underscores; configs migrated from other engines; users expecting newer Flink strategies (e.g. exponential-delay) unsupported by this mapping.","solutions":["Set restart.strategy to exactly 'no', 'fixed-delay', or 'failure-rate'.","Provide the matching sub-options (e.g. fixed-delay delay/attempts, failure-rate thresholds) so the strategy actually applies.","Remove the key to keep Flink's default restart strategy."],"exampleFix":"// before\nenv {\n  restart.strategy = \"fixed_delay\"\n}\n// after\nenv {\n  restart.strategy = \"fixed-delay\"\n  restart.strategy.fixed-delay.attempts = 3\n  restart.strategy.fixed-delay.delay = 10000\n}","handlingStrategy":"validation","validationCode":"String rs = config.getString(\"restart.strategy\");\nif (!java.util.Arrays.asList(\"no\",\"fixed-delay\",\"failure-rate\").contains(rs)) {\n    throw new IllegalArgumentException(\"restart.strategy must be no, fixed-delay, or failure-rate\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Follow documented strategy names exactly (lowercase, hyphenated).","Include required sub-options for fixed-delay/failure-rate.","Lint env blocks in CI against allowed keys/values."],"tags":["flink","config","restart-strategy"],"backgroundTag":"invalid-enum-value","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}