{"record":{"id":"aa2b976084c8fadc","repo":"OtterMind/Chat2DB","slug":"web-not-support-db-type-aa2b97","errorCode":"web.not.support.db.type","errorMessage":"web.not.support.db.type","messagePattern":"web\\.not\\.support\\.db\\.type","errorType":"exception","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/db/DbWorkspaceDataSourceServiceImpl.java","lineNumber":148,"sourceCode":"            }\n        }\n        return dataSources;\n    }\n\n    @Override\n    public List<WorkspaceDataSource> exportDisplayDataSources(List<Long> datasourceIds) {\n        return exportDataSources(datasourceIds).stream()\n                .map(this::prepareExportDataSource)\n                .toList();\n    }\n\n    private void validateSupportedDataSource(WorkspaceDataSource dataSource) {\n        if (!ConfigUtils.isDesktop()\n                && ConfigUtils.isRelease()\n                && \"LocalFile\".equalsIgnoreCase(dataSource.getServiceType())\n                && (\"H2\".equalsIgnoreCase(dataSource.getType())\n                || \"SQLite\".equalsIgnoreCase(dataSource.getType()))) {\n            throw new BusinessException(\"web.not.support.db.type\");\n        }\n    }\n\n    private void applyDefaultDriverConfig(WorkspaceDataSource dataSource) {\n        if (dataSource == null) {\n            return;\n        }\n        if (dataSource.getDriverConfig() == null\n                || StringUtils.isBlank(dataSource.getDriverConfig().getJdbcDriverClass())) {\n            dataSource.setDriverConfig(Chat2DBContext.getDefaultDriverConfig(dataSource.getType()));\n        }\n    }\n\n    private WorkspaceDataSource prepareExportDataSource(WorkspaceDataSource dataSource) {\n        dataSource = copyDataSource(dataSource);\n        if (dataSource == null) {\n            return null;\n        }","sourceCodeStart":130,"sourceCodeEnd":166,"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/db/DbWorkspaceDataSourceServiceImpl.java#L130-L166","documentation":"Thrown by validateSupportedDataSource when Chat2DB runs in a non-desktop, release build and a data source has serviceType 'LocalFile' with type 'H2' or 'SQLite'. These local-file DBs are intentionally blocked on the web/release distribution because the server has no local filesystem backing for them.","triggerScenarios":"Calling create/update/test on a WorkspaceDataSource from a web (ConfigUtils.isRelease() && !isDesktop()) deployment where serviceType is 'LocalFile' and the db type is H2 or SQLite.","commonSituations":"Configuring a LocalFile H2/SQLite datasource through the web UI instead of the desktop app; a desktop-exported config bundle imported into a server deployment; flipping runtime mode without resetting LocalFile entries.","solutions":["Use the desktop edition for LocalFile H2/SQLite data sources, or host H2/SQLite as a server-mode/remote connection instead of LocalFile.","Switch the offending datasource serviceType away from 'LocalFile' (e.g. to a TCP/server connection string).","If this is genuinely a server scenario, change the DB type to one supported in web release mode."],"exampleFix":"// before\nds.setServiceType(\"LocalFile\");\nds.setType(\"H2\"); // blocked in web release\n// after\nds.setServiceType(\"Server\");\nds.setUrl(\"jdbc:h2:tcp://<host>:9092//data/mydb\");\n","handlingStrategy":"validation","validationCode":"boolean webRelease = ConfigUtils.isRelease() && !ConfigUtils.isDesktop();\nboolean blocked = webRelease && \"LocalFile\".equalsIgnoreCase(ds.getServiceType())\n    && (\"H2\".equalsIgnoreCase(ds.getType()) || \"SQLite\".equalsIgnoreCase(ds.getType()));\nif (blocked) throw new BusinessException(\"web.not.support.db.type\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate LocalFile H2/SQLite datasources to the desktop edition in the UI.","Prefer server-mode H2/SQLite connections for web deployments.","Validate serviceType+type+runtime mode before persisting a datasource."],"tags":["datasource","config","desktop-only","release-mode"],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}