kovidgoyal/kitty · error
is not a valid value for signature: %#v with error
Error message
%s is not a valid value for signature: %#v with error: %w
What it means
A type signature was supplied and parsed successfully, but the value string still cannot be parsed as that type by dbus.ParseVariant. The offending value and signature are both included.
Solutions
- Match the value to the signature: use 'true'/'false' for @b, digits for @u/@i/@x, quoted text for @s
- Read the setting's expected type from the portal settings docs or show-settings output
- Use the exact GVariant text format documented at docs.gtk.org/glib/gvariant-text-format.html
Example fix
# before kitten desktop-ui set ns key --value-type '@u' hello # after kitten desktop-ui set ns key --value-type '@s' 'hello'
Defensive patterns
Strategy: validation
Validate before calling
if _, err := dbus.ParseVariant(value, mustSignature(sig)); err != nil {
return fmt.Errorf("value %q does not match signature %q", value, sig)
} Try / catch
v, err := portal.ParseValueWithSignature(value, sig)
if err != nil {
// fall back to guessing, or surface signature mismatch to the user
} Prevention
- Read the setting's current type with show-settings before writing
- Match value syntax to the signature (true/false for b, digits for u/i/x)
When it happens
Trigger: Passing 'hello' with signature '@u', or '1,2' with signature '@i', etc. — any value/signature mismatch.
Common situations: Wrong signature guessed for a setting; values from other tools that use different scalar syntax; boolean passed as 'yes'/'1' instead of 'true'/'false'.
Related errors
- could not guess the data type of
- is not a valid type signature
- can't register D-Bus name: name already taken
- could not connect to session D-Bus
- failed to connect to system bus with error
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/3bee89d8b597581c.
Report an issue: GitHub.
Appendix: source
Thrown at kittens/desktop_ui/portal.go:245
}
func ParseValueWithSignature(value, value_type_signature string) (v dbus.Variant, err error) {
var s dbus.Signature
if value_type_signature != "" {
if value_type_signature[0] == '@' {
value_type_signature = value_type_signature[1:]
}
s, err = dbus.ParseSignature(value_type_signature)
if err != nil {
return dbus.Variant{}, fmt.Errorf("%s is not a valid type signature: %w", value_type_signature, err)
}
}
v, err = dbus.ParseVariant(value, s)
if err != nil {
if value_type_signature == "" {
return dbus.Variant{}, fmt.Errorf("could not guess the data type of: %s with error: %w", value, err)
}
return dbus.Variant{}, fmt.Errorf("%s is not a valid value for signature: %#v with error: %w", value, value_type_signature, err)
}
return v, nil
}
func ParseValue(value string) (dbus.Variant, error) {
return ParseValueWithSignature(value, "")
}
type ShowSettingsOptions struct {
AsJson bool
AllowOtherBackends bool
InNamespace []string
}
func fetch_settings(conn *dbus.Conn, namespaces ...string) (ans ReadAllType, err error) {
path := "/" + strings.ToLower(strings.ReplaceAll(DESKTOP_PORTAL_NAME, ".", "/"))
obj := conn.Object(DESKTOP_PORTAL_NAME, dbus.ObjectPath(path))
interface_name := strings.ReplaceAll(DESKTOP_PORTAL_NAME, "Desktop", "Settings")View on GitHub (pinned to 6d5d0c4406)