{"record":{"id":"741f4a78787af5e2","repo":"ComposioHQ/composio","slug":"baddataformat","errorCode":"BadDataFormat","errorMessage":"BadDataFormat","messagePattern":"BadDataFormat","errorType":"error_code","errorClass":"KeyringError","httpStatus":null,"severity":"error","filePath":"ts/packages/cli-keyring/src/stores/linux-secret-tool.ts","lineNumber":195,"sourceCode":"\n    let result: SpawnResult;\n    try {\n      result = await runCommand({ command: SECRET_TOOL_BIN, args });\n    } catch (err) {\n      throw this.spawnErrorToKeyringError(err);\n    }\n\n    if (result.code === 0) {\n      const stdout = bytesToUtf8(result.stdout);\n      // `secret-tool lookup` prints the password without a trailing\n      // newline when found, and prints nothing (exit 0) when not found.\n      if (stdout.length === 0) {\n        throw new KeyringError({ kind: 'NoEntry' });\n      }\n      try {\n        return decodeSecret(stdout);\n      } catch (err) {\n        throw new KeyringError({\n          kind: 'BadDataFormat',\n          bytes: new Uint8Array(result.stdout),\n          cause: err,\n        });\n      }\n    }\n\n    // Exit 1 can mean many things — stderr is the real signal.\n    throw classifyFailure(result, 'secret-tool lookup');\n  }\n\n  async deleteCredential(service: string, user: string, modifiers: EntryModifiers): Promise<void> {\n    validateSpecifier(service, user);\n    if (missingDBus()) {\n      throw new KeyringError({\n        kind: 'NoStorageAccess',\n        cause: new Error(\n          'D-Bus session bus not available — no DBUS_SESSION_BUS_ADDRESS and no /run/user/<uid>/bus'","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/ComposioHQ/composio/blob/64b1b85502b1beeb2379e6c9e8bf1104504fa637/ts/packages/cli-keyring/src/stores/linux-secret-tool.ts#L177-L213","documentation":"secret-tool returned data but decodeSecret could not parse it back into bytes (e.g. the stored value is not in the expected encoded form). KeyringError kind 'BadDataFormat' wraps the decode error along with the raw bytes.","triggerScenarios":"Reading a credential that was written by another tool or an older encoding scheme, or a manually edited keyring entry.","commonSituations":"Version mismatches between writer and reader, interoperating with gnome-keyring entries created outside this library.","solutions":["Delete and re-store the credential with the current library version","Confirm both writer and reader use the same library/encoding version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"catch (e) { if (e instanceof KeyringError && e.kind === 'BadDataFormat') { await store.deleteCredential(service, user, mods); await reauthorize(); } else throw e; }","preventionTips":["Keep writer and reader library versions in sync","Re-store credentials after major version upgrades"],"tags":["keyring","encoding","linux","typescript"],"backgroundTag":"stored-data-corrupt","analyzedSha":"64b1b85502b1beeb2379e6c9e8bf1104504fa637","analyzedAt":"2026-08-28T15:39:33.623Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}