{"record":{"id":"7ae4084ba2f7f163","repo":"kovidgoyal/kitty","slug":"kitty-public-key-has-unknown-version-if-you-are-r","errorCode":null,"errorMessage":"KITTY_PUBLIC_KEY has unknown version, if you are running on a remote system, update kitty on this system","messagePattern":"KITTY_PUBLIC_KEY has unknown version, if you are running on a remote system, update kitty on this system","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"kitty/remote_control.py","lineNumber":528,"sourceCode":"                    ans = f.read().rstrip()\n            except OSError:\n                pass\n    if not ans and opts.password_env:\n        ans = os.environ.get(opts.password_env, '')\n    if not ans and opts.use_password == 'always':\n        raise SystemExit('No password was found')\n    if ans and len(ans) > 1024:\n        raise SystemExit('Specified password is too long')\n    return ans\n\n\ndef get_pubkey() -> tuple[str, bytes]:\n    raw = os.environ.get('KITTY_PUBLIC_KEY', '')\n    if not raw:\n        raise SystemExit('Password usage requested but KITTY_PUBLIC_KEY environment variable is not available')\n    version, pubkey = raw.split(':', 1)\n    if version != RC_ENCRYPTION_PROTOCOL_VERSION:\n        raise SystemExit('KITTY_PUBLIC_KEY has unknown version, if you are running on a remote system, update kitty on this system')\n    from base64 import b85decode\n\n    return version, b85decode(pubkey)\n","sourceCodeStart":510,"sourceCodeEnd":532,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/remote_control.py#L510-L532","documentation":"KITTY_PUBLIC_KEY is versioned ('<protocol-version>:<base85 key>'). If the version prefix doesn't match RC_ENCRYPTION_PROTOCOL_VERSION, the client refuses it — typically a kitty version mismatch between the machine running the kitten and the kitty instance.","triggerScenarios":"KITTY_PUBLIC_KEY exported by an older/newer kitty than the client binary, common when remote-controlling over SSH between systems with different kitty versions.","commonSituations":"SSH remote control between two machines with mismatched kitty versions after an upgrade on one side.","solutions":["Update kitty to the same version on both systems (the machine running the kitten command)","Re-export KITTY_PUBLIC_KEY from the current kitty instance after upgrading"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"from kitty.remote_control import RC_ENCRYPTION_PROTOCOL_VERSION, get_pubkey\nversion,_ = get_pubkey()  # raises if mismatch\n","typeGuard":null,"tryCatchPattern":"except SystemExit as e: print('update kitty on this machine to match the remote:', e)","preventionTips":["Keep kitty versions in sync across hosts used for remote control","Re-login after upgrading so KITTY_PUBLIC_KEY refreshes"],"tags":["kitty","remote-control","version-mismatch"],"backgroundTag":"protocol-version-mismatch","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}