{"record":{"id":"b655b0577ee8d93f","repo":"kovidgoyal/kitty","slug":"no-password-was-found","errorCode":null,"errorMessage":"No password was found","messagePattern":"No password was found","errorType":"console","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"kitty/remote_control.py","lineNumber":516,"sourceCode":"            else:\n                ans = sys.stdin.read().rstrip()\n                try:\n                    tty_fd = os.open(os.ctermid(), os.O_RDONLY | os.O_CLOEXEC)\n                except OSError:\n                    pass\n                else:\n                    with open(tty_fd, closefd=True):\n                        os.dup2(tty_fd, sys.stdin.fileno())\n        else:\n            try:\n                with open(resolve_custom_file(opts.password_file)) as f:\n                    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":498,"sourceCodeEnd":532,"githubUrl":"https://github.com/kovidgoyal/kitty/blob/6d5d0c440603ad9bdf6dcd599f73f6dde21acb44/kitty/remote_control.py#L498-L532","documentation":"When --use-password=always, the client must find a password (from the file or --password-env); if none is found it exits via SystemExit 'No password was found'.","triggerScenarios":"Running kitten remote-control with use_password='always' but no password file readable and the password_env variable unset/empty.","commonSituations":"Scripts requiring authentication without provisioning the password environment variable or file.","solutions":["Set the password environment variable (e.g. KITTY_RC_PASSWORD) matching --password-env","Or write the password to the expected file path","Or use --use-password=no if authentication is not required"],"exampleFix":"# before\nkitten @send-text --use-password always 'hi'\n# after\nKITTY_RC_PASSWORD=secret kitten @send-text --use-password always --password-env KITTY_RC_PASSWORD 'hi'","handlingStrategy":"validation","validationCode":"import os\nassert os.environ.get(PASSWORD_ENV), 'password env var not set'","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision --password-env in wrapper scripts","Avoid --use-password always unless credentials are guaranteed"],"tags":["kitty","remote-control","authentication"],"backgroundTag":"missing-credentials","analyzedSha":"6d5d0c440603ad9bdf6dcd599f73f6dde21acb44","analyzedAt":"2026-08-27T14:20:20.142Z","schemaVersion":2},"datasetVersion":"2026-08-27T19:17:21.184Z"}