SORMAS-Foundation / SORMAS-Project

SORMAS (Surveillance, Outbreak Response Management and Analysis System) is an early warning and management system to fight the spread of infectious diseases.
https://sormas.org
GNU General Public License v3.0
292 stars 140 forks source link

Evaluate how PostgreSQL extensions could be integrated into the update process #8206

Open faatihi opened 2 years ago

faatihi commented 2 years ago

Bug Description

During deployment of version 1.68.0 (from 1.60.3), we encountered an exception in the line of "function gen_random_bytes(int) does not exist". After a while of troubleshooting, we found out we needed to install pgcrypto extension. Installing it resolved the issue.

May be we missed a step that would automatically install this extension during the update. If not, then I suggest one of these two changes:

  1. server-update.sh script should install needed extensions before sormas_schema.sql is run. This is already done by server-setup.sh
  2. Better yet, we can have a sormas database super user which is only for upgrading the database (aka running sormas_schema.sql). This way, developers can include extension creation statements in the sql file without having to remember to include it in server-update.sh

Steps to Reproduce

Expected Behavior

Screenshots

System Details

Additional Information

MateStrysewske commented 2 years ago

@faatihi The release notes of 1.58.0 (https://github.com/hzi-braunschweig/SORMAS-Project/releases/tag/v1.58.0) contain instructions to enable pgcrypto prior to the update. I guess that was missed on your server.

We could think about extending server-update.sh. Creating a super user could have security-related drawbacks that we'd need to discuss. I'll convert this issue into a task because there's no bug to be found here.

faatihi commented 2 years ago

Thanks @MateStrysewske. We read the release notes from 1.60.3 to 1.68.0. That's why we missed it. We'll be more thorough next time.

I'll keep in touch with this thread to offer any assistance.