OtterMind/Chat2DB · error · BusinessException

web.not.support.db.type

web.not.support.db.type

Error message

web.not.support.db.type

What it means

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.

Source

Thrown at chat2db-community-server/chat2db-community-domain/chat2db-community-domain-core/src/main/java/ai/chat2db/community/domain/core/impl/db/DbDataSourceServiceImpl.java:120

            throw new ConnectionException("connection.ssh.error", null, e);
        } finally {
            if (session != null) {
                session.disconnect();
            }
        }
    }

    @Override
    public void closeRuntime() {
        Chat2DBContext.close();
        SSHManager.close();
    }

    private void validate(DbDataSourcePreConnectRequest param) {
        if (!ConfigUtils.isDesktop() && ConfigUtils.isRelease()) {
            if ("LocalFile".equalsIgnoreCase(param.getServiceType())
                    && ("H2".equalsIgnoreCase(param.getType()) || "SQLite".equalsIgnoreCase(param.getType()))) {
                throw new BusinessException("web.not.support.db.type");
            }
        }
    }

}

View on GitHub (pinned to 5ee1e990e7)

Solutions

  1. Use the desktop client for local-file H2/SQLite datasources.
  2. 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.
  3. Verify ConfigUtils mode flags are set correctly for your deployment (desktop builds must report isDesktop() true).
Defensive patterns

Strategy: validation

Validate before calling

// Mirror the service guard on the client/controller
if (!ConfigUtils.isDesktop() && ConfigUtils.isRelease()
        && "LocalFile".equalsIgnoreCase(param.getServiceType())
        && ("H2".equalsIgnoreCase(param.getType()) || "SQLite".equalsIgnoreCase(param.getType()))) {
    return Result.fail("web.not.support.db.type");
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of OtterMind/Chat2DB@5ee1e990e7 (2026-08-14). Data as JSON: /api/errors/887982ad75271320. Report an issue: GitHub.