Error while apt-get upgrade

I got privacyIDEA up and running and it works perfectly. Today I did apt-get update && apt-get upgrade and I got this output:

Setting up privacyidea-nginx (3.1.1-2bionic) ...
useradd: user 'privacyidea' already exists
ln: failed to create symbolic link '/etc/ssl/certs/privacyidea-bundle.crt': File exists
ln: failed to create symbolic link '/etc/ssl/private/privacyidea.key': File exists

             _                    _______  _______
   ___  ____(_)  _____ _______ __/  _/ _ \/ __/ _ |
  / _ \/ __/ / |/ / _ `/ __/ // // // // / _// __ |
 / .__/_/ /_/|___/\_,_/\__/\_, /___/____/___/_/ |_|
/_/                       /___/

()
The file
        /etc/privacyidea/enckey
already exist. We do not overwrite it!

             _                    _______  _______
   ___  ____(_)  _____ _______ __/  _/ _ \/ __/ _ |
  / _ \/ __/ / |/ / _ `/ __/ // // // // / _// __ |
 / .__/_/ /_/|___/\_,_/\__/\_, /___/____/___/_/ |_|
/_/                       /___/

<SQLAlchemy engine=sqlite:////mnt/gluster/pi-data.sqlite>

             _                    _______  _______
   ___  ____(_)  _____ _______ __/  _/ _ \/ __/ _ |
  / _ \/ __/ / |/ / _ `/ __/ // // // // / _// __ |
 / .__/_/ /_/|___/\_,_/\__/\_, /___/____/___/_/ |_|
/_/                       /___/

The file
        /etc/privacyidea/private.pem
already exist. We do not overwrite it!
dpkg: error processing package privacyidea-nginx (--configure):
 installed privacyidea-nginx package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
 privacyidea-nginx
E: Sub-process /usr/bin/dpkg returned an error code (1)

I think there’s an error in the privacyidea-nginx.postinst script.
Please help me!

I always would recommend running a apt dist-upgrade to also get new dependencies.

You are really running a sqlite database on a gluster share?
You know that sqlite can not handle concurrent access?
I would recommend to run a “real” database :wink:

And this could also be the source of the problem, that some schema update fails with your sqlite installation.
You know the privacyidea-nginx meta package assumes you installed privacyidea with MySQL. So I would recommend removing the privacyidea-nginx package and only update the code package privacyidea, but then you also need to run the schema update manually.

See here:

Your problems might also depend on from which version you are upgrading.
You need to read READ_BEFORE_UPDATE.md in the privacyidea github repo.

Hi Cornelius,
thanks for your input!
I managed to get the update working: there was a false path in the privacyidea-nginx.postinst script: the path to the migrations-directory for db-upgrade was not set correctly.

We are working on a better implementation, but there is only a small amount of users at the moment…