{"record":{"id":"887982ad75271320","repo":"OtterMind/Chat2DB","slug":"web-not-support-db-type-887982","errorCode":"web.not.support.db.type","errorMessage":"web.not.support.db.type","messagePattern":"web\\.not\\.support\\.db\\.type","errorType":"error_code","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/DbDataSourceServiceImpl.java","lineNumber":120,"sourceCode":"            throw new ConnectionException(\"connection.ssh.error\", null, e);\n        } finally {\n            if (session != null) {\n                session.disconnect();\n            }\n        }\n    }\n\n    @Override\n    public void closeRuntime() {\n        Chat2DBContext.close();\n        SSHManager.close();\n    }\n\n    private void validate(DbDataSourcePreConnectRequest param) {\n        if (!ConfigUtils.isDesktop() && ConfigUtils.isRelease()) {\n            if (\"LocalFile\".equalsIgnoreCase(param.getServiceType())\n                    && (\"H2\".equalsIgnoreCase(param.getType()) || \"SQLite\".equalsIgnoreCase(param.getType()))) {\n                throw new BusinessException(\"web.not.support.db.type\");\n            }\n        }\n    }\n\n}\n","sourceCodeStart":102,"sourceCodeEnd":126,"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/DbDataSourceServiceImpl.java#L102-L126","documentation":"Thrown by validate() when the runtime is NOT desktop and IS a release build, and the datasource uses serviceType 'LocalFile' with type 'H2' or 'SQLite'. The web release build intentionally refuses local-file databases because the server cannot access the user's filesystem.","triggerScenarios":"A user on the web (non-desktop) release build tries to connect a LocalFile H2 or SQLite datasource; ConfigUtils.isDesktop() is false and ConfigUtils.isRelease() is true, so validate() rejects it.","commonSituations":"User running the deployed web edition expecting local-file DB support that only the desktop client provides; or a mode flag misconfigured so a desktop install reports as release-web.","solutions":["Use the desktop client for local-file H2/SQLite datasources.","If you genuinely need it in web, move the DB file onto the server and connect over TCP/file path accessible to the server, not LocalFile.","Verify ConfigUtils mode flags are set correctly for your deployment (desktop builds must report isDesktop() true)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Mirror the service guard on the client/controller\nif (!ConfigUtils.isDesktop() && ConfigUtils.isRelease()\n        && \"LocalFile\".equalsIgnoreCase(param.getServiceType())\n        && (\"H2\".equalsIgnoreCase(param.getType()) || \"SQLite\".equalsIgnoreCase(param.getType()))) {\n    return Result.fail(\"web.not.support.db.type\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Direct web users to the desktop client for local-file H2/SQLite.","Keep ConfigUtils desktop/release flags accurate for the deployment.","Hide the LocalFile option in the web UI datasource form."],"tags":["validation","web","desktop","db-type","local-file"],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}