{"record":{"id":"07c2ded052e3c9f2","repo":"OtterMind/Chat2DB","slug":"web-not-support-db-type","errorCode":"web.not.support.db.type","errorMessage":"web.not.support.db.type","messagePattern":"web\\.not\\.support\\.db\\.type","errorType":"error_code","errorClass":"CliDomainException","httpStatus":null,"severity":"error","filePath":"chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/cli/CliDataSourceServiceImpl.java","lineNumber":280,"sourceCode":"        } catch (Exception exception) {\n            response.setCanConnect(Boolean.FALSE);\n            response.setErrorCode(\"datasource_connection_failed\");\n            response.setErrorMessage(exception.getMessage());\n        } finally {\n            response.setDurationMs(System.currentTimeMillis() - startedAt);\n        }\n        return response;\n    }\n\n    private String firstNonBlank(String primary, String fallback) {\n        return StringUtils.isNotBlank(primary) ? primary : fallback;\n    }\n\n    private void validateCreate(WorkspaceDataSource request) {\n        if (!ConfigUtils.isDesktop() && ConfigUtils.isRelease()\n                && \"LocalFile\".equalsIgnoreCase(request.getServiceType())\n                && (\"H2\".equalsIgnoreCase(request.getType()) || \"SQLite\".equalsIgnoreCase(request.getType()))) {\n            throw new CliDomainException(\"web.not.support.db.type\", \"web.not.support.db.type\");\n        }\n    }\n\n    private void enrichCreateResponse(CliDataSource response, CliDataSourceCreateRequest source) {\n        if (response == null) {\n            return;\n        }\n        if (StringUtils.isBlank(response.getAlias())) {\n            response.setAlias(source.getAlias());\n        }\n        if ((StringUtils.isBlank(response.getHost()) || REDACTED.equals(response.getHost()))\n                && StringUtils.isNotBlank(source.getHost())) {\n            response.setHost(source.getHost());\n        }\n        if (StringUtils.isBlank(response.getPort()) && StringUtils.isNotBlank(source.getPort())) {\n            response.setPort(source.getPort());\n        }\n        if (StringUtils.isBlank(response.getDatabase())) {","sourceCodeStart":262,"sourceCodeEnd":298,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/cli/CliDataSourceServiceImpl.java#L262-L298","documentation":"CliDomainException code web.not.support.db.type from validateCreate: in a non-desktop, release build (ConfigUtils.isDesktop()==false && isRelease()==true), creating a LocalFile H2 or SQLite datasource is blocked. These file-backed DBs are only permitted in the desktop edition to avoid unsafe server-side file DB exposure.","triggerScenarios":"Running the Community web/release server and attempting to create a datasource with serviceType=LocalFile and type H2 or SQLite.","commonSituations":"Operator tries to attach a local .mv.db or .sqlite file against a deployed (release) web server instead of the desktop app.","solutions":["Use the Chat2DB desktop edition to work with LocalFile H2/SQLite datasources.","On the web/release server, point to a server-hosted H2 (TCP) or a network DB instead of a LocalFile service type.","If you genuinely need a file DB on the server, run a non-release/dev build (be aware of the security implications)."],"exampleFix":"// before (web release server)\ncreate({ type:'H2', serviceType:'LocalFile', url:'jdbc:h2:file:./data', ... })\n\n// after: connect to H2 over TCP or use desktop edition\ncreate({ type:'H2', serviceType:'H2', url:'jdbc:h2:tcp://h2host:9092/data', ... })","handlingStrategy":"validation","validationCode":"boolean webRelease = !ConfigUtils.isDesktop() && ConfigUtils.isRelease();\nboolean blockedFileDb = \"LocalFile\".equalsIgnoreCase(request.getServiceType())\n        && (\"H2\".equalsIgnoreCase(request.getType()) || \"SQLite\".equalsIgnoreCase(request.getType()));\nif (webRelease && blockedFileDb) {\n    throw new IllegalStateException(\"LocalFile H2/SQLite is desktop-only; use TCP or network DB on web\");\n}","typeGuard":"public boolean isWebReleaseBlockedFileDb(CliDataSourceCreateRequest r) {\n    boolean webRelease = !ConfigUtils.isDesktop() && ConfigUtils.isRelease();\n    boolean fileDb = \"LocalFile\".equalsIgnoreCase(r.getServiceType())\n        && (\"H2\".equalsIgnoreCase(r.getType()) || \"SQLite\".equalsIgnoreCase(r.getType()));\n    return webRelease && fileDb;\n}","tryCatchPattern":"try {\n    cliDataSourceService.create(request);\n} catch (CliDomainException e) {\n    if (\"web.not.support.db.type\".equals(e.getCode())) {\n        return unsupportedOnWeb(\"LocalFile H2/SQLite requires the desktop edition\");\n    }\n    throw e;\n}","preventionTips":["Detect edition (isDesktop/isRelease) in the UI and disable LocalFile H2/SQLite on web.","Use server-hosted (TCP) H2 or network DBs on the web/release server.","Document edition-specific datasource restrictions in user docs."],"tags":["datasource","edition","h2","sqlite","validation"],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}