Ubuntu 14.04 privacyIdea 2.20 Upgrade results in SQL errors

I have performed an apt-get upgrade on a privacyIdea server running on Ubuntu 14.04 LTS. It was originally at version 2.13 and was upgraded to 2.20. Most things appear to still be working. I can authenticate with tokens and perform most token activities. However, when I try, as a user, to enroll a new token, the User Policy is not being enforced. Furthermore, if I log in as the admin and go to edit that User Policy, none of the actions show up. I see a brief flash of what seems like it attempting to display them, then nothing. I can’t seem very many log errors, save for a couple below that were generated when I pulled up the existing policy and then clicked “Create Policy”. If I try to make a NEW policy, I also don’t get any actions listed, but clicking “Create Policy” will actually create the (blank) policy without an error.

I feel like the Ubuntu apt-get upgrade process missed something. We tried upgrading this to an earlier privacyIdea version some months ago and ran in to odd problems with the upgrade that that time as well. The documentation seems to indicate that using apt-get is an acceptable form of upgrading privacyIDEA, and that no extra steps are involved. Is this not the case?

[2017-10-25 14:47:04,773][1309][-1256879296][ERROR][privacyidea.lib.auditmodules.sqlaudit:238] exception ProgrammingError(’(ProgrammingError) (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), ‘’, ‘admin’, ‘myrealm_User_Policy1’, ‘{u\\‘realm\\’: [u\\\\\‘myrealm\\\\\’], u\\‘action\\’: [u\\\\\’ at line 1”)’,) [2017-10-25 14:47:04,774][1309][-1256879296][ERROR][privacyidea.lib.auditmodules.sqlaudit:239] DATA: {‘info’: u"{u’realm’: [u’myrealm’], u’action’: [u’setpin’, u’resync’, u’auditlog’, u’hotp_hashlib=sha256’, u’enrollHOTP’, u’reset’, u’disable’, u’hotp_otplen=8’, u’hotp_force_server_generate’, u’delete’], u’client’: [], u’user’: [], u’resolver’: u’’, u’time’: u’’, u’active’: True, u’scope’: u’user’, u’adminrealm’: []}", ‘administrator’: u’admin’, ‘realm’: [u’myrealm’], ‘success’: True, ‘privacyidea_server’: ‘tokensdev.mydomain.com’, ‘client_user_agent’: ‘firefox’, ‘token_type’: None, ‘client’: ‘10.10.10.3’, ‘user’: ‘’, ‘resolver’: ‘’, ‘action_detail’: u’myrealm_User_Policy1’, ‘action’: ‘POST /policy/’, ‘serial’: None}
[2017-10-25 14:47:35,603][1309][-1365984448][ERROR][privacyidea.lib.auditmodules.sqlaudit:238] exception ProgrammingError(’(ProgrammingError) (1064, “You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '), ‘’, ‘admin’, ‘myrealm_User_Policy1’, ‘{u\\‘realm\\’: [u\\\\\‘myrealm\\\\\’], u\\‘action\\’: [u\\\\\’ at line 1”)’,) [2017-10-25 14:47:35,603][1309][-1365984448][ERROR][privacyidea.lib.auditmodules.sqlaudit:239] DATA: {‘info’: u"{u’realm’: [u’myrealm’], u’action’: [u’setpin’, u’resync’, u’auditlog’, u’hotp_hashlib=sha256’, u’enrollHOTP’, u’reset’, u’disable’, u’hotp_otplen=8’, u’hotp_force_server_generate’, u’delete’], u’client’: [], u’user’: [], u’resolver’: u’’, u’time’: u’’, u’active’: True, u’scope’: u’user’, u’adminrealm’: []}", ‘administrator’: u’admin’, ‘realm’: [u’myrealm’], ‘success’: True, ‘privacyidea_server’: ‘tokensdev.mydomain.com’, ‘client_user_agent’: ‘firefox’, ‘token_type’: None, ‘client’: ‘10.10.10.3’, ‘user’: ‘’, ‘resolver’: ‘’, ‘action_detail’: u’myrealm_User_Policy1’, ‘action’: ‘POST /policy/’, ‘serial’: None}

So I reverted the virtual machine to a previous snapshot and went through the upgrade process again. This time, things look fine…? When I said that the policy didn’t appear to be being applied, I was referring tot he fact that the Enroll token wasn’t presenting the option for the user to set the PIN. Looks like a new setting was created for this (or changed?) in the new version called “enrollPin” that I had to add to the policy. And I was able to see the actions in the policy edit screen this time so not sure what the heck happened. Maybe a browser cache issue?

You should always run:

apt dist-upgrade

the dist-upgrade also installs new packages, that were previously not required. Sometimes we require new libraries with a new version due to new features.

In addition most browsers cache especially HTML templates. This can result in such behaviours.
You should reload the page using something like Ctrl-Shift-R (in contrast to F5 or Ctrl-R)