kovidgoyal/kitty · error
%s is not a valid type signature: %w
Error message
%s is not a valid type signature: %w
What it means
ParseValueWithSignature strips a leading '@' from the signature and hands it to dbus.ParseSignature; if the remaining string is not a valid D-Bus type signature (e.g. 'uu' where 'u' is expected, or 'x'), this error is returned.
Source
Thrown at kittens/desktop_ui/portal.go:237
"ChangeSetting": {{"namespace", "s", false}, {"key", "s", false}, {"value", "v", false}},
"RemoveSetting": {{"namespace", "s", false}, {"key", "s", false}},
}
props["version"].Value = uint32(1)
if err = ExportInterface(self.bus, self, CHANGE_SETTINGS_INTERFACE, KITTY_OBJECT_PATH, methods, props, nil); err != nil {
return
}
return
}
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 boolView on GitHub (pinned to 6d5d0c4406)
Solutions
- Use a single valid D-Bus signature character/structure, e.g. '@u', '@s', '@b', '@(ii)'
- Consult the GVariant type string documentation
- Omit the signature entirely and let ParseValue guess the type
Example fix
# before kitten desktop-ui set ns key --value-type '@uint32' 1 # after kitten desktop-ui set ns key --value-type '@u' 1
Defensive patterns
Strategy: validation
Validate before calling
sig := strings.TrimPrefix(sig, "@")
if _, err := dbus.ParseSignature(sig); err != nil {
return fmt.Errorf("bad signature %q", sig)
} Type guard
func isValidSignature(s string) bool {
s = strings.TrimPrefix(s, "@")
_, err := dbus.ParseSignature(s)
return err == nil
} Prevention
- Use single-character signatures (u, s, b, x)
- Validate signatures against dbus.ParseSignature before passing them on
When it happens
Trigger: Calling set with a --value-type/signature argument like '@q', '@ii', or an empty-after-@ signature.
Common situations: Users unfamiliar with GVariant type strings passing full type names ('uint32') instead of signature characters ('u'), or concatenating multiple type characters.
Related errors
- could not guess the data type of: %s with error: %w
- %s is not a valid value for signature: %#v with error: %w
- failed to export interface: %s at object path: %s with error
- failed to export properties with error: %w
- failed to export introspected methods with error: %w
AI-assisted analysis of kovidgoyal/kitty@6d5d0c4406 (2026-08-27).
Data as JSON: /api/errors/8c4ec1e920da5559.
Report an issue: GitHub.