How to fix GAB Errors Tutorial

By GG142, published 2 years ago

How to defeat those errors

We're not perfect, and neither is GAB. Everyone makes mistakes, and our mistakes are often translated to errors and warns in your console. Most errors are expected, you probably messed up somewhere with setting your GAB up, and we can't automatically fix it. Some errors however, are unexpected or unknown. Here's a three step plan to handle most of them:

Know your enemy, read the error!

Errors often contain useful information that can direct you to the problem, especially if it's an expected error.

Most errors are known and expected, these type of errors signal that GAB has found an issue with your Configuration or Environment and that it's best not to continue in this way. What does all this hacky talk mean? You've probably messed up somewhere, and the error message should give you a pretty good idea of where.

Don't make someone else's mistake.

Some errors are known but unexpected, these errors are not expected if you followed all documentation closely, but we have faced them before and know their weak spots.

Unexpected errors are almost always characterised by the title
An unexpected error occurred, and we failed to handle it. x.x and when serious, can crash your GAB Shard. If you can't figure the error out on your own, you should ask for help in the GAB Support Server! But wait, before you go and bother others; we've created a list of errors that people often stumble into, so you can spare yourself the trouble of social contact:

  1. MongoError: can't backfill more than 1500000 elements: Since the implementation of GADriver some database schema changes were made that aren't backwards compatible. Your database has not yet been migrated for usage with GADriver. With the --migrate option, GAwesomeBot will attempt to migrate your database. NOTE: This will reset all channel and member data. Other data like server and user data will remain intact.
  2. [ERR_INVALID_ARG_TYPE]: The "url" argument must be of type string. Received type undefined: Since the implementation of GADriver, the database configuration in config.js has been restructured. You might have to install a fresh copy of the file, then fill out the values again manually. If the issue persists, make sure your mongodb module is the correct version. Run npm install to update all your modules to the correct version.

We update this list frequently so make sure to check back every time you face a new foe!

Take the error on alone; use your smarts.

If the community doesn't have the answer, and our list doesn't contain your enemy either, then you're dealing with an unknown and unexpected error, the worst of its kind.

Unknown errors are often a result of a rare situation that we haven't found during extensive bug testing; try to limit any external factors such as process managers, other processes, custom code and try again! Still no luck? You might want to try starting from scratch. Follow the documentation on Self-Hosting closely, make sure all your software versions match with the ones used in the tutorial, and that you use a supported OS. Does the error still not go away? If you have any knowledge and experience with coding in Node.js, it might be worth taking a look at the stack trace and trying to solve the issue yourself. If you manage to; great! Make sure we can all be awed in your ability to slay bugs and open a PR with your bugfix. If you fail to defeat the beast on your own, your last resort effort would be to open an Issue so that we can take a look at the bug, and fix it ourselves. Try to include all information possible in the bug report; it's better to include too much than not enough.

I'm afraid that's all the tricks I have up my sleeve to help you in your battle against the errors, if you have any questions on my magical usage of words you can always drop a question in our support Discord server, and we'll do our best to help out.

Good luck!
-Gilbert, the error slayer.