{"record":{"id":"6ec1fe4a3cc2077b","repo":"getredash/redash","slug":"couchbase-connection-error","errorCode":null,"errorMessage":"Couchbase connection error","messagePattern":"Couchbase connection error","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"redash/query_runner/couchbase.py","lineNumber":149,"sourceCode":"\n    def call_service(self, query, user):\n        try:\n            user = self.configuration.get(\"user\")\n            password = self.configuration.get(\"password\")\n            protocol = self.configuration.get(\"protocol\", \"http\")\n            host = self.configuration.get(\"host\")\n            port = self.configuration.get(\"port\", 8095)\n            params = {\"statement\": query}\n\n            url = \"%s://%s:%s/query/service\" % (protocol, host, port)\n\n            r = requests.post(url, params=params, auth=(user, password))\n            r.raise_for_status()\n            return r\n        except requests.exceptions.HTTPError as err:\n            if err.response.status_code == 401:\n                raise Exception(\"Wrong username/password\")\n            raise Exception(\"Couchbase connection error\")\n\n    def run_query(self, query, user):\n        result = self.call_service(query, user)\n\n        rows, columns = parse_results(result.json()[\"results\"])\n        data = {\"columns\": columns, \"rows\": rows}\n\n        return data, None\n\n    @classmethod\n    def name(cls):\n        return \"Couchbase\"\n\n\nregister(Couchbase)\n","sourceCodeStart":131,"sourceCodeEnd":165,"githubUrl":"https://github.com/getredash/redash/blob/ca79fe988d81cdac9675b412f3dfcab107bc1fbc/redash/query_runner/couchbase.py#L131-L165","documentation":"The catch-all branch of CouchbaseRunner.call_service: any HTTPError other than 401 (403, 404, 405, 500, ...) is re-raised as 'Couchbase connection error', discarding the status detail.","triggerScenarios":"POSTing a N1QL statement to the query service endpoint when it returns a non-401 HTTP error: wrong URL/path (404), insufficient RBAC role (403), method blocked by a proxy (405), or server-side failure (500).","commonSituations":"Missing :8093 query-service port in the URL, reverse proxy blocking POST, or Couchbase versions with different endpoint behavior.","solutions":["Verify the URL points at the query service (default port 8093, path /query/service)","Reproduce with curl -u user:pass 'http://host:8093/query/service' -d 'statement=SELECT 1' to see the real status","Check RBAC roles (403) and proxy rules (405)","Upgrade Redash if the Couchbase version changed endpoint behavior"],"exampleFix":"# before\n{\"host\": \"couchbase.internal\"}\n\n# after\n{\"host\": \"couchbase.internal:8093\"}","handlingStrategy":"try-catch","validationCode":"import requests\nr = requests.post(f\"http://{host}:8093/query/service\", data={\"statement\": \"SELECT 1\"}, auth=(u, p), timeout=5)\nprint(r.status_code, r.text[:200])  # surface 403/404/405 before Redash does","typeGuard":null,"tryCatchPattern":"try:\n    result = runner.call_service(q, u)\nexcept Exception as e:\n    if 'Couchbase connection error' in str(e):\n        diagnose_endpoint_with_curl(); alert_admin_with_status()","preventionTips":["Pin the query-service endpoint (host:8093/query/service) in config templates","Ensure reverse proxies allow POST to the query service","Smoke-test the endpoint after Couchbase upgrades"],"tags":["redash","couchbase","network","http"],"backgroundTag":"http-request-failed","analyzedSha":"ca79fe988d81cdac9675b412f3dfcab107bc1fbc","analyzedAt":"2026-08-28T18:32:34.637Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}