Page 1 of 1

Postgress and new install repository

PostPosted: Wed Nov 30, 2016 1:15 am
by IT2Be
So, I wanted to clean up my developer installations and decided to install only one instance of postgress with a database per developer instance underneath.

OS X 10.12.1
Java 1.8.0_65
Servoy version 6.0.11, 6.1.6, 7.4.8 and 8.1.0 (all the same result)
Postgres version 9.6.1

This was a completely clean install of Postgress as well as the four Servoy installations.
After the first time this failed I re-installed everything again.
The databases and schemas were created manually before running the script.

At first run with './servoy_server.sh -upgradeRepository &' this is the message in the log file:
Code: Select all
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Cannot upgrade repository: make a backup of your repository and start server with -upgradeRepository flag.
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Upgrading repository.
Error upgrading repository: com.servoy.j2db.persistence.RepositoryException: org.postgresql.util.PSQLException: ERROR: relation "servoy_repository.servoy_elements" does not exist

Then when doing the same a second time this is in the log file:
Code: Select all
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=128m; support was removed in 8.0
Upgrading repository.
Error upgrading repository: com.servoy.j2db.persistence.RepositoryException: com.servoy.j2db.persistence.RepositoryException: org.postgresql.util.PSQLException: ERROR: relation "servoy_content_spec" already exists


Anybody any idea?

Re: Postgress and new install repository

PostPosted: Thu Dec 01, 2016 4:21 pm
by steve1376656734
Hi Marcel,

When you install the different developer instances have you made a separate servoy_repository database for each instance? I usually use the following procedure to install each developer instance:

  1. Set up a DB with the default name (servoy_repository)
  2. install the developer version you need
  3. Run the repository upgrade
  4. Close all developer instances
  5. Use pgAdmin to rename the DB servoy_repository_vX.X.X according to the developer version that will be accessing it
  6. Edit the servoy.properties file for the developer instance and change the server URL to point to the renamed DB (e.g. server.0.URL=jdbc\:postgresql\://localhost\:5432/servoy_repository_v8.1.0)
This ensures that each instance has the correct repository version and they don't interfere with each other.

Hope this helps
Steve

Re: Postgress and new install repository

PostPosted: Thu Dec 01, 2016 4:45 pm
by IT2Be
So, from what you write I understand that you make just one database, name it servoy_repository and run the upgrade script without changing the database connections at first run (an unmodified, clean properties file).
Do I interpret that correct?

If so I will try that...

Re: Postgress and new install repository

PostPosted: Thu Dec 01, 2016 4:51 pm
by steve1376656734
Yes - but as soon as the upgrade is run I then rename the DB and change the properties file. This has to be done before trying to install the next developer instance. In your case you will then end up with 4 repository database (one for each developer instance) and all will be named according to the version the work with.

Re: Postgress and new install repository

PostPosted: Thu Dec 01, 2016 5:15 pm
by IT2Be
No fun either Steve :(

I remember having read something about the latest version of PG somewhere though.

Maybe it has something to do with that?

Re: Postgress and new install repository

PostPosted: Thu Dec 01, 2016 5:42 pm
by steve1376656734
Not sure about the PG version. I am currently running 9.4 as I use a tool to synchronise data between DBs that won't work with 9.5 or 9.6. Waiting for the company to release an update.

Hope you get things resolved soon.

Re: Postgress and new install repository

PostPosted: Thu Jan 05, 2017 1:02 pm
by ROCLASI
Hi Marcel,

IT2Be wrote:
Code: Select all
Upgrading repository.
Error upgrading repository: com.servoy.j2db.persistence.RepositoryException: com.servoy.j2db.persistence.RepositoryException: org.postgresql.util.PSQLException: ERROR: relation "servoy_content_spec" already exists


Anybody any idea?


PostgreSQL 9.6 made a change in it's catalog and Servoy queries that directly when doing the -upgradeRepository. So it fails and stops after creating 10 of the 14 tables leaving your repository crippled.
I haven't tested it but my guess is that it will also affect any upgrading of existing repositories.
I filled a bug report in Jira, you can add your vote to it.

So for now I suggest you use PostgreSQL up to version 9.5.x for your Servoy repository.


UPDATE: turns out that it's the JDBC driver. After installing the latest version from the PostgreSQL JDBC driver site it works.
Be aware that the Java version is important in what version you have to download.
If you are using the 1.6 then you should use the JDBC4 version. If you are using 1.7 then you should use the JDBC41 version. If you are using 1.8 then you should use the JDBC42 version.


Hope this helps.