Problem while updating PI

Hi,

I’m updating our Ubuntu PI-servers withj apt-get upgrade and I’m getting this error in postinst:

Could not add column ‘condition’ to table ‘policy’
(psycopg2.errors.NotNullViolation) FEHLER: Spalte ▒condition▒ enth▒lt NULL-Werte
[SQL: ALTER TABLE policy ADD COLUMN condition INTEGER NOT NULL]

Any suggestions?

Which .deb packages did you upgrade from which version to which version?

privacyidea-nginx_3.3.3-1bionic_all.deb and privacyidea_3.3.3-1bionic_amd64.deb are installed, its “just” upgrading the database version to 2181294eed0b

the problem is the nullable=False, postgresql does not accept this setting. without its ok

From which version did you upgrade?

Problem A: You are running postgres but using the meta package nginx which is ment to run with mysql. You probably need to update the schema manually.

Problem B: The error message does not state, that postgress does not support the constraint, but that your DB contains NULL values!

The DB schema version you mentioned, is very old. The question is which version you where running, which boils down to my previous and above question.

I manually updated script per script. No changes were made. There was a wrong alembic version set.