{"record":{"id":"4196e6deeb7667ce","repo":"git-ecosystem/git-credential-manager","slug":"1","errorCode":"-1","errorMessage":"Failed to store credentials","messagePattern":"Failed to store credentials","errorType":"exception","errorClass":"InteropException","httpStatus":null,"severity":"error","filePath":"src/Core/Interop/Linux/SecretServiceCollection.cs","lineNumber":192,"sourceCode":"                    secService,\r\n                    ref schema,\r\n                    attributes,\r\n                    null,\r\n                    fullServiceName, // Use full service name as label\r\n                    secretValue,\r\n                    IntPtr.Zero,\r\n                    out error);\r\n\r\n                if (error != null)\r\n                {\r\n                    int code = error->code;\r\n                    string message = Marshal.PtrToStringAuto(error->message)!;\r\n                    throw new InteropException(\"Failed to store credentials\", code, new Exception(message));\r\n                }\r\n\r\n                if (!result)\r\n                {\r\n                    throw new InteropException(\"Failed to store credentials\", -1);\r\n                }\r\n            }\r\n            finally\r\n            {\r\n                if (attributes != null) g_hash_table_destroy(attributes);\r\n                if (secretValue != null) secret_value_unref(secretValue);\r\n                if (error != null) g_error_free(error);\r\n            }\r\n        }\r\n\r\n        public unsafe bool Remove(string service, string account)\r\n        {\r\n            GHashTable* attributes = null;\r\n            GError* error = null;\r\n\r\n            try\r\n            {\r\n                SecretService* secService = GetSecretService();\r","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/git-ecosystem/git-credential-manager/blob/e8ce762cd04b4100ae637b5fbf39ef9d0a96561e/src/Core/Interop/Linux/SecretServiceCollection.cs#L174-L210","documentation":"Same store path as error 114, but this variant is thrown when secret_password_store_sync returns false with no GError set — the write was reported unsuccessful without a descriptive error — so a generic InteropException with code -1 is thrown.","triggerScenarios":"AddOrUpdate where the native call completes without a GError but its bool result is false: daemon-side silent rejection of the store operation.","commonSituations":"Race with keyring daemon shutdown/restart during the store; unusual daemon implementations (e.g. keepassxc-proxy) returning failure without an error; resource exhaustion inside the daemon.","solutions":["Retry the store once — transient daemon states can cause a silent false return","Check keyring daemon logs (journalctl --user -u gnome-keyring) for the underlying failure","Ensure you are using a standard Secret Service implementation (gnome-keyring/kwallet) and it is healthy","Catch InteropException with Code == -1 to detect the no-detail failure case and surface a generic message"],"exampleFix":"// before\ncollection.AddOrUpdate(service, account, secret); // can throw code -1\n// after\ntry { collection.AddOrUpdate(service, account, secret); }\ncatch (InteropException ex) when (ex.Code == -1) { RetryWithBackoff(() => collection.AddOrUpdate(service, account, secret)); }","handlingStrategy":"retry","validationCode":"// Silent-failure path: no pre-validation possible; enable retry.\nint attempts = 0;","typeGuard":null,"tryCatchPattern":"try { collection.AddOrUpdate(s, a, secret); }\ncatch (InteropException ex) when (ex.Code == -1 && ++attempts < 3) { Thread.Sleep(200 * attempts); retry:; }","preventionTips":["Retry transient store failures with backoff","Monitor keyring daemon restarts (journalctl --user -u gnome-keyring)","Prefer standard Secret Service implementations over third-party bridges","Treat code -1 as 'unknown daemon failure' in telemetry"],"tags":["linux","keyring","credentials","dbus"],"backgroundTag":"database-write-failed","analyzedSha":"e8ce762cd04b4100ae637b5fbf39ef9d0a96561e","analyzedAt":"2026-09-11T17:15:08.753Z","contentChangedAt":"2026-09-11T17:15:08.753Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}