Start a conversation

Why am I getting an error that says 'Get() on a non-object'?

We're actively rewriting our user guide, so check back for improved coverage.

In short, this error appears to Download customers when Kayako is unable to establish a connection with your database. The trouble is, there are multiple factors involved in establishing that connection, any of which could be the culprit. In this article, we'll help you diagnose what exactly is disrupting your connection so you can go about resolving it.

We're going to go through several steps to troubleshoot the issue: 

  • We'll check to make sure that all of the required PHP plugins are in place.
  • We'll take a look at your config.php file to make sure everything is in order.
  • We'll double-check that your database credentials are still valid.
  • And if we still haven't found the problem, we'll show you how to edit a settings file in order to make it divulge the specific problem that it's encountering. 

Check your PHP plugins

Kayako officially supports MySQL for its database system and relies on PHP to initiate all connections to MySQL. PHP offers several MySQL extensions for accessing a MySQL database. Kayako uses the following extensions:

  • MySQL - required for all versions of PHP
  • MySQLi - required for PHP 5.5.x or later
  • MySQLnd - required for PHP 5.5.x or later

To check which extensions you have installed, consult your PHPInfo page or ask your server administrator to check it for you. 

NOTE: You can double-check the rest of Kayako's server requirements.

Review your 'config.php' file

If all of your PHP extensions are present and accounted for, the next thing to look at is your server connection configuration. From your Kayako root directory, if you navigate to '__swift/config/' and open up the 'config.php' file, you'll see that it's full of database connection parameters. 

There are a few things you should double-check here:

  • Make sure that you have a 'config.php' file. If you've updated Kayako, there's a good possibility that you may have, instead, a 'config.php.new' file in this directory, waiting to be activated. If this is the case, remove the '.new' from the filename, open it up, and fill in your database details. 
  • Double-check your database details. The 'config.php' file should reflect your current server details. The fields you want to check are as follows:
    DB_HOSTNAME, DB_USERNAME, DB_PASSWORD, DB_NAME

Validate your database credentials

If everything in your 'config.php' file looks right, the next  step is to make sure that your server credentials are still  valid. The easiest way to validate the database credentials is to  run the following MySQL command:

mysql -h DB_HOSTNAME -u DB_USERNAME -p DB_NAME

If you get an error here, you'll need to talk to your server  admin for up-to-date credentials and then swap them into your  'config.php' file. If the command runs without any problems,  though, then you know your credentials are still in good shape.  Time to move on to our last resort. 

Force your server to just tell you the problem

If you've gone through each of the steps above and haven't  found the source of the problem, it's time to just ask the server  directly. From your root directory, go into the  '__swift/models/Settings/' directory and open up the  'class.SWIFT_Settings.php' file. 

Scroll down to line 53 and comment it out, by adding '//' at  the beginning of the line. It should look like this:

  // $this->ReplaceLocalCache($_SWIFT->Cache->Get('settingscache'));

Save and update the file, and then navigate to your support  site. Commenting out that line should display a more detailed  error message here on your page. Copy the error message and get in touch with our support team so we can help  you resolve the problem. 

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Chirag Jain

  2. Posted
  3. Updated