osTicket broken after an update from 1.10.x? This is probably the fix for you.

I recently tried to update my osTicket installation only to find it broken after upgrade with messed up menus and missing ticket queues.

If you’re still using a version of osTicket from 2018 or earlier, you are probably still on 1.10.x or lower. It’s definitely time to upgrade but before you do, there are some important steps you’ll want to follow to ensure a successful upgrade. Keep in mind if you are on osTicket 1.6.x or older, you can’t use the upgrade system at all according to the osTicket documentation for upgrading. You’ll have to migrate the date manually, which is not covered in this article.

So if you’re like me and your osTicket installation is broken after upgrading, take a look at these symptom lists below. If you haven’t tried upgrading yet, skip down to the last resolution below.

Symptom

  • All dropdown menus are broken/have css issues
  • All ticket queues are missing

Resolution

Make sure you are using PHP 7.1+. PHP 5.4 support was never officially dropped from the osTicket system requirements but it clearly causes problems past v1.10.x. Obviously at the time of writing PHP 5.x is EOL as of December 2018 already and should be phased out, but just last year osTicket still required PHP 5.x. So that’s a shame but let’s move past it.

Symptom

  • I managed to get osTicket upgraded to 1.14+ but I still see DB Error #1064 show up occasionally in the logs

Resolution

One or more of your users may be using a saved ticket search left over from an old version of osTicket which is no longer compatible. Deleting and recreating the saved search will resolve the error. See this reply on GitHub.

Symptom

  • I upgraded osTicket and now email fetching isn’t working (ticket responses/requests are not getting processed even when the cron is run manually)

Resolution

After an upgrade, sometimes osTicket needs you to re-enter the password for the account (yes, even if SMTP is still working). Re-enter the password on the email settings page (Admin Panel -> Emails -> (your desk email) -> Password)

Symptom

  • I’m getting database error logs/emails
  • I can’t make any changes to settings or tickets
  • I can’t create new tickets

Resolution

First off, just like the first symptom/resolution in this article, you should make sure you’re on PHP 7.1+ If you’re like me, you already checked that and everything is still broken. So in that case, I hope you have a database backup of your original installation pre-upgrade because it’s time to go back.

Step 1.

Rollback your osTicket database to how it was before everything broke.

Step 2.

Delete osTicket from your server and download the release you were on before everything broke: https://github.com/osTicket/osTicket/releases

Step 3.

After you have osTicket working again, we’re going to approach upgrading in a more incremental manner. osTicket keeps track of all the schema updates between your version and the upgrade, but as with all open source projects sometimes someone makes a minor change that causes retroactive problems for people like us who are behind the times. I’ll assume that you started on osTicket 1.10.x (specifically I was on 1.10.4) but this should apply to other relevant versions as well ( see first paragraph of this article, terms apply).

Download the next major version release, which in my case is 1.11. Upload the files to your server and initiate the upgrade process. Let the upgrade finish, and PHP 5.x users watch as your ticket queue disappears. Switch to PHP 7.1+ to fix this. During this entire process you will probably continue to see DB Error #1064 get logged but rest assured it will be gone by the time you’re done upgrading.

Step 4.

Continuing with our incremental upgrade approach, download the next major version release, which for me will be 1.12. Let it upgrade, and osTicket should still be working fine. Woohoo!

Step 5.

Curiously there is no 1.13 release on GitHub, so we will go with the next best thing: 1.12.5. Same rules apply, upgrade it and watch as nothing breaks. Since there were no schema upgrades, the upgrade will be instantaneous with no prompt to upgrade in osTicket. Version should report as 1.12.5 in Admin Panel. You could probably skip 1.12 and go straight to 1.12.5 if you want, but I’m not 100% sure.

Step 6.

We’re getting closer to 1.14.x. Are your palms sweating yet? Go ahead and install it. While you wait, pat yourself on the back.

Conclusion

You may be wondering why this worked. Unfortunately I don’t have an answer for you. If I had to guess, running the upgrades one by one with PHP 7.1 switched on after leaving 1.10.x may have been the reason it was successful.

Congratulations, your osTicket installation is no longer broken from an upgrade, and the menus and ticket queues are no longer messed up or missing.

I have no idea if all the aforementioned incremental steps were necessary or if this same process could have been done with fewer upgrade steps. However, I know this particular upgrade path worked for me and I don’t want to waste my time going though every single potential upgrade path to find the shortest one. I want to get on with my life, as I’m sure you do. Go back to closing tickets. Don’t forget to delete the setup folder from osTicket’s installation directory and also check out my other articles.

Fix phpMyAdmin displaying PHP code or showing ‘File not found’ on Apache 2.4+ with php-fpm

If you enabled php-fpm after previously using mod_php for Apache, you’ll notice that your phpMyAdmin URL will no longer work. Raw PHP code will be displayed instead of rendering a page. Don’t worry, this hasn’t exposed your db password or any other compromising details.

Fixing the PHP code output

Apache is rendering the raw PHP code because you initially configured it to use mod_php and have disabled that module in favor of php-fpm. phpMyAdmin doesn’t reside within the usual /var/www/html/ directory which uses php-fpm. Therefore you have to add a ProxyPassMatch directive to your Apache site conf to tell it to route any file ending in .php through php-fpm’s socket. Add the following to your site’s conf (default is /etc/apache2/sites-enabled/000-default.conf):

ProxyPassMatch ^/(.*\.php(/.*)?)$ unix:/var/run/php/php7.2-fpm.sock|fcgi://./var/www/html

Next, reload the Apache service:

sudo service apache2 reload

Now if you try to access phpMyAdmin you’ll likely still run into a problem: File not found.

Fixing ‘File not found’

phpMyAdmin is trying to load from /var/www/html/ yet all of its files are stored in /usr/share/phpmyadmin/. You can quickly fix this by adding a symlink from the phpmyadmin directory to the Apache document root:

sudo ln -s /usr/share/phpmyadmin /var/www/html/

Now if you try once more to access phpMyAdmin it should work. If you still encounter File not found you may need to double check that /etc/apache2/conf-enabled/phpmyadmin.conf exists. If it does not, you can add it using another symlink:

sudo ln -s /etc/phpmyadmin/apache.conf /etc/apache2/conf-available/phpmyadmin.conf
a2enconf phpmyadmin
sudo service apache2 reload

Finally if you try again. phpMyAdmin should be working at this point. If you still can’t get into phpMyAdmin, you can try running a re-configuration:

Re-configuring phpMyAdmin

IMPORTANT: Do not allow the reconfiguration to reinstall the phpMyAdmin database in the following steps!

Reconfiguring phpMyAdmin can be helpful if you believe there is something wrong with your Apache configuration for phpMyAdmin. There is a tool which can attempt to correct basic configuration issues with phpMyAdmin. To reconfigure phpMyAdmin:

sudo dpkg-reconfigure -plow phpmyadmin

On the screen that comes up, hit enter to advance to the first step of re-configuration. It will ask you if you want to reinstall the database for phpMyAdmin. Highlight NO and hit Enter. If you reinstall your database you will lose all personal configuration options and may break your phpMyAdmin installation even further.

After selecting No, you will be shown this screen:

phpMyAdmin reconfiguration (step 2)

You should see an astrisk (*) next to apache2 by default, but if not you must select it by pressing your spacebar. Afterwards hit Enter to continue with the apache2 configuration step. You should see output similar to the following to confirm the configuration completed without any issues:

dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
Replacing config file /etc/dbconfig-common/phpmyadmin.conf with new version
Replacing config file /etc/phpmyadmin/config-db.php with new version
dbconfig-common: flushing administrative password
apache2_invoke phpmyadmin: already enabled

You should now be able to use phpMyAdmin again!

Internet stops working while connected to VPN (Cisco AnyConnect)

There is a common issue seen when taking a work laptop home to a new WiFi network. The user’s internet connection becomes unreliable or stops working altogether while the VPN connection is active. Another common symptom is errors using Gmail in the web browser even if other websites load correctly.

The solution is to change the DNS servers on the network connection properties. Any public DNS address can be used – it is suggested to switch to Google DNS.

Windows 10

Type “control panel” into the Start menu search bar and hit enter:


image

Find the network option and click it. Depending on your view settings it could look like either of the following:


image

image

From the lefthand column click “Change adapter settings”


image

From the next screen, right click the connection you are currently using. For laptops this is more than likely called “Wireless Network Adapter 1” or “Wi-Fi” but if you are using a desktop or connected via a cable to your internet you want “Local Area Connection”. Click Properties from the right-click menu.

On the properties menu, click “Internet Protocol Version 4 (TCP/IP)” then click Properties:


image

Make your settings look like the following image, then click OK on all open windows to confirm the settings:


image

Last step: If your internet still doesn’t work while the VPN is active, perform the following:

Type “cmd” into the Start Menu and press enter.
In the screen that opens, type “ipconfig /flushdns” (without quotes) and press enter. You should see the following confirmation:


image