{"record":{"id":"3bee89d8b597581c","repo":"kovidgoyal/kitty","slug":"s-is-not-a-valid-value-for-signature-v-with-er","errorCode":null,"errorMessage":"%s is not a valid value for signature: %#v with error: %w","messagePattern":"(.+?) is not a valid value for signature: %#v with error: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"kittens/desktop_ui/portal.go","lineNumber":245,"sourceCode":"}\n\nfunc ParseValueWithSignature(value, value_type_signature string) (v dbus.Variant, err error) {\n\tvar s dbus.Signature\n\tif value_type_signature != \"\" {\n\t\tif value_type_signature[0] == '@' {\n\t\t\tvalue_type_signature = value_type_signature[1:]\n\t\t}\n\t\ts, err = dbus.ParseSignature(value_type_signature)\n\t\tif err != nil {\n\t\t\treturn dbus.Variant{}, fmt.Errorf(\"%s is not a valid type signature: %w\", value_type_signature, err)\n\t\t}\n\t}\n\tv, err = dbus.ParseVariant(value, s)\n\tif err != nil {\n\t\tif value_type_signature == \"\" {\n\t\t\treturn dbus.Variant{}, fmt.Errorf(\"could not guess the data type of: %s with error: %w\", value, err)\n\t\t}\n\t\treturn dbus.Variant{}, fmt.Errorf(\"%s is not a valid value for signature: %#v with error: %w\", value, value_type_signature, err)\n\t}\n\treturn v, nil\n}\n\nfunc ParseValue(value string) (dbus.Variant, error) {\n\treturn ParseValueWithSignature(value, \"\")\n}\n\ntype ShowSettingsOptions struct {\n\tAsJson             bool\n\tAllowOtherBackends bool\n\tInNamespace        []string\n}\n\nfunc fetch_settings(conn *dbus.Conn, namespaces ...string) (ans ReadAllType, err error) {\n\tpath := \"/\" + strings.ToLower(strings.ReplaceAll(DESKTOP_PORTAL_NAME, \".\", \"/\"))\n\tobj := conn.Object(DESKTOP_PORTAL_NAME, dbus.ObjectPath(path))\n\tinterface_name := strings.ReplaceAll(DESKTOP_PORTAL_NAME, \"Desktop\", \"Settings\")","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kittens/desktop_ui/portal.go#L227-L263","documentation":"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.","triggerScenarios":"Passing 'hello' with signature '@u', or '1,2' with signature '@i', etc. — any value/signature mismatch.","commonSituations":"Wrong signature guessed for a setting; values from other tools that use different scalar syntax; boolean passed as 'yes'/'1' instead of 'true'/'false'.","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"],"exampleFix":"# before\nkitten desktop-ui set ns key --value-type '@u' hello\n# after\nkitten desktop-ui set ns key --value-type '@s' 'hello'","handlingStrategy":"validation","validationCode":"if _, err := dbus.ParseVariant(value, mustSignature(sig)); err != nil {\n    return fmt.Errorf(\"value %q does not match signature %q\", value, sig)\n}","typeGuard":null,"tryCatchPattern":"v, err := portal.ParseValueWithSignature(value, sig)\nif err != nil {\n    // fall back to guessing, or surface signature mismatch to the user\n}","preventionTips":["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)"],"tags":["dbus","gvariant","desktop-ui","type-mismatch"],"backgroundTag":"gvariant-value-signature-mismatch","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}