{"record":{"id":"f35b5e68524ce132","repo":"apache/iceberg","slug":"unsupported-lock-type-s-f35b5e","errorCode":null,"errorMessage":"Unsupported lock type: %s ","messagePattern":"Unsupported lock type: (.+?) ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/LockFactoryBuilder.java","lineNumber":53,"sourceCode":"  public static TriggerLockFactory build(LockConfig lockConfig, String tableName) {\n\n    String lockType = lockConfig.lockType();\n\n    Preconditions.checkArgument(\n        StringUtils.isNotEmpty(lockType),\n        \"Configuration must contain key: %s\",\n        LockConfig.LOCK_TYPE_OPTION.key());\n\n    // Set lock id to catalog.db.table if not set\n    switch (lockType) {\n      case LockConfig.JdbcLockConfig.JDBC:\n        return createJdbcLockFactory(lockConfig, tableName);\n\n      case LockConfig.ZkLockConfig.ZK:\n        return createZkLockFactory(lockConfig, tableName);\n\n      default:\n        throw new IllegalArgumentException(String.format(\"Unsupported lock type: %s \", lockType));\n    }\n  }\n\n  private static TriggerLockFactory createJdbcLockFactory(LockConfig lockConfig, String tableName) {\n    String jdbcUri = lockConfig.jdbcUri();\n    String lockId = lockConfig.lockId(tableName);\n    Map<String, String> properties = lockConfig.properties();\n    Preconditions.checkArgument(\n        StringUtils.isNotEmpty(jdbcUri),\n        \"JDBC lock requires %s parameter\",\n        LockConfig.JdbcLockConfig.JDBC_URI_OPTION.key());\n\n    properties.put(JdbcLockFactory.INIT_LOCK_TABLES_PROPERTY, lockConfig.jdbcInitTable());\n\n    return new JdbcLockFactory(jdbcUri, lockId, properties);\n  }\n\n  private static TriggerLockFactory createZkLockFactory(LockConfig lockConfig, String tableName) {","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/maintenance/operator/LockFactoryBuilder.java#L35-L71","documentation":"LockFactoryBuilder builds a TriggerLockFactory for the Iceberg Flink maintenance (rewrite) service based on the configured lock type (JDBC, ZooKeeper, or noop). This IllegalArgumentException is thrown when the lock type extracted from the LockConfig is none of the supported values. It indicates the table property or config that selects the lock implementation was set to an unknown value.","triggerScenarios":"Calling LockFactoryBuilder.build(lockConfig, tableName) where lockConfig.lockType() returns something other than LockConfig.NoopLockConfig.NOOP, JdbcLockConfig.JDBC, or ZkLockConfig.ZK, e.g. after misspelling the lock type or using a custom/raw string in the maintenance lock configuration.","commonSituations":"Typos in the lock config value, copying config from an older Iceberg version where lock type names differed, or programmatically constructing LockConfig with an unmanaged enum/string value.","solutions":["Check the configured lock type value and correct the typo — valid values are the constants on LockConfig (NOOP, JDBC, ZK).","Verify the Iceberg Flink version: ensure the lock type you use exists in that version (e.g. zk support present).","If no external lock is desired, explicitly configure the NOOP lock type rather than leaving an unrecognized value."],"exampleFix":"// before\nlock.type = \"zookeeper\"\n// after\nlock.type = \"zk\"","handlingStrategy":"validation","validationCode":"Set<String> valid = Set.of(LockConfig.NoopLockConfig.NOOP, LockConfig.JdbcLockConfig.JDBC, LockConfig.ZkLockConfig.ZK);\nif (!valid.contains(lockType)) {\n  throw new IllegalArgumentException(\"lock type must be one of \" + valid + \", got: \" + lockType);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the LockConfig constants instead of raw strings when configuring the lock type.","Validate table properties against documented values before submitting the maintenance job."],"tags":["flink","illegal-argument","config"],"backgroundTag":"invalid-enum-value","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}