Error messages, explained
104 error messages, each with what it means, why it happened and what to do.
The fixes have costs. git reset --hard discards uncommitted work, a force push can destroy a colleague’s commits, and docker system prune deletes unnamed volumes. Where that is the case, the entry says so.
Git29
Almost every git error is a refusal that means "doing that from this state would lose something"; fatal: means git stopped without changing anything, and the hint: lines under the first line usually carry the actual remedy.
npm20
With npm the cause sits in the first code XXXX line rather than the last six npm ERR! lines, and when the failure comes from the dependency tree or a native build instead of your own code, deleting node_modules and installing again clears about half of them.
JavaScript15
Browser and Node errors usually tell you what broke and not why the value became what it was — you read undefined, it was not a function, it was not JSON — so the place to fix is upstream of the line that threw, and silencing just that line with ?. and default values makes the same problem reappear further away in a form that is harder to recognise.
Python18
A Python traceback splits the answer in two — the last line says what went wrong, the frames above it say where — so reading only the last line gives you the name and loses the place, and for the value-is-missing errors such as NoneType and KeyError the cause almost always sits in a frame above the one that crashed.
Build and types10
Build errors are a tool refusing before anything runs, so they break nothing at the moment they appear — but they do ask two questions: will you fix the type or the path to match the real shape, or will you push that one line through with an as any or a suppression comment — and it is here that the things which are only true on your own machine, letter case, extensions and environment variables, show themselves for the first time.
Docker12
Docker errors only become readable once you place them in a layer — the client failing to reach the daemon, the registry refusing you, a RUN failing during the build, and a container dying the instant it starts are four different problems — and for the build and run layers the line itself is not the reason: the reason is in the output of the command that was running inside, while the cost of each fix differs by layer too.
Reading an error message
- Read from the first line down. The lower you go the more it is about the tool’s internals; the cause is usually at the top.
- If there is a file and a line number, start there — not the top stack frame, but the topmost line that names a file you wrote.
- Search the message verbatim, but strip your own paths and variable names first; those are what stop the search from matching.
- The same condition is worded differently across tool versions. If results look wrong, add the version number to the query.
- Before pasting a fix, check what it throws away. Some of these cannot be undone.
Common questions
Q. Why aren’t the messages translated?
Because you are going to search them. The tool prints English, and a translated message finds nothing. Only the meaning and the remedy follow the language.
Q. The wording on my screen is slightly different.
Tools reword these between versions. If the skeleton matches once you strip your paths and names, it is the same error. When versions differ, add the version number to the query.
Q. Can I just run the fix?
Check what it discards first. git reset --hard, a force push and docker system prune all remove things you cannot get back — the entries say so where that applies.
Q. How do I look up an error that is not here?
Strip your own paths, names and numbers out of the message and search what is left. That remainder is the sentence the tool authors wrote, and it is what matches.