{"record":{"id":"013345fcc2acf431","repo":"xpipe-io/xpipe","slug":"category-with-id-msg-getcategory-does-no","errorCode":null,"errorMessage":"Category with id \" + msg.getCategory() + \" does not exist","messagePattern":"Category with id \" \\+ msg\\.getCategory\\(\\) \\+ \" does not exist","errorType":"exception","errorClass":"BeaconClientException","httpStatus":400,"severity":"error","filePath":"app/src/main/java/io/xpipe/app/beacon/api/StoreAddExchange.java","lineNumber":60,"sourceCode":"        if (foundStore.isPresent()) {\n            return Response.builder().store(foundStore.get().getUuid()).build();\n        }\n\n        var foundName = DataStorage.get().getStoreEntryIfPresent(msg.getName());\n        if (foundName.isPresent()) {\n            var foundNameStore = foundName.get().getStore();\n            // Only allow updates for the same type of store\n            if (foundNameStore != null && foundNameStore.getClass().equals(store.getClass())) {\n                DataStorage.get().updateEntryStore(foundName.get(), store);\n                return Response.builder().store(foundName.get().getUuid()).build();\n            }\n        }\n\n        if (msg.getCategory() != null\n                && DataStorage.get()\n                        .getStoreCategoryIfPresent(msg.getCategory())\n                        .isEmpty()) {\n            throw new BeaconClientException(\"Category with id \" + msg.getCategory() + \" does not exist\");\n        }\n\n        var entry = DataStoreEntry.createNew(msg.getName(), store);\n        if (msg.getCategory() != null) {\n            entry.setCategoryUuid(msg.getCategory());\n        }\n        try {\n            DataStorage.get().addStoreEntryInProgress(entry);\n            if (msg.getValidate()) {\n                entry.validateOrThrow();\n            } else {\n                store.checkComplete();\n            }\n        } catch (Throwable ex) {\n            if (ex instanceof ValidationException) {\n                ErrorEventFactory.expected(ex);\n            } else if (ex instanceof StackOverflowError) {\n                // Cycles in connection graphs can fail hard but are expected","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/xpipe-io/xpipe/blob/d85ca821baa46092a320ebb13546d7240adb74f8/app/src/main/java/io/xpipe/app/beacon/api/StoreAddExchange.java#L42-L78","documentation":"When adding a store with an explicit category UUID, StoreAddExchange verifies the category exists in DataStorage. If the supplied category UUID does not match any known store category, the request is rejected so the store is not created under a dangling category.","triggerScenarios":"Calling store/add with a non-null 'category' field whose UUID is not a registered store category (typo, store from another machine, category deleted, or sending an entry UUID instead of a category UUID).","commonSituations":"Hard-coding a category UUID from a different XPipe installation; category removed after scripts were written; confusing connection UUIDs with category UUIDs.","solutions":["Look up the correct category UUID via the store/category beacon listing API and use that value","Omit the 'category' field to add the store to the default category","Create the category first, then add the store referencing its new UUID","Validate the UUID client-side before the call"],"exampleFix":"// before\nclient.storeAdd(name, data, \"d1e0...possibly-deleted-uuid\");\n// after\nvar cat = DataStorage.get().getStoreCategoryIfPresent(uuid);\nif (cat.isEmpty()) { uuid = DataStorage.DEFAULT_CATEGORY_UUID; }\nclient.storeAdd(name, data, uuid);","handlingStrategy":"validation","validationCode":"if (categoryUuid != null &&\n    DataStorage.get().getStoreCategoryIfPresent(UUID.fromString(categoryUuid)).isEmpty()) {\n    throw new IllegalArgumentException(\"category does not exist\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    client.storeAdd(request);\n} catch (BeaconClientException ex) {\n    if (ex.getMessage().contains(\"does not exist\")) {\n        request.setCategory(null); // retry with default category\n    } else throw ex;\n}","preventionTips":["Fetch category UUIDs from the API, never hard-code","Omit category for default placement","Confirm the UUID is a category, not an entry"],"tags":["category","store","not-found","xpipe"],"backgroundTag":"entity-not-found","analyzedSha":"d85ca821baa46092a320ebb13546d7240adb74f8","analyzedAt":"2026-09-06T14:30:08.251Z","contentChangedAt":"2026-09-06T14:30:08.251Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}