redis/redis-rb · error · ArgumentError
values must not be empty
Error message
values must not be empty
What it means
Error "values must not be empty" thrown in redis/redis-rb.
Source
Thrown at lib/redis/commands/hashes.rb:519
#
# The fieldset must exist on the executing connection, otherwise the
# server replies with a "no such fieldset" error.
#
# @note HIMPORT support is experimental: the client API may change in a
# future minor release without a major version bump.
#
# @example
# redis.himport_set("shared:1", "shared", ["alice", "alice@example.com", "25"])
# # => "OK"
#
# @param [String] key hash key to create or overwrite
# @param [String] fieldset_name fieldset previously prepared on this connection
# @param [String, Array<String>] values one or more values, order preserved
# @return [String] `"OK"`
# @api experimental
def himport_set(key, fieldset_name, *values)
values.flatten!(1)
raise ArgumentError, "values must not be empty" if values.empty?
send_command([:himport, "SET", key, fieldset_name].concat(values))
end
# Remove +fieldset_name+ from this connection's session. Keys already
# written through the fieldset are not affected.
#
# @note HIMPORT support is experimental: the client API may change in a
# future minor release without a major version bump.
#
# @param [String] fieldset_name
# @return [Integer] `1` if the fieldset was removed, `0` if it did not exist
# @api experimental
def himport_discard(fieldset_name)
send_command([:himport, "DISCARD", fieldset_name])
end
# Remove all fieldsets from this connection's session.View on GitHub (pinned to 2ba9010b91)
Solutions
- Pass at least one field/value pair to the command; do not call it with an empty values list.
- Check the calling code for an empty array or hash being splatted into the command and guard it with a presence check.
When it happens
Trigger: Thrown at lib/redis/commands/hashes.rb:519 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of redis/redis-rb@2ba9010b91 (2026-08-23).
Data as JSON: /api/errors/14c173fd1f2f8fd1.
Report an issue: GitHub.