{"record":{"id":"c418279a1b12dff1","repo":"prestodb/presto","slug":"invalid-domain-domain","errorCode":null,"errorMessage":"Invalid domain \" + domain","messagePattern":"Invalid domain \" \\+ domain","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"presto-lark-sheets/src/main/java/com/facebook/presto/lark/sheets/api/LarkSheetsApiFactory.java","lineNumber":72,"sourceCode":"        drivePermissionService = new DrivePermissionService(config);\n        sheetsService = new SheetsService(config);\n    }\n\n    @Override\n    public LarkSheetsApi get()\n    {\n        return new SimpleLarkSheetsApi(drivePermissionService, sheetsService);\n    }\n\n    private static Domain toLarkDomain(LarkSheetsConfig.Domain domain)\n    {\n        switch (domain) {\n            case LARK:\n                return Domain.LarkSuite;\n            case FEISHU:\n                return Domain.FeiShu;\n            default:\n                throw new IllegalArgumentException(\"Invalid domain \" + domain);\n        }\n    }\n}\n","sourceCodeStart":54,"sourceCodeEnd":76,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-lark-sheets/src/main/java/com/facebook/presto/lark/sheets/api/LarkSheetsApiFactory.java#L54-L76","documentation":"LarkSheetsApiFactory.toLarkDomain maps the configured 'domain' string to the Lark SDK Domain enum; any value other than 'lark' or 'feishu' (the LARK/FEISHU cases) falls into the default branch and throws IllegalArgumentException. This is a configuration validation failure, not a runtime/remote error.","triggerScenarios":"Setting the lark-sheets 'lark-sheets.domain' config property to an unrecognized string (anything other than the LARK/FEISHU enum values, matched via switch), then building the API factory via config().","commonSituations":"Typo in the config file ('LarkSuite', 'feishu.cn', 'larksuite.com'); wrong casing if matching is case-sensitive; copy-pasting config from a different connector.","solutions":["Set domain to exactly 'lark' or 'feishu' (matching the switch cases).","Check the catalog properties file (e.g. etc/catalog/lark_sheets.properties) for typos and casing.","Consult LarkSheetsApiFactory/LARK/FEISHU constant definitions for accepted values."],"exampleFix":"// before (catalog properties)\nlark-sheets.domain=FeiShu\n\n// after\nlark-sheets.domain=feishu","handlingStrategy":"validation","validationCode":"Set<String> VALID = Set.of(\"lark\", \"feishu\");\nif (domain == null || !VALID.contains(domain.toLowerCase(Locale.ROOT))) {\n    throw new IllegalArgumentException(\"domain must be 'lark' or 'feishu'\");\n}","typeGuard":"boolean isValidDomain(String d) { return \"lark\".equalsIgnoreCase(d) || \"feishu\".equalsIgnoreCase(d); }","tryCatchPattern":"try { api = LarkSheetsApiFactory.create(config); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Invalid domain\")) { fixConfigFile(); } else { throw e; } }","preventionTips":["Copy domain values exactly from the connector documentation ('lark' or 'feishu').","Validate catalog properties at deploy time with a config smoke test.","Avoid hand-editing casing or using full product names like 'larksuite' in configs."],"tags":["configuration","invalid-input","presto"],"backgroundTag":"invalid-config-value","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}