Errors

Unfortunately, errors happen. If one does occur, it might be our fault and it might be your fault. When roots throws an error that we have recognized is possible, we try to throw it with as clear and human-readable an error message as possible to make it easy to see where things went downhill. Documented here are all the error codes that roots can throw. It's certainly possible that there's an error that doesn't match any of these, if so please file an issue!

The numbers you see here are unix error codes. They start at 125 because this is where the standard error codes end. If you are using roots programatically, expect for the program to exit with the same code as is documented here.

125 - Malformed Extension

This error means that you fed roots an extension of the incorrect type. To fix this, check the specific error message that roots gave you, read through the extension docs linked above, and make sure that everything is formatted correctly. If you are having trouble writing an extension, feel free to drop in to the roots support channel.

126 - Malformed Write Hook Output

This error means that your extension's write hook returned incorrectly formatted output. See the docs for write hooks (linked above) for more details on how to correct this.

EMFILE, too many open files

This occurs when roots hits the maximum limit of open files on a UNIX system (more specifically the number file descriptors that can be assigned). Unfortunately, the default value on most Mac OS X machines is 1024, and a large roots project can easily exceed this value. In order to fix the issue, run:

$ ulimit -n <NEW_LIMIT>

For example, ulimit -n 10000 will raise the open file limit to 10000. For more information, check out Isaac Schlueter's blog post on the topic.

EADDRINUSE, address in use

This occurs when you are trying to run two roots sites at the same time, on the same port. To fix this error, cancel the watcher on the other roots site you are running in a different terminal tab and try again. If you want to run two roots sites at once, you can call roots watch --port XXX or set the PORT environment variable to another value.

EACCES, permission denied

This error pops up frequently for people that are new to the unix command line. Contrary to popular belief, it is not an error with roots, it's an error with the permissions on your computer.

To learn more about unix permissions, check out this article. You can use the chmod or chown commands to change the permissions of a file or directory. Typically, I'll recommend running sudo chown -R $USER /usr/local/lib && sudo chown -R /usr/local/bin to those using OSX (do not run this with linux), which will resolve many permissions issues, but this can be dangerous if you don't fully understand what it's doing. For a slightly safer and more thorough method, check out this great article on installing npm modules globally without sudo.

If you are having this problem, please do not file an issue on roots, as it's not a problem with roots. Check out the articles above, read the full error message you are getting and make sure you have changed the permissions on the mentioned files and/or directories such that they are correct, and it should work fine. If you are still struggling, you can ask in the roots gitter room and someone might be able to help.