Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL 9.3 is required, 9.6 strongly recommended #5649

Closed
pdurbin opened this issue Mar 15, 2019 · 15 comments
Closed

PostgreSQL 9.3 is required, 9.6 strongly recommended #5649

pdurbin opened this issue Mar 15, 2019 · 15 comments
Assignees
Milestone

Comments

@pdurbin
Copy link
Member

pdurbin commented Mar 15, 2019

I ran the phoenix tests for the first time since the pull request #5349 was merged. That's where we added a dependency on Flyway (#5344) for automatic SQL script execution on deployment.

Here was the failure on phoenix as seen from the Jenkins log at https://build.hmdc.harvard.edu:8443/job/phoenix.dataverse.org-deploy-develop/368/console

Command deploy failed.

remote failure: Error occurred during deployment: Exception while loading the app : javax.ejb.CreateException: Initialization failed for Singleton StartupFlywayMigrator. Please see server.log for more details.

I looked at server.log and found this:

Exception while loading the app : javax.ejb.CreateException: Initialization failed for Singleton StartupFlywayMigrator javax.ejb.CreateException: Initialization failed for Singleton StartupFlywayMigrator

Caused by: org.flywaydb.core.internal.exception.FlywayDbUpgradeRequiredException: PostgreSQL upgrade required: PostgreSQL 8.4 is outdated and no longer supported by Flyway. Flyway currently supports PostgreSQL 9.0 and newer.

	at org.flywaydb.core.internal.database.base.Database.ensureDatabaseIsRecentEnough(Database.java:156)
	at org.flywaydb.core.internal.database.postgresql.PostgreSQLDatabase.ensureSupported(PostgreSQLDatabase.java:65)
	at org.flywaydb.core.internal.database.DatabaseFactory.createDatabase(DatabaseFactory.java:97)
	at org.flywaydb.core.Flyway.execute(Flyway.java:1670)
	at org.flywaydb.core.Flyway.migrate(Flyway.java:1356)
	at edu.harvard.iq.dataverse.flyway.StartupFlywayMigrator.migrateDatabase(StartupFlywayMigrator.java:37)

The above message about PostgreSQL 9.0 is true according to https://flywaydb.org/documentation/database/postgresql but PostgreSQL 9.3 is the oldest version that Flyway supports for free:

Screen Shot 2019-03-15 at 10 06 22 AM

Definition of done for this issue:

@sekmiller
Copy link
Contributor

I have completed the "definition of done" steps outlined above except for the upgrade to the phoenix server.

@pdurbin
Copy link
Member Author

pdurbin commented Mar 26, 2019

@sekmiller thanks for getting the branch started.

@landreev and I just discussed this issue during tech hours. He is going to upgrade Postgres to 9.6 on the phoenix server.

I'm upgrading Postgres to 9.6 on the dev1 server. (Maybe I'll do apitest too but not promises.) I'm taking some notes that I might push into the branch so I'll keep myself assigned as well. I'm already seeing a couple things in the guides I want to edit some more.

@pameyer here's the commit where I messed with your docker stuff without testing it: ff78321 . You were still using pg8-createsequence-prep.sql but I assume you don't need it.

@donsizemore
Copy link
Contributor

@pdurbin @landreev just a note that i've imported our production 9.3 db_dump into a 9.6 service many times and haven't suffered any ill effects to my knowledge.

@landreev
Copy link
Contributor

@donsizemore I've done it on my own dev. environment between 9.1 and 9.6 - also without any signs of a problem.

@landreev
Copy link
Contributor

@pdurbin I know that "9.6 is strongly recommended" - but we are running 9.3 on dvn-build and dvn-vm4, and Flyway seems to be happy. To get the phoenix server to work, and for uniformity with the other CentOS6 boxes, I've installed posgresql93 there as well. The configuration is identical to how it was before:

[root@dvnweb-vm6 bin]# psql -p 5432 -h localhost -U dvnapp -d dvndb
psql (9.3.25)
Type "help" for help.

dvndb=>

The startup scripts are properly checked on and off.

@landreev
Copy link
Contributor

(if we decide we do need 9.6, I'll upgrade all the remaining CentOS6 boxes at once)

@pdurbin
Copy link
Member Author

pdurbin commented Mar 26, 2019

@landreev great! Thanks! Do you want to have the honor of kicking off a build at https://build.hmdc.harvard.edu:8443/job/phoenix.dataverse.org-build-develop/ ? (This is the first of three chained jobs.)

@pdurbin
Copy link
Member Author

pdurbin commented Mar 26, 2019

@landreev I went ahead and clicked "build now" and the deployment to phoenix succeeded:

Screen Shot 2019-03-26 at 7 30 02 PM

That screenshot is from https://build.hmdc.harvard.edu:8443/job/phoenix.dataverse.org-deploy-develop/

Now I'm waiting to see if the API test suite passes or not but I suspect it won't and that we'll see errors reported at #5662.

@pdurbin
Copy link
Member Author

pdurbin commented Mar 27, 2019

The deploy step worked on the first run but not the second. Here's the failure:

Screen Shot 2019-03-26 at 8 04 47 PM

@pdurbin
Copy link
Member Author

pdurbin commented Mar 27, 2019

I rebooted the phoenix server and now I'm getting this (job 372):

ERROR: permission denied to create database

@pdurbin
Copy link
Member Author

pdurbin commented Mar 27, 2019

I dropped and recreated the "dvnapp" user because it didn't have any permissions:

postgres=# \du
                             List of roles
 Role name |                   Attributes                   | Member of 
-----------+------------------------------------------------+-----------
 dvnapp    |                                                | {}
 postgres  | Superuser, Create role, Create DB, Replication | {}

-bash-4.1$ psql -U postgres -c "DROP ROLE dvnapp" template1
DROP ROLE
-bash-4.1$ psql -U postgres -c "CREATE ROLE dvnapp UNENCRYPTED PASSWORD 'secret' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN" template1
CREATE ROLE
-bash-4.1$ psql 
psql (9.3.25)
Type "help" for help.

postgres=# \du
                             List of roles
 Role name |                   Attributes                   | Member of 
-----------+------------------------------------------------+-----------
 dvnapp    | Superuser, Create role, Create DB              | {}
 postgres  | Superuser, Create role, Create DB, Replication | {}

postgres=# 

I'll try another run.

@pdurbin
Copy link
Member Author

pdurbin commented Mar 27, 2019

Ok, now the "deploy" step continues to work. Phew.

@landreev
Copy link
Contributor

Yes, I created that user with /usr/pgsql-9.3/bin/createuser, without giving it any extra permissions; I didn't realize it needed to create the db.
Glad to hear it's working now.

@landreev landreev removed their assignment Mar 27, 2019
@pdurbin pdurbin removed their assignment Mar 27, 2019
@pdurbin
Copy link
Member Author

pdurbin commented Mar 27, 2019

@pdurbin
Copy link
Member Author

pdurbin commented Mar 27, 2019

@kcondon @landreev my biggest concern about this pull request is that we may have missed something in the "Launching Glassfish on system boot" section of the installation guide. I didn't touch it (or look at it).

@kcondon kcondon self-assigned this Mar 27, 2019
@kcondon kcondon closed this as completed Mar 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants