{"record":{"id":"5c359be58f906947","repo":"microsoft/graphrag","slug":"either-connection-string-or-account-url-must-be-pr","errorCode":null,"errorMessage":"Either connection_string or account_url must be provided.","messagePattern":"Either connection_string or account_url must be provided\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"packages/graphrag/graphrag/logger/blob_workflow_logger.py","lineNumber":52,"sourceCode":"        if container_name is None:\n            msg = \"No container name provided for blob storage.\"\n            raise ValueError(msg)\n        if connection_string is None and account_url is None:\n            msg = \"No storage account blob url provided for blob storage.\"\n            raise ValueError(msg)\n\n        self._connection_string = connection_string\n        self.account_url = account_url\n        self._base_dir = base_dir\n\n        if self._connection_string:\n            self._blob_service_client = BlobServiceClient.from_connection_string(\n                self._connection_string\n            )\n        else:\n            if account_url is None:\n                msg = \"Either connection_string or account_url must be provided.\"\n                raise ValueError(msg)\n\n            self._blob_service_client = BlobServiceClient(\n                account_url,\n                credential=DefaultAzureCredential(),\n            )\n\n        self._container_name = container_name\n        self._rotate_blob(blob_name or None)\n\n    def emit(self, record) -> None:\n        \"\"\"Emit a log record to blob storage.\"\"\"\n        try:\n            # Create JSON structure based on record\n            log_data = {\n                \"type\": self._get_log_type(record.levelno),\n                \"data\": record.getMessage(),\n            }\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/microsoft/graphrag/blob/f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704/packages/graphrag/graphrag/logger/blob_workflow_logger.py#L34-L70","documentation":"An internal consistency check in BlobWorkflowLogger.__init__: the code took the account_url branch (connection_string was falsy) but account_url is also None, meaning neither credential option is available. It is effectively unreachable if the earlier both-None check passed and a non-empty connection string exists; it fires when connection_string is empty string/whitespace (falsy but not None) and account_url is None.","triggerScenarios":"Passing connection_string='' (empty string) with account_url=None — the first check passes because connection_string is not None, but the falsy value routes to the else branch. Also any refactor that clears account_url between the two checks.","commonSituations":"Env var set but empty (AZURE_STORAGE_CONNECTION_STRING=\"\" in .env); config templating that substitutes empty values; whitespace-only secrets in CI secrets.","solutions":["Ensure connection_string is a non-empty value, not '' — check the env var isn't defined-but-empty","Pass a valid account_url when using DefaultAzureCredential instead of a connection string","Trim/validate credential strings in config loading before constructing the logger"],"exampleFix":"# before\nBlobWorkflowLogger(container_name='c', connection_string=cfg.conn_str)  # conn_str == ''\n# after\nconn = (cfg.conn_str or '').strip()\nBlobWorkflowLogger(container_name='c', connection_string=conn or None, account_url=cfg.account_url)","handlingStrategy":"validation","validationCode":"conn = (cfg.connection_string or '').strip()\nurl = (cfg.account_url or '').strip()\nassert conn or url, 'need connection_string or account_url'\nlogger = BlobWorkflowLogger(container_name='c', connection_string=conn or None, account_url=url or None)","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat empty credential strings as missing in config loaders","Never define env vars as empty strings in .env templates"],"tags":["azure","blob-storage","empty-string","configuration"],"backgroundTag":"missing-storage-credentials","analyzedSha":"f40e9a26ce62ba0b3fef8837d24aafdcc6e6c704","analyzedAt":"2026-08-27T11:16:29.677Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}