Developer tools dump stack traces, exit codes, and jargon. Figuring out *what to do next* often means searching the same Stack Overflow answers again.
| Rule( |
| 9 | id="linux.permission_denied", |
| 10 | tool="linux", |
| 11 | title="Permission denied", |
| 12 | why="The process lacked filesystem or execution permission for the target path.", |
| 13 | checks=( |
| 14 | "Do you own the file/directory?", |
| 15 | "Does the file need the executable bit?", |
| 16 | "Should you use sudo only when appropriate?", |
| 17 | ), |
| 18 | fixes=( |
| 19 | "ls -l <path>", |
| 20 | "chmod +x <file> # if it should be executable", |
| 21 | "chown / adjust permissions as needed", |
| 22 | ), |
| 23 | patterns=( |
| 24 | Pattern( |
| 25 | r"Permission denied|Operation not permitted", |
| 26 | kind="regex", |
| 27 | required=True, |
| 28 | ), |
| 29 | ), |
| 30 | confidence="low", |
| 31 | ), |
| 32 | Rule( |
| 33 | id="linux.address_in_use", |
| 34 | tool="linux", |
| 35 | title="Address already in use", |
| 36 | why="A process tried to bind a socket address that is already taken.", |
| 37 | checks=( |
| 38 | "Which process owns the port?", |
| 39 | "Can you stop it or choose another port?", |
| 40 | ), |
| 41 | fixes=( |
| 42 | "lsof -i :<port> # or: ss -tlnp", |
| 43 | "Kill the process or change the listen port", |
| 44 | ), |
| 45 | patterns=( |
| 46 | Pattern("Address already in use", kind="exact", required=True), |
| 47 | ), |
| 48 | confidence="high", |
| 49 | secondary=("bind", "listen"), |
| 50 | ), |
| 51 | Rule( |
| 52 | id="linux.no_such_file", |
| 53 | tool="linux", |
| 54 | title="No such file or directory", |
| 55 | why="A path referenced by the command does not exist.", |
| 56 | checks=( |
| 57 | "Is the path spelled correctly?", |
| 58 | "Are you in the expected working directory?", |
| 59 | "Was the file deleted or never created?", |
| 60 | ), |
| 61 | fixes=( |
| 62 | "ls -la <parent-directory>", |
| 63 | "Create the missing file/directory or fix the path", |
| 64 | ), |
| 65 | patterns=( |
| 66 | Pattern("No such file or directory", kind="exact", required=True), |
| 67 | ), |
| 68 | confidence="medium", |
| 69 | ), |
| 70 | Rule( |
| 71 | id="linux.command_not_found", |
| 72 | tool="linux", |
| 73 | title="Command not found", |
| 74 | why="The shell could not find an executable with that name on PATH.", |
| 75 | checks=( |
| 76 | "Is the tool installed?", |
| 77 | "Is your PATH correct?", |
| 78 | "Is a version manager / venv activated?", |
| 79 | ), |
| 80 | fixes=( |
| 81 | "Install the missing command via your package manager", |
| 82 | "which <command> # or: type <command>", |
| 83 | ), |
| 84 | patterns=( |
| 85 | Pattern( |
| 86 | r"command not found|not recognized as an internal or external command|" |
| 87 | r"The term '.+' is not recognized", |
| 88 | kind="regex", |
| 89 | required=True, |
| 90 | ), |
| 91 | ), |
| 92 | confidence="high", |
| 93 | ), |
| 94 | Rule( |
| 95 | id="linux.disk_full", |
| 96 | tool="linux", |
| 97 | title="No space left on device", |
| 98 | why="A write failed because the filesystem is out of free space (or inodes).", |
| 99 | checks=( |
| 100 | "Which mount is full?", |
| 101 | "Are large logs or node_modules consuming space?", |
| 102 | ), |
| 103 | fixes=( |
| 104 | "df -h", |
| 105 | "du -sh * | sort -h", |
| 106 | "Free space and retry", |
| 107 | ), |
| 108 | patterns=( |
| 109 | Pattern( |
| 110 | r"No space left on device|disk full|ENOSPC", |
| 111 | kind="regex", |
| 112 | required=True, |
| 113 | ), |
| 114 | ), |
| 115 | confidence="high", |
| 116 | ), |
| 117 | Rule( |
| 118 | id="linux.out_of_memory", |
| 119 | tool="linux", |
| 120 | title="Out of memory", |
| 121 | why="The process or system ran out of available memory (OOM).", |
| 122 | checks=( |
| 123 | "Is the machine under memory pressure?", |
| 124 | "Is the process leaking memory or processing huge inputs?", |
| 125 | ), |
| 126 | fixes=( |
| 127 | "Free memory or increase machine/container limits", |
| 128 | "Reduce workload size / enable swap carefully", |
| 129 | ), |
| 130 | patterns=( |
| 131 | Pattern( |
| 132 | r"Out of memory|Cannot allocate memory|ENOMEM|" |
| 133 | r"Killed process .+ out of memory|oom-kill", |
| 134 | kind="regex", |
| 135 | required=True, |
| 136 | ), |
| 137 | ), |
| 138 | confidence="high", |
| 139 | ), |
| 140 | Rule( |
| 141 | id="linux.connection_refused", |
| 142 | tool="linux", |
| 143 | title="Connection refused", |
| 144 | why="Nothing accepted the TCP connection on the target host/port.", |
| 145 | checks=( |
| 146 | "Is the service running?", |
| 147 | "Is the port correct?", |
| 148 | "Is a firewall dropping connections?", |
| 149 | ), |
| 150 | fixes=( |
| 151 | "Start the target service", |
| 152 | "ss -tlnp | grep <port>", |
| 153 | ), |
| 154 | patterns=( |
| 155 | Pattern( |
| 156 | r"Connection refused|connect: Connection refused", |
| 157 | kind="regex", |
| 158 | required=True, |
| 159 | ), |
| 160 | ), |
| 161 | confidence="medium", |
| 162 | ), |
| 163 | Rule( |
| 164 | id="linux.broken_pipe", |
| 165 | tool="linux", |
| 166 | title="Broken pipe", |
| 167 | why="A process wrote to a pipe or socket whose reader had already closed.", |
| 168 | checks=( |
| 169 | "Did the downstream command exit early?", |
| 170 | "Is a pager or consumer closing stdin?", |
| 171 | ), |
| 172 | fixes=( |
| 173 | "Check why the reading process exited", |
| 174 | "Avoid piping into commands that close early if data remains", |
| 175 | ), |
| 176 | patterns=( |
| 177 | Pattern( |
| 178 | r"Broken pipe|EPIPE", |
| 179 | kind="regex", |
| 180 | required=True, |
| 181 | ), |
| 182 | ), |
| 183 | confidence="medium", |
| 184 | ), |
| 185 | Rule( |
| 186 | id="linux.too_many_open_files", |
| 187 | tool="linux", |
| 188 | title="Too many open files", |
| 189 | why="The process hit the OS open file descriptor limit.", |
| 190 | checks=( |
| 191 | "Is the process leaking file handles or sockets?", |
| 192 | "Is ulimit -n too low for this workload?", |
| 193 | ), |
| 194 | fixes=( |
| 195 | "ulimit -n", |
| 196 | "Close unused handles; raise the limit if appropriate", |
| 197 | ), |
| 198 | patterns=( |
| 199 | Pattern( |
| 200 | r"Too many open files|EMFILE|ENFILE", |
| 201 | kind="regex", |
| 202 | required=True, |
| 203 | ), |
| 204 | ), |
| 205 | confidence="high", |
| 206 | ), |
| 207 | ] |