{"record":{"id":"15d0a715f5cbfc9b","repo":"getredash/redash","slug":"neither-password-nor-private-key-b64-is-set","errorCode":null,"errorMessage":"Neither password nor private_key_b64 is set.","messagePattern":"Neither password nor private_key_b64 is set\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"redash/query_runner/snowflake.py","lineNumber":126,"sourceCode":"            \"account\": account,\n            \"region\": region,\n            \"host\": host,\n            \"application\": \"Redash/{} (Snowflake)\".format(__version__.split(\"-\")[0]),\n        }\n\n        if self.configuration.get(\"password\"):\n            params[\"password\"] = self.configuration[\"password\"]\n        elif self.configuration.get(\"private_key_File\"):\n            private_key_b64 = self.configuration.get(\"private_key_File\")\n            private_key_bytes = b64decode(private_key_b64)\n            if self.configuration.get(\"private_key_pwd\"):\n                private_key_pwd = self.configuration.get(\"private_key_pwd\").encode()\n            else:\n                private_key_pwd = None\n            private_key_pem = load_pem_private_key(private_key_bytes, private_key_pwd)\n            params[\"private_key\"] = private_key_pem\n        else:\n            raise Exception(\"Neither password nor private_key_b64 is set.\")\n\n        connection = snowflake.connector.connect(**params)\n\n        return connection\n\n    def _column_name(self, column_name):\n        if self.configuration.get(\"lower_case_columns\", False):\n            return column_name.lower()\n\n        return column_name\n\n    def _parse_results(self, cursor):\n        columns = self.fetch_columns(\n            [(self._column_name(i[0]), self.determine_type(i[1], i[5])) for i in cursor.description]\n        )\n        rows = [dict(zip((column[\"name\"] for column in columns), row)) for row in cursor]\n\n        data = {\"columns\": columns, \"rows\": rows}","sourceCodeStart":108,"sourceCodeEnd":144,"githubUrl":"https://github.com/getredash/redash/blob/ca79fe988d81cdac9675b412f3dfcab107bc1fbc/redash/query_runner/snowflake.py#L108-L144","documentation":"Raised by Snowflake._get_connection (redash/query_runner/snowflake.py:126) when the data source configuration has neither a password nor a private_key_b64 entry. The Snowflake connector requires one of these auth methods; if both are absent the runner cannot build connect() parameters and aborts before opening a connection.","triggerScenarios":"Creating/running a Snowflake data source where password is blank and no RSA private key (base64) was supplied; also when key-based auth was half-configured (private_key_pwd set but private_key_b64 missing).","commonSituations":"Migrating from password to key-pair auth and clearing the password before saving the key; form submission dropping empty fields; copying a template configuration without filling secrets.","solutions":["Set either password, or private_key_b64 containing the base64-encoded PEM private key (with optional private_key_pwd passphrase)","For key auth: openssl genrsa, base64-encode the PEM, paste into private_key_b64, and ensure the public key is associated with the Snowflake user (RSA_PUBLIC_KEY)","Re-save the data source and use Test Connection to confirm credentials are accepted"],"exampleFix":"# before\nconfiguration: {account: 'xy123', user: 'ETL', password: ''}\n# after\nconfiguration: {account: 'xy123', user: 'ETL', private_key_b64: '<base64 pem>'}","handlingStrategy":"validation","validationCode":"conf = ds.options\nif not conf.get('password') and not conf.get('private_key_b64'):\n    raise ValueError('Snowflake data source needs password or private_key_b64')","typeGuard":null,"tryCatchPattern":"try:\n    ds.query_runner.test_connection()\nexcept Exception as e:\n    return ok=False, message='Snowflake auth incomplete: {}'.format(e)","preventionTips":["Validate at save time that one auth method is fully populated","Automate key-pair generation and base64 encoding in provisioning scripts","Test the connection immediately after any credential rotation"],"tags":["snowflake","redash","authentication","configuration"],"backgroundTag":"missing-credentials","analyzedSha":"ca79fe988d81cdac9675b412f3dfcab107bc1fbc","analyzedAt":"2026-08-28T18:32:34.637Z","schemaVersion":2},"datasetVersion":"2026-08-28T21:17:43.275Z"}