Getting a SQL error after upgrading from 2.4 > 2.8

Upgraded CFFI and then upgraded the privacyIDEA packages using pip, which
appears to have completed successfully. I’m able to log into the web admin
page, but I notice that all of my previously enrolled tokens are gone and
I’m getting a red error message with the following message:

(_mysql_exceptions.OperationalError) (1054, “Unknown column 'token.revoked’
in ‘field list’”) [SQL: u’SELECT token.id AS token_id, token.description AS
token_description, token.serial AS token_serial, token.tokentype AS
token_tokentype, token.user_pin AS token_user_pin, token.user_pin_iv AS
token_user_pin_iv, token.so_pin AS token_so_pin, token.so_pin_iv AS
token_so_pin_iv, token.resolver AS token_resolver, token.resolver_type AS
token_resolver_type, token.user_id AS token_user_id, token.pin_seed AS
token_pin_seed, token.otplen AS token_otplen, token.pin_hash AS
token_pin_hash, token.key_enc AS token_key_enc, token.key_iv AS
token_key_iv, token.maxfail AS token_maxfail, token.active AS token_active,
token.revoked AS token_revoked, token.locked AS token_locked,
token.failcount AS token_failcount, token.count AS token_count,
token.count_window AS token_count_window, token.sync_window AS
token_sync_window, token.rollout_state AS token_rollout_state \nFROM token
ORDER BY token.serial ASC \n LIMIT %s, %s’] [parameters: (0, 15)]

I am unable to enroll any new tokens as well. I am running privacyIDEA on
CentOS 6.7 running nginx and uwsgi. Thanks in advance!

Hi Tea,

first of all: It is fine. Your tokens are still there!

2nd: I am sorry. The documentation is not quite clear about this.
http://privacyidea.readthedocs.org/en/latest/installation/upgrade.html

You need to upgrade the database. A pip install can not perform this
automatically, so you need to do it manually.

In your python virtualenv run:

pi-manage db stamp 4f32a4e1bf33 -d lib/privacyidea/migrations/

which will only set the database schema version to the first version of
privacyIDEA 2.0 (if it is not set, yet. You can leave this later)

Then you need to upgrade to the latest database scheme.
In your case the database is missing the column “revoked” (and may be
some other things)

Then you can upgrade to the latest version of the database schema:

pi-manage db upgrade -d lib/privacyidea/migrations/ 

After this you should be fine.

Kind regards
CorneliusAm Donnerstag, den 17.12.2015, 15:46 -0800 schrieb Tea Orange:

Upgraded CFFI and then upgraded the privacyIDEA packages using pip,
which appears to have completed successfully. I’m able to log into the
web admin page, but I notice that all of my previously enrolled tokens
are gone and I’m getting a red error message with the following
message:

(_mysql_exceptions.OperationalError) (1054, “Unknown column
‘token.revoked’ in ‘field list’”) [SQL: u’SELECT token.id AS token_id,
token.description AS token_description, token.serial AS token_serial,
token.tokentype AS token_tokentype, token.user_pin AS token_user_pin,
token.user_pin_iv AS token_user_pin_iv, token.so_pin AS token_so_pin,
token.so_pin_iv AS token_so_pin_iv, token.resolver AS token_resolver,
token.resolver_type AS token_resolver_type, token.user_id AS
token_user_id, token.pin_seed AS token_pin_seed, token.otplen AS
token_otplen, token.pin_hash AS token_pin_hash, token.key_enc AS
token_key_enc, token.key_iv AS token_key_iv, token.maxfail AS
token_maxfail, token.active AS token_active, token.revoked AS
token_revoked, token.locked AS token_locked, token.failcount AS
token_failcount, token.count AS token_count, token.count_window AS
token_count_window, token.sync_window AS token_sync_window,
token.rollout_state AS token_rollout_state \nFROM token ORDER BY
token.serial ASC \n LIMIT %s, %s’] [parameters: (0, 15)]

I am unable to enroll any new tokens as well. I am running privacyIDEA
on CentOS 6.7 running nginx and uwsgi. Thanks in advance!

You received this message because you are subscribed to the Google
Groups “privacyidea” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to privacyidea+unsubscribe@googlegroups.com.
To post to this group, send email to privacyidea@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/privacyidea/3aae8993-fead-466b-a64e-2e4e0a0f547d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Cornelius Kölbel
@cornelinux
+49 151 2960 1417

NetKnights GmbH
http://www.netknights.it
Landgraf-Karl-Str. 19, 34131 Kassel, Germany
Tel: +49 561 3166797, Fax: +49 561 3166798

Amtsgericht Kassel, HRB 16405
Geschäftsführer: Cornelius Kölbel

signature.asc (836 Bytes)

Thanks Cornelius, I saw that in the upgrade guide and was wondering if it
was necessary for a 2.4 > 2.8 update so I didn’t bother trying it. Thanks
for clearing that up!On Thursday, December 17, 2015 at 10:01:38 PM UTC-8, Cornelius Kölbel wrote:

Hi Tea,

first of all: It is fine. Your tokens are still there!

2nd: I am sorry. The documentation is not quite clear about this.
http://privacyidea.readthedocs.org/en/latest/installation/upgrade.html

You need to upgrade the database. A pip install can not perform this
automatically, so you need to do it manually.

In your python virtualenv run:

pi-manage db stamp 4f32a4e1bf33 -d lib/privacyidea/migrations/ 

which will only set the database schema version to the first version of
privacyIDEA 2.0 (if it is not set, yet. You can leave this later)

Then you need to upgrade to the latest database scheme.
In your case the database is missing the column “revoked” (and may be
some other things)

Then you can upgrade to the latest version of the database schema:

pi-manage db upgrade -d lib/privacyidea/migrations/ 

After this you should be fine.

Kind regards
Cornelius

Am Donnerstag, den 17.12.2015, 15:46 -0800 schrieb Tea Orange:

Upgraded CFFI and then upgraded the privacyIDEA packages using pip,
which appears to have completed successfully. I’m able to log into the
web admin page, but I notice that all of my previously enrolled tokens
are gone and I’m getting a red error message with the following
message:

(_mysql_exceptions.OperationalError) (1054, “Unknown column
’token.revoked’ in ‘field list’”) [SQL: u’SELECT token.id AS token_id,
token.description AS token_description, token.serial AS token_serial,
token.tokentype AS token_tokentype, token.user_pin AS token_user_pin,
token.user_pin_iv AS token_user_pin_iv, token.so_pin AS token_so_pin,
token.so_pin_iv AS token_so_pin_iv, token.resolver AS token_resolver,
token.resolver_type AS token_resolver_type, token.user_id AS
token_user_id, token.pin_seed AS token_pin_seed, token.otplen AS
token_otplen, token.pin_hash AS token_pin_hash, token.key_enc AS
token_key_enc, token.key_iv AS token_key_iv, token.maxfail AS
token_maxfail, token.active AS token_active, token.revoked AS
token_revoked, token.locked AS token_locked, token.failcount AS
token_failcount, token.count AS token_count, token.count_window AS
token_count_window, token.sync_window AS token_sync_window,
token.rollout_state AS token_rollout_state \nFROM token ORDER BY
token.serial ASC \n LIMIT %s, %s’] [parameters: (0, 15)]

I am unable to enroll any new tokens as well. I am running privacyIDEA
on CentOS 6.7 running nginx and uwsgi. Thanks in advance!

You received this message because you are subscribed to the Google
Groups “privacyidea” group.
To unsubscribe from this group and stop receiving emails from it, send
an email to privacyidea...@googlegroups.com <javascript:>.
To post to this group, send email to priva...@googlegroups.com
<javascript:>.
To view this discussion on the web visit

https://groups.google.com/d/msgid/privacyidea/3aae8993-fead-466b-a64e-2e4e0a0f547d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Cornelius Kölbel
corneliu...@netknights.it <javascript:>
+49 151 2960 1417

NetKnights GmbH
http://www.netknights.it
Landgraf-Karl-Str. 19, 34131 Kassel, Germany
Tel: +49 561 3166797, Fax: +49 561 3166798

Amtsgericht Kassel, HRB 16405
Geschäftsführer: Cornelius Kölbel