{"record":{"id":"4566b144cc190691","repo":"OtterMind/Chat2DB","slug":"web-not-support-db-type-4566b1","errorCode":"web.not.support.db.type","errorMessage":"web.not.support.db.type","messagePattern":"web\\.not\\.support\\.db\\.type","errorType":"validation","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/DbJdbcDriverServiceImpl.java","lineNumber":294,"sourceCode":"                for (String j : dc.getJdbcDriver().split(\",\")) {\n                    if (jarName.equals(j)) {\n                        return true;\n                    }\n                }\n            }\n        }\n        return false;\n    }\n\n    @Override\n    public void unloadDriver(String jdbcDriver) {\n        JdbcDriverManager.unload(jdbcDriver);\n    }\n\n    @Override\n    public void requireDriverManagementSupported() {\n        if (!ConfigUtils.isDesktop()) {\n            throw new BusinessException(\"web.not.support.db.type\");\n        }\n    }\n\n    private boolean driverExists(DriverConfig driverConfig) {\n        if (driverConfig == null || StringUtils.isBlank(driverConfig.getJdbcDriver())) {\n            return false;\n        }\n        for (String jarPath : driverConfig.getJdbcDriver().split(\",\")) {\n            File file = new File(JdbcDriverConstants.DRIVER_LIB_PATH + jarPath);\n            if (!file.exists()) {\n                return false;\n            }\n        }\n        return true;\n    }\n}\n","sourceCodeStart":276,"sourceCodeEnd":311,"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/DbJdbcDriverServiceImpl.java#L276-L311","documentation":"Thrown by DbJdbcDriverServiceImpl.requireDriverManagementSupported when ConfigUtils.isDesktop() is false. isDesktop() checks the system property 'chat2db.mode' for the value DESKTOP; in the web/server deployment that property is unset, so upload/download/unload of JDBC driver jars is refused. The i18n key 'web.not.support.db.type' resolves to 'Web terminal does not support the current database type, please use the desktop client'. This is a deliberate capability gate, not a bug.","triggerScenarios":"Any driver-management endpoint (upload, delete, replace, unload a JDBC driver jar) invoked while running the Community backend in web/server mode (chat2db.mode != DESKTOP). The controller/service calls requireDriverManagementSupported() first to enforce desktop-only driver edits.","commonSituations":"Operating the Docker/web deployment and attempting to manage drivers via the UI; a script that talks to the driver endpoints against a server-mode instance; forgetting that desktop-only operations are guarded.","solutions":["Perform driver management from the desktop client (set -Dchat2db.mode=DESKTOP), or pre-stage drivers into DRIVER_LIB_PATH for web deployments.","Gate the UI action on the desktop context so the request is never sent from web mode.","Do not attempt to bypass the guard by faking the mode; instead bundle the needed driver in the image."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if (!ConfigUtils.isDesktop()) {\n    // do not call driver-management endpoints; this is desktop-only\n}","typeGuard":"boolean canManageDrivers() {\n    return ConfigUtils.isDesktop(); // \"DESKTOP\".equalsIgnoreCase(System.getProperty(\"chat2db.mode\"))\n}","tryCatchPattern":null,"preventionTips":["Hide driver-management UI in web deployments.","Bundle drivers into the web/docker image rather than managing at runtime."],"tags":["desktop","capability-gate","jdbc-driver","deployment-mode"],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}