{"record":{"id":"68698a09753e5fe1","repo":"apache/seatunnel","slug":"cannot-resolve-insert-strategy-s-supported-va","errorCode":null,"errorMessage":"Cannot resolve insert strategy: [%s]. Supported values are: '%s', '%s'","messagePattern":"Cannot resolve insert strategy: \\[(.+?)\\]\\. Supported values are: '(.+?)', '(.+?)'","errorType":"validation","errorClass":"java.lang.IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/util/MaxcomputeOutputFormat.java","lineNumber":69,"sourceCode":"    private RecordWriter recordWriter;\n    private UpsertStream upsertStream;\n    private TableTunnel.UploadSession uploadSession;\n    private TableTunnel.UpsertSession upsertSession;\n\n    public MaxcomputeOutputFormat(SeaTunnelRowType rowType, ReadonlyConfig readonlyConfig) {\n        this.rowType = rowType;\n        this.readonlyConfig = readonlyConfig;\n        this.tableSchema = MaxcomputeUtil.getTable(readonlyConfig).getSchema();\n        this.formatterContext =\n                new FormatterContext(readonlyConfig.get(FormatOptions.DATETIME_FORMAT));\n\n        String insertStrategy = readonlyConfig.get(MaxcomputeSinkOptions.INSERT_STRATEGY);\n        if (UPLOAD_SESSION.equals(insertStrategy)) {\n            isUploadSession = true;\n        } else if (UPSERT_SESSION.equals(insertStrategy)) {\n            isUploadSession = false;\n        } else {\n            throw new IllegalArgumentException(\n                    String.format(\n                            \"Cannot resolve insert strategy: [%s]. Supported values are: '%s', '%s'\",\n                            insertStrategy, UPLOAD_SESSION, UPSERT_SESSION));\n        }\n    }\n\n    public void write(SeaTunnelRow seaTunnelRow) throws IOException, TunnelException {\n        switch (seaTunnelRow.getRowKind()) {\n            case INSERT:\n                if (isUploadSession) {\n                    insertRecord(seaTunnelRow);\n                } else {\n                    upsertRecord(seaTunnelRow);\n                }\n                break;\n            case UPDATE_AFTER:\n                upsertRecord(seaTunnelRow);\n                break;","sourceCodeStart":51,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/util/MaxcomputeOutputFormat.java#L51-L87","documentation":"The MaxcomputeOutputFormat constructor reads the insert_strategy config and only accepts 'upload_session' or 'upsert_session'; any other value throws IllegalArgumentException at sink initialization. This fails fast before writing any data.","triggerScenarios":"Configuring sink option INSERT_STRATEGY (insert_strategy) with a typo'd or unsupported value like 'session', 'append', or 'UPSERT' (wrong casing/whitespace) in the HOCON job config.","commonSituations":"Copy-pasting config from another connector; using uppercase values when the constants are lowercase; leftover option from an older connector version with different accepted values.","solutions":["Set insert_strategy to exactly 'upload_session' or 'upsert_session' (lowercase)","Check the current option default and accepted values in MaxcomputeSinkOptions/docs","Trim/normalize the value in your config generation script before writing the job file"],"exampleFix":"// before\ninsert_strategy = \"UPSERT_SESSION\"\n// after\ninsert_strategy = \"upsert_session\"","handlingStrategy":"validation","validationCode":"String s = readonlyConfig.get(MaxcomputeSinkOptions.INSERT_STRATEGY);\nif (!\"upload_session\".equals(s) && !\"upsert_session\".equals(s)) {\n    throw new IllegalArgumentException(\"insert_strategy must be 'upload_session' or 'upsert_session': \" + s);\n}","typeGuard":null,"tryCatchPattern":"try { new MaxcomputeOutputFormat(readonlyConfig); }\ncatch (IllegalArgumentException e) { /* fix config and retry job submission */ }","preventionTips":["Use the exact lowercase constants for insert_strategy","Keep option values in sync with current connector docs","Validate job configs before submission (config validation tooling)"],"tags":["maxcompute","config","enum","sink"],"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-14T11:17:12.474Z"}