{"record":{"id":"dd17725759c97322","repo":"dotnet/orleans","slug":"the-configured-journal-format-key-must-be-non-empt-dd1772","errorCode":null,"errorMessage":"The configured journal format key must be non-empty.","messagePattern":"The configured journal format key must be non-empty\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Azure/Orleans.Journaling.AzureStorage/AzureTableJournalStorageProvider.cs","lineNumber":146,"sourceCode":"        if (journalFormat is null)\n        {\n            throw new InvalidOperationException(\n                $\"Journal format key '{journalFormatKey}' requires keyed service '{typeof(IJournalFormat).FullName}', but none was registered.\");\n        }\n\n        if (!string.Equals(journalFormat.FormatKey, journalFormatKey, StringComparison.Ordinal))\n        {\n            throw new InvalidOperationException(\n                $\"Journal format key '{journalFormatKey}' resolved format '{journalFormat.GetType().FullName}', but its {nameof(IJournalFormat.FormatKey)} is '{journalFormat.FormatKey}'. \" +\n                \"Register the journal format using the same key it reports.\");\n        }\n    }\n\n    private static string ValidateJournalFormatKey(string? journalFormatKey)\n    {\n        if (string.IsNullOrWhiteSpace(journalFormatKey))\n        {\n            throw new InvalidOperationException(\"The configured journal format key must be non-empty.\");\n        }\n\n        return journalFormatKey;\n    }\n}\n","sourceCodeStart":128,"sourceCodeEnd":152,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Orleans.Journaling.AzureStorage/AzureTableJournalStorageProvider.cs#L128-L152","documentation":"Thrown by ValidateJournalFormatKey when JournaledStateManagerOptions.JournalFormatKey is null, empty, or whitespace. A non-empty key is required to resolve the IJournalFormat keyed service; without one the provider cannot select a serialization format.","triggerScenarios":"JournaledStateManagerOptions.JournalFormatKey is left unset (null/empty) or explicitly cleared, and the AzureTableJournalStorageProvider constructor calls ValidateJournalFormatKey during DI activation.","commonSituations":"Default options not setting a JournalFormatKey; a config binding that supplies an empty string; an options post-configure step that nulls the key; misordered configuration.","solutions":["Set JournaledStateManagerOptions.JournalFormatKey to a non-empty key that matches a registered IJournalFormat.","Use the journaling Add* extension that configures both the key and the format registration together.","Bind the key from configuration and verify it is non-empty before startup."],"exampleFix":"// before\nservices.Configure<JournaledStateManagerOptions>(o => { /* JournalFormatKey unset */ });\n// after\nservices.Configure<JournaledStateManagerOptions>(o => o.JournalFormatKey = 'json');","handlingStrategy":"validation","validationCode":"if (string.IsNullOrWhiteSpace(journalFormatKey))\n    throw new InvalidOperationException(\"JournalFormatKey must be non-empty.\");","typeGuard":"static bool IsJournalFormatKeyValid(string? key) => !string.IsNullOrWhiteSpace(key);","tryCatchPattern":null,"preventionTips":["Set JournaledStateManagerOptions.JournalFormatKey explicitly in your Add* setup.","Bind the key from config and assert non-empty before startup.","Use the bundled extension methods which configure both key and registration."],"tags":["azure-table-storage","journaling","configuration","journal-format","startup"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}