# macOS: Bootstrap failed: 5: Input/output error / launchctl load: Load failed: 5: Input/output error

**Code:** `launchctl: Load failed: 5: Input/output error` · **Category:** macOS · **Seen on:** macOS

launchd couldn't load a LaunchAgent/Daemon plist — it's invalid, already loaded, or has the wrong ownership/permissions.

## Meaning

Validate with `plutil -lint file.plist`, check permissions (LaunchDaemons must be owned by root:wheel and not group-writable), and unload the old job first (`launchctl bootout gui/$(id -u) path`). Prefer `bootstrap`/`bootout` over deprecated `load`/`unload`. `log show --predicate 'subsystem == "com.apple.xpc.launchd"' --last 5m` reveals details.

## Common causes

- Invalid plist syntax or missing keys
- Service already loaded
- Wrong owner/permissions on the plist
- Program path doesn't exist or isn't executable
- Loading a system daemon without sudo

## Quick fix

1. `plutil -lint ~/Library/LaunchAgents/x.plist`
2. `launchctl bootout gui/$(id -u)/label` then `launchctl bootstrap gui/$(id -u) path`
3. `sudo chown root:wheel /Library/LaunchDaemons/x.plist && sudo chmod 644`

## Detailed fix by platform

### macOS

1. `launchctl print gui/$(id -u)/com.example.job` shows state and last exit status

## How to diagnose

1. **Plist** — Valid?
2. **State** — Already loaded?
3. **Perms** — root:wheel 644?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/macos/launchctl-bootstrap-input-output-error)
