Closed senoadiw closed 4 years ago
I tried initializing a new Oskari database with the original oskari-map.war build => open http://192.168.1.200:8080 => works, the world map loads!
Replace the oskari-map.war with the custom build on the same database above and restart Oskari server => open http://192.168.1.200:8080 => Error 503 Service Unavailable
Here is the Jetty server log: 2020_06_30.jetty.log
Note: the error below on line 467, it looks like a value is required for the bundle_id column
2020-06-30 16:06:00,575 ERROR fi.nls.oskari.servlet.WebappHelper - DB migration for module wbidp failed! org.flywaydb.core.api.FlywayException@6d7ad0f5[ detailMessage=Migration failed ! cause=org.postgresql.util.PSQLException: ERROR: null value in column "bundle_id" violates not-null constraint Detail: Failing row contains (3, null, 25, null, null, null, download-basket). stackTrace={} suppressedExceptions=[] ]
Here is the pg_dump file of the Oskari database above: oskaridbtest.zip
sudo systemctl restart postgresql cd ~/backups sudo -u postgres psql -c "DROP DATABASE IF EXISTS oskaridbtest;" sudo -u postgres psql -c "CREATE DATABASE oskaridbtest WITH OWNER oskari;" sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE oskaridbtest TO oskari;" sudo -u postgres psql -d oskaridbtest -c "CREATE EXTENSION postgis; CREATE EXTENSION postgis_topology;" sudo -u postgres psql -d oskaridbtest -c "ALTER VIEW geometry_columns OWNER TO oskari; ALTER TABLE spatial_ref_sys OWNER TO oskari;" sudo -u postgres psql -d oskaridbtest -c "GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO oskari;"
pg_restore --host localhost --port 5432 --username "postgres" --dbname "oskaridbtest" --password --schema-only --verbose oskaridbtest.backup pg_restore --host localhost --port 5432 --username "postgres" --dbname "oskaridbtest" --password --data-only --disable-triggers --verbose oskaridbtest.backup
Ah, I think I got it now. The download-basket bundle is probably missing from from the portti_bundle table. This causes an error while the Flyway tries to add that bundle to views with _../oskari-server-extension-dps/blob/wb-idp/server-extension/src/main/java/flyway/wbidp/V1_0_0__add_downloadbasket.java and does not get an ID for it (since it's missing from the bundle table).
You should be able to fix this easily by adding download-basket bundle manually to the db by running this query in your Oskari db:
INSERT INTO "public"."portti_bundle"("name", "config", "state", "startup") VALUES ('download-basket', '{}', '{}', NULL);
And after that just fire up the wbidp-Oskari! Let me know if this helps. I'll try to figure out why this happens.
Yes, now Oskari loads the world map properly after inserting the download-basket record manually to the db.
The build from the wb-idp branch was successful however after rebooting the server accessing the Oskari site at http://192.168.1.200:8080/ gives a 404 error. Accessing http://192.168.1.200:8080/downloads/ works.
Screenshots
Logs
Build log oskari_server_extension_dps_build.log
Jetty log on first run of flyway migrations 2020_06_24.jetty.log
Note from Jetty log: 2020-06-24 11:59:03,914 WARN flyway.oskari.V1_39_1__migrate_publish_template_ol3 - Publish template couldn't be loaded with id 2 - If you are populating an empty DB this is fine. If you are migrating an old database you have misconfigured template property ( view.template.publish ) in oskari-ext.properties!
Oskari settings file oskari-ext.properties.log