{"record":{"id":"0a3820b912822641","repo":"microsoft/garnet","slug":"object-store-is-disabled","errorCode":null,"errorMessage":"Object store is disabled","messagePattern":"Object store is disabled","errorType":"exception","errorClass":"GarnetException","httpStatus":null,"severity":"error","filePath":"libs/server/Storage/Session/ObjectStore/Common.cs","lineNumber":765,"sourceCode":"            Debug.Assert(!status.IsPending);\n            return status.Found ? GarnetStatus.OK : GarnetStatus.NOTFOUND;\n        }\n\n        /// <summary>\n        /// Iterates members of a collection object using a cursor,\n        /// a match pattern and count parameters\n        /// </summary>\n        /// <param name=\"key\">The key of the sorted set</param>\n        /// <param name=\"input\"></param>\n        /// <param name=\"output\"></param>\n        /// <param name=\"objectContext\"></param>\n        public GarnetStatus ObjectScan<TObjectContext>(ReadOnlySpan<byte> key, ref ObjectInput input, ref ObjectOutput output, ref TObjectContext objectContext)\n            where TObjectContext : ITsavoriteContext<FixedSpanByteKey, ObjectInput, ObjectOutput, long, ObjectSessionFunctions, StoreFunctions, StoreAllocator>\n          => ReadObjectStoreOperation(key, ref input, ref objectContext, ref output);\n\n        [MethodImpl(MethodImplOptions.NoInlining)]\n        static void ThrowObjectStoreUninitializedException()\n            => throw new GarnetException(\"Object store is disabled\", disposeSession: false);\n\n        #endregion\n\n        /// <summary>\n        /// Complete operation if pending and get GarnetStatus based on status returned from the Object Store\n        /// </summary>\n        /// <typeparam name=\"TObjectContext\"></typeparam>\n        /// <param name=\"status\"></param>\n        /// <param name=\"objectContext\"></param>\n        /// <param name=\"output\"></param>\n        /// <returns></returns>\n        private GarnetStatus CompletePendingAndGetGarnetStatus<TObjectContext>(Status status, ref TObjectContext objectContext, ref ObjectOutput output)\n            where TObjectContext : ITsavoriteContext<FixedSpanByteKey, ObjectInput, ObjectOutput, long, ObjectSessionFunctions, StoreFunctions, StoreAllocator>\n        {\n            if (status.IsPending)\n                CompletePendingForObjectStoreSession(ref status, ref output, ref objectContext);\n\n            if (status.IsWrongType)","sourceCodeStart":747,"sourceCodeEnd":783,"githubUrl":"https://github.com/microsoft/garnet/blob/951b0fc6838721f89d102c2bbe1b914e8d39d700/libs/server/Storage/Session/ObjectStore/Common.cs#L747-L783","documentation":"Garnet throws this when an object-store operation (List, Set, SortedSet, Hash commands) is attempted but objectContext.Session is null, meaning the object store was never initialized. The object store is a separate Tsavorite instance for complex data types. It is called from RMWObjectStoreOperation, ReadObjectStoreOperation, and per-type operations (ListOps, SetOps, SortedSetOps). The exception is thrown with disposeSession: false so the session is not torn down.","triggerScenarios":"Executing any object-type command (LPUSH, SADD, ZADD, HSET, etc.) when the object store has not been initialized. This occurs when the server was started without enabling the object store, or in an embedded scenario where only the main (string) store was set up. The code path checks objectContext.Session is null at the entry of every object-store operation.","commonSituations":"Running a Garnet server configured for string-only operations and then issuing a List/Set/Hash/SortedSet command; using an embedded GarnetClient that did not initialize the object store; disabling the object store for memory savings and then running object commands.","solutions":["Enable the object store in the server configuration (ensure ObjectStoreSize / --object-size is set and the object store is not disabled).","If you intended a string-only deployment, switch the client to use only string commands (GET, SET, etc.).","In embedded scenarios, ensure the GarnetServerOptions includes object store configuration and the StoreWrapper initializes both stores."],"exampleFix":"// before (string-only config)\n--object-size 0\n\n// after\n--object-size 1g","handlingStrategy":"validation","validationCode":"// Before issuing object-type commands, check if object store is available\nif (objectContext?.Session is null)\n    throw new InvalidOperationException(\"Object store is not enabled. Configure --object-size to use List/Set/Hash/SortedSet commands.\");","typeGuard":null,"tryCatchPattern":"try { session.LPUSH(key, value); }\ncatch (GarnetException ex) when (ex.Message == \"Object store is disabled\")\n{ Console.Error.WriteLine(\"Object store not configured. Add --object-size to server config.\"); throw; }","preventionTips":["Always enable the object store (--object-size > 0) if clients use non-string data types.","In embedded scenarios, verify both main and object stores are initialized.","Document which commands require the object store in your deployment guide."],"tags":["object-store","configuration","runtime","garnet"],"backgroundTag":null,"analyzedSha":"951b0fc6838721f89d102c2bbe1b914e8d39d700","analyzedAt":"2026-08-13T19:01:32.939Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}