{"record":{"id":"f88f1802aec7d9b6","repo":"quarkusio/quarkus","slug":"at-least-store-or-storedist-must-be-set","errorCode":null,"errorMessage":"At least `STORE` or `STOREDIST` must be set","messagePattern":"At least `STORE` or `STOREDIST` must be set","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/geo/GeoRadiusStoreArgs.java","lineNumber":136,"sourceCode":"     * Store the items in a sorted set populated with their distance from the center as a floating point number, in the\n     * same unit specified in the radius.\n     *\n     * @param storeDistKey the storeDistKey value\n     * @return the current {@code GeoRadiusStoreArgs}\n     **/\n    public GeoRadiusStoreArgs<K> storeDistKey(K storeDistKey) {\n        this.storeDistKey = storeDistKey;\n        return this;\n    }\n\n    @Override\n    public List<Object> toArgs(Codec codec) {\n        // Validation\n        if (any && count == -1) {\n            throw new IllegalArgumentException(\"ANY can only be used if COUNT is also set\");\n        }\n        if (storeDistKey == null && storeKey == null) {\n            throw new IllegalArgumentException(\"At least `STORE` or `STOREDIST` must be set\");\n        }\n\n        List<Object> list = new ArrayList<>();\n        if (withDistance) {\n            list.add(\"WITHDIST\");\n        }\n        if (withCoordinates) {\n            list.add(\"WITHCOORD\");\n        }\n        if (withHash) {\n            list.add(\"WITHHASH\");\n        }\n\n        if (count > 0) {\n            list.add(\"COUNT\");\n            list.add(Long.toString(count));\n        }\n","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/quarkusio/quarkus/blob/e1c734241f34c7919086ceb4c9262b4a58f6de44/extensions/redis-client/runtime/src/main/java/io/quarkus/redis/datasource/geo/GeoRadiusStoreArgs.java#L118-L154","documentation":"GEOSEARCHSTORE-style operations using GeoRadiusStoreArgs must write results somewhere: either STORE (store geo members) or STOREDIST (store distances). If neither store key is configured, toArgs refuses to build a command and throws IllegalArgumentException, because the corresponding Redis command would be invalid/pointless for a storing variant.","triggerScenarios":"Passing a GeoRadiusStoreArgs instance to a georadiusstore/geosearchstore call where neither storeStoreKey(...) nor storeDist(...) (or equivalent setters for storeKey/storeDistKey) was called.","commonSituations":"Developer intends a read-only GEORADIUS but uses the store args type; a storeKey setter call was dropped during refactor; args built generically without knowing whether a destination key was supplied.","solutions":["Set a store key via the store(...) method before invoking the command","Set a store-distance key via storeDistance(...) if distances should be persisted","Use the non-storing geo args/commands if you only want results returned, not stored"],"exampleFix":"// before\nGeoRadiusStoreArgs<String> args = GeoRadiusStoreArgs.fromMember(\"palermo\");\ngeoStore.geoSearchStore(\"result\", \"key\", args); // throws\n// after\nGeoRadiusStoreArgs<String> args = GeoRadiusStoreArgs.fromMember(\"palermo\")\n    .store(\"result\");\ngeoStore.geoSearchStore(\"result\", \"key\", args);","handlingStrategy":"validation","validationCode":"if (storeKey == null && storeDistKey == null) { throw new IllegalStateException(\"geosearchstore needs a store key\"); }","typeGuard":null,"tryCatchPattern":"try { geo.geoSearchStore(dest, key, args); } catch (IllegalArgumentException e) { log.error(\"Store key missing: \" + e.getMessage()); }","preventionTips":["Decide upfront whether results are stored or returned, and pick the matching args type","Always call store(...) or storeDistance(...) on store args","Never reuse plain GeoSearchArgs-like objects for store commands"],"tags":["redis","geo","illegal-argument","missing-required-option"],"backgroundTag":"missing-required-option","analyzedSha":"e1c734241f34c7919086ceb4c9262b4a58f6de44","analyzedAt":"2026-09-05T17:01:29.979Z","contentChangedAt":"2026-09-05T17:01:29.979Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}