{"record":{"id":"c8040299b31fdc17","repo":"infiniflow/ragflow","slug":"missing-dependency-trino-please-install-pip-in","errorCode":null,"errorMessage":"Missing dependency 'trino'. Please install: pip install trino","messagePattern":"Missing dependency 'trino'\\. Please install: pip install trino","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"agent/tools/exesql.py","lineNumber":151,"sourceCode":"        elif self._param.db_type == \"oceanbase\":\n            db = pymysql.connect(db=self._param.database, user=self._param.username, host=safe_host, port=self._param.port, password=self._param.password, charset=\"utf8mb4\")\n        elif self._param.db_type == \"postgres\":\n            db = psycopg2.connect(dbname=self._param.database, user=self._param.username, host=safe_host, port=self._param.port, password=self._param.password)\n        elif self._param.db_type == \"mssql\":\n            conn_str = (\n                r\"DRIVER={ODBC Driver 17 for SQL Server};\"\n                r\"SERVER=\" + safe_host + \",\" + str(self._param.port) + \";\"\n                r\"DATABASE=\" + self._param.database + \";\"\n                r\"UID=\" + self._param.username + \";\"\n                r\"PWD=\" + self._param.password\n            )\n            db = pyodbc.connect(conn_str)\n        elif self._param.db_type == \"trino\":\n            try:\n                import trino\n                from trino.auth import BasicAuthentication\n            except Exception:\n                raise Exception(\"Missing dependency 'trino'. Please install: pip install trino\")\n\n            def _parse_catalog_schema(db: str):\n                if not db:\n                    return None, None\n                if \".\" in db:\n                    c, s = db.split(\".\", 1)\n                elif \"/\" in db:\n                    c, s = db.split(\"/\", 1)\n                else:\n                    c, s = db, \"default\"\n                return c, s\n\n            catalog, schema = _parse_catalog_schema(self._param.database)\n            if not catalog:\n                raise Exception(\"For Trino, `database` must be 'catalog.schema' or at least 'catalog'.\")\n\n            http_scheme = \"https\" if os.environ.get(\"TRINO_USE_TLS\", \"0\") == \"1\" else \"http\"\n            auth = None","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/infiniflow/ragflow/blob/554fb1133ac3861732235ad9c377eb5e0a770665/agent/tools/exesql.py#L133-L169","documentation":"Error \"Missing dependency 'trino'. Please install: pip install trino\" thrown in infiniflow/ragflow.","triggerScenarios":"Thrown at agent/tools/exesql.py:151 when the library encounters an invalid state.","commonSituations":"The ExeSQL tool targets a Trino database but the optional trino driver is not installed in the runtime environment; installing the dependency prevents this error.","solutions":["Install the trino package: pip install trino.","Rebuild the environment with all extras so the trino dependency is present."],"exampleFix":"pip install trino","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"554fb1133ac3861732235ad9c377eb5e0a770665","analyzedAt":"2026-08-15T09:20:16.380Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}