Update procedure for Sen4Cap v1.1 and 1.2 does not work

Hello Sen4Cap team.
I’ve installed Sen4Cap v1.0 few months back and till upgrade to v.1.1 it works fine.
But … upgrade procedure from 1.0 to 1.1 was unsuccesfully.
And now I’ve tried to upgrade from “broken” 1.1 to 1.2 … and there is what i got :
----------snip-----------
Updating /usr/share/sen2agri/sen2agri-services/modules folder …
Archive: …/sen2agri-services/sen4cap-services-2.0.5-20200707.zip
inflating: /usr/share/sen2agri/sen2agri-services/modules/sen4cap-commons-2.0.5.jar
inflating: /usr/share/sen2agri/sen2agri-services/modules/sen4cap-object-storage-2.0.5.jar
inflating: /usr/share/sen2agri/sen2agri-services/modules/sen4cap-reports-2.0.5.jar
inflating: /usr/share/sen2agri/sen2agri-services/modules/sen4cap-sentinel1-preprocessing-2.0.5.jar
inflating: /usr/share/sen2agri/sen2agri-services/modules/sen4cap-shapefile-2.0.5.jar
inflating: /usr/share/sen2agri/sen2agri-services/modules/sen4cap-startup-2.0.5.jar
Updating /usr/share/sen2agri/sen2agri-services/static folder …
Archive: …/sen2agri-services/sen4cap-services-2.0.5-20200707.zip
inflating: /usr/share/sen2agri/sen2agri-services/static/fragments/login.fragment.html
inflating: /usr/share/sen2agri/sen2agri-services/static/fragments/products.fragment.html
inflating: /usr/share/sen2agri/sen2agri-services/static/images/loader.gif
extracting: /usr/share/sen2agri/sen2agri-services/static/images/logo_sen4cap.png
creating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/
creating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/css/
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/css/bootstrap-multiselect.css
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/css/bootstrap-theme.css
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/css/bootstrap-theme.min.css
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/css/bootstrap.css
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/css/bootstrap.min.css
creating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/fonts/
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/fonts/glyphicons-halflings-regular.eot
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/fonts/glyphicons-halflings-regular.svg
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/fonts/glyphicons-halflings-regular.ttf
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/fonts/glyphicons-halflings-regular.woff
extracting: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/fonts/glyphicons-halflings-regular.woff2
creating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/js/
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/js/bootstrap-multiselect.js
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/js/bootstrap.js
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/js/bootstrap.min.js
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/bootstrap/3.3.6/js/npm.js
creating: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/
creating: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/css/
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/css/font-awesome.css
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/css/font-awesome.min.css
creating: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/fonts/
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/fonts/fontawesome-webfont.eot
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/fonts/fontawesome-webfont.svg
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/fonts/fontawesome-webfont.ttf
extracting: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/fonts/fontawesome-webfont.woff
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/font-awesome/4.2.0/fonts/FontAwesome.otf
creating: /usr/share/sen2agri/sen2agri-services/static/libraries/jquery/2.2.4/
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/jquery/2.2.4/jquery.js
inflating: /usr/share/sen2agri/sen2agri-services/static/libraries/jquery/2.2.4/jquery.min.js
inflating: /usr/share/sen2agri/sen2agri-services/static/login.html
inflating: /usr/share/sen2agri/sen2agri-services/static/styles/styles.css
Archive: …/sen2agri-services/sen4cap-services-2.0.5-20200707.zip
inflating: /usr/share/sen2agri/sen2agri-services/scripts/autocrop-raster.py
Archive: …/sen2agri-services/sen4cap-services-2.0.5-20200707.zip
inflating: /usr/share/sen2agri/sen2agri-services/config/application.properties
Executing SQL script: migrations/sen4cap/migration-1.0.0-1.0.1-reports.sql
psql: FATAL: database “sen4cap” does not exist
Executing SQL script: migrations/sen4cap/migration-1.0.0-1.0.1.sql
psql: FATAL: database “sen4cap” does not exist
Executing SQL script: migrations/sen4cap/migration-1.1-1.2.sql
psql: FATAL: database “sen4cap” does not exist
Copying reference data
Installing conda …
/home/sen2agri-service/miniconda3/etc/profile.d/conda.sh found …
Miniconda already installed for user sen2agri-service. Nothing to do …
Updating R packages…
Setting report_errors to false…
sen4cap conda environment already exists. Nothing to do …
Environments:

conda environments:

base * /home/sen2agri-service/miniconda3
sen4cap /home/sen2agri-service/miniconda3/envs/sen4cap

Job for sen2agri-orchestrator.service failed because the control process exited with error code. See “systemctl status sen2agri-orchestrator.service” and “journalctl -xe” for details.
[root@sen4cap install_script]# systemctl status sen2agri-orchestrator.service
● sen2agri-orchestrator.service - Orchestrator for Sen2Agri
Loaded: loaded (/usr/lib/systemd/system/sen2agri-orchestrator.service; enabled; vendor preset: disabled)
Active: activating (auto-restart) (Result: exit-code) since Tue 2020-07-21 09:30:45 UTC; 796ms ago
Process: 25759 ExecStart=/usr/bin/sen2agri-orchestrator (code=exited, status=1/FAILURE)
Main PID: 25759 (code=exited, status=1/FAILURE)

Jul 21 09:30:45 sen4cap.novalocal systemd[1]: sen2agri-orchestrator.service: main process exited, code=exited, status=1/FAILURE
Jul 21 09:30:45 sen4cap.novalocal systemd[1]: Failed to start Orchestrator for Sen2Agri.
Jul 21 09:30:45 sen4cap.novalocal systemd[1]: Unit sen2agri-orchestrator.service entered failed state.
Jul 21 09:30:45 sen4cap.novalocal systemd[1]: sen2agri-orchestrator.service failed.
[root@sen4cap install_script]#
----------snip-----------

Anu suggestions ?

Cheers,
Marcin Pospieszny
PSNC

And systemd journal looks like this :
------------snip-------------
[root@sen4cap install_script]# journalctl -xe
– Subject: Unit sen2agri-orchestrator.service has begun start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit sen2agri-orchestrator.service has begun starting up.
Jul 21 09:37:18 sen4cap.novalocal systemd[1]: Stopped Sen2Agri HTTP Listener.
– Subject: Unit sen2agri-http-listener.service has finished shutting down
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit sen2agri-http-listener.service has finished shutting down.
Jul 21 09:37:18 sen4cap.novalocal systemd[1]: Started Sen2Agri HTTP Listener.
– Subject: Unit sen2agri-http-listener.service has finished start-up
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit sen2agri-http-listener.service has finished starting up.

– The start-up result is done.
Jul 21 09:37:18 sen4cap.novalocal sen2agri-orchestrator[26669]: Reading settings from /etc/sen2agri/sen2agri.conf
Jul 21 09:37:18 sen4cap.novalocal sen2agri-http-listener[26670]: Reading settings from /etc/sen2agri/sen2agri.conf
Jul 21 09:37:18 sen4cap.novalocal dockerd-current[23236]: 2020-07-21 09:37:18.244 UTC [30504] FATAL: password authentication failed for user “admin”
Jul 21 09:37:18 sen4cap.novalocal dockerd-current[23236]: 2020-07-21 09:37:18.244 UTC [30504] DETAIL: Role “admin” does not exist.
Jul 21 09:37:18 sen4cap.novalocal dockerd-current[23236]: Connection matched pg_hba.conf line 95: “host all all all md5”
Jul 21 09:37:18 sen4cap.novalocal sen2agri-http-listener[26670]: Unable to connect to the database: FATAL: password authentication failed for user “admin”
Jul 21 09:37:18 sen4cap.novalocal sen2agri-http-listener[26670]: QPSQL: Unable to connect
Jul 21 09:37:18 sen4cap.novalocal dockerd-current[23236]: 2020-07-21 09:37:18.247 UTC [30505] FATAL: password authentication failed for user “admin”
Jul 21 09:37:18 sen4cap.novalocal dockerd-current[23236]: 2020-07-21 09:37:18.247 UTC [30505] DETAIL: Role “admin” does not exist.
Jul 21 09:37:18 sen4cap.novalocal sen2agri-orchestrator[26669]: Unable to connect to the database: FATAL: password authentication failed for user “admin”
Jul 21 09:37:18 sen4cap.novalocal sen2agri-orchestrator[26669]: QPSQL: Unable to connect
Jul 21 09:37:18 sen4cap.novalocal dockerd-current[23236]: Connection matched pg_hba.conf line 95: “host all all all md5”
Jul 21 09:37:18 sen4cap.novalocal systemd[1]: sen2agri-http-listener.service: main process exited, code=exited, status=1/FAILURE
Jul 21 09:37:18 sen4cap.novalocal systemd[1]: Unit sen2agri-http-listener.service entered failed state.
Jul 21 09:37:18 sen4cap.novalocal systemd[1]: sen2agri-http-listener.service failed.
Jul 21 09:37:18 sen4cap.novalocal systemd[1]: sen2agri-orchestrator.service: main process exited, code=exited, status=1/FAILURE
Jul 21 09:37:18 sen4cap.novalocal systemd[1]: Failed to start Orchestrator for Sen2Agri.
– Subject: Unit sen2agri-orchestrator.service has failed
– Defined-By: systemd
– Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel

– Unit sen2agri-orchestrator.service has failed.

– The result is failed.
Jul 21 09:37:18 sen4cap.novalocal systemd[1]: Unit sen2agri-orchestrator.service entered failed state.
Jul 21 09:37:18 sen4cap.novalocal systemd[1]: sen2agri-orchestrator.service failed.
lines 2068-2112/2112 (END)
------------snip-------------

Cheers,
Marcin Pospieszny
PSNC

Dear Marcin,

When moving from 1.0 to 1.1 an upgrade also of the database was needed from posgres 9.4 to 12 but it seems that sometimes, the Postgresql server is restarting during the restore of the database when performing this upgrade. This is not the case when upgrading from 1.1 to 1.2 as in this case there is no upgrade of the database.
In order to solve this issue please follow the following steps:

  • check if you find the file /tmp/db.sql. If so, please perform a backup of this file using:

cp -f /tmp/db.sql ~/

  • Then execute the following steps:

psql -U postgres -f /tmp/db.sql

If everything is OK, execute again, from the 1.2 installation package:

sudo ./update.sh

Please let me know if this solves your issue.

Best regards,
Cosmin