OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Error on OMP 1.1 Database Upgrade

Are you responsible for making OMP work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, michael, asmecher

Forum rules
What to do if you have a technical problem with OMP:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OMP Discussion subforum; if you have a development question, try the OMP Development subforum.

Error on OMP 1.1 Database Upgrade

Postby tauyeung » Mon Mar 31, 2014 12:27 pm

Hi all,

I'm running OMP 1.0 on Postgres and trying to upgrade to 1.1. I get this error when running the DB upgrade app:

A database error has occurred: ERROR: type "serial" does not exist

The driver is set to postgres in the config.inc.php.

Thanks,
Tim
tauyeung
 
Posts: 8
Joined: Wed Oct 21, 2009 8:59 am

Re: Error on OMP 1.1 Database Upgrade

Postby asmecher » Mon Mar 31, 2014 2:16 pm

Hi Tim,

This is (I think) a long-standing bug in ADODB's PostgreSQL support; see e.g. this post from 2009. Can you try...
  • Reverting your database to a backup from before you tried the upgrade process
  • Turning on the "debug" option in config.inc.php
  • Re-running the upgrade process
Capture the last couple of pages of the output and post them here, along with your PostgreSQL server version; I'll see what I can do.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm

Re: Error on OMP 1.1 Database Upgrade

Postby tauyeung » Tue Apr 01, 2014 8:31 am

I think this is the pertinent part:

(postgres7): ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL
omp has produced an error Message: WARNING: pg_query(): Query failed: ERROR: type "serial" does not exist In file: /var/www/omp/lib/pkp/lib/adodb/drivers/adodb-postgres7.inc.php At line: 227 Stacktrace: File: (unknown) line (unknown) Function: PKPApplication->errorHandler(2, "pg_query(): Query failed: ERROR: type "serial" does not exist", "/var/www/omp/lib/pkp/lib/adodb/drivers/adodb-postgres7.inc.php", 227, Array(2)) File: /var/www/omp/lib/pkp/lib/adodb/drivers/adodb-postgres7.inc.php line 227 Function: pg_query(Resource(), "ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL") File: /var/www/omp/lib/pkp/lib/adodb/adodb-lib.inc.php line 1081 Function: ADODB_postgres7->_query("ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL", False) File: /var/www/omp/lib/pkp/lib/adodb/adodb.inc.php line 1063 Function: _adodb_debug_execute(Object(ADODB_postgres7), "ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL", False) File: /var/www/omp/lib/pkp/lib/adodb/adodb.inc.php line 1051 Function: ADOConnection->_Execute("ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL", False) File: /var/www/omp/lib/pkp/classes/install/Installer.inc.php line 440 Function: ADOConnection->Execute("ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL") File: /var/www/omp/lib/pkp/classes/install/Installer.inc.php line 435 Function: Installer->executeSQL("ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL") File: /var/www/omp/lib/pkp/classes/install/Installer.inc.php line 375 Function: Installer->executeSQL(Array(287)) File: /var/www/omp/lib/pkp/classes/install/Installer.inc.php line 265 Function: Installer->executeAction(Array(3)) File: /var/www/omp/lib/pkp/classes/install/Installer.inc.php line 186 Function: Installer->executeInstaller() File: /var/www/omp/classes/install/form/UpgradeForm.inc.php line 52 Function: Installer->execute() File: /var/www/omp/lib/pkp/pages/install/PKPInstallHandler.inc.php line 112 Function: UpgradeForm->execute() File: (unknown) line (unknown) Function: PKPInstallHandler->installUpgrade(Array(0), Object(Request)) File: /var/www/omp/lib/pkp/classes/core/PKPRouter.inc.php line 372 Function: call_user_func(Array(2), Array(0), Object(Request)) File: /var/www/omp/lib/pkp/classes/core/PKPPageRouter.inc.php line 228 Function: PKPRouter->_authorizeInitializeAndCallRequest(Array(2), Object(Request), Array(0), False) File: /var/www/omp/lib/pkp/classes/core/Dispatcher.inc.php line 134 Function: PKPPageRouter->route(Object(Request)) File: /var/www/omp/lib/pkp/classes/core/PKPApplication.inc.php line 197 Function: Dispatcher->dispatch(Object(Request)) File: /var/www/omp/index.php line 64 Function: PKPApplication->execute() Server info: OS: Linux PHP Version: 5.3.10-1ubuntu3.8 Apache Version: Apache/2.2.22 (Ubuntu) DB Driver: postgres
-1: ERROR: type "serial" does not exist
ADOConnection._Execute(ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL, false) % line 1051, file: adodb.inc.php
ADOConnection.Execute(ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL) % line 440, file: Installer.inc.php
Installer.executeSQL(ALTER TABLE auth_sources ALTER COLUMN auth_id TYPE SERIAL) % line 435, file: Installer.inc.php
Installer.executeSQL(Array[287]) % line 375, file: Installer.inc.php
Installer.executeAction(Array[3]) % line 265, file: Installer.inc.php
tauyeung
 
Posts: 8
Joined: Wed Oct 21, 2009 8:59 am

Re: Error on OMP 1.1 Database Upgrade

Postby asmecher » Tue Apr 01, 2014 9:03 am

Hi Tim,

And what version of PostgreSQL are you using?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm

Re: Error on OMP 1.1 Database Upgrade

Postby tauyeung » Tue Apr 01, 2014 9:06 am

9.1
tauyeung
 
Posts: 8
Joined: Wed Oct 21, 2009 8:59 am

Re: Error on OMP 1.1 Database Upgrade

Postby asmecher » Tue Apr 01, 2014 12:27 pm

Hi Tim,

Note that the minimum required version for PostgreSQL is 9.1.5.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm

Re: Error on OMP 1.1 Database Upgrade

Postby tauyeung » Tue Apr 01, 2014 1:09 pm

We're running 9.1.13 (sorry I left out the minor version).
tauyeung
 
Posts: 8
Joined: Wed Oct 21, 2009 8:59 am

Re: Error on OMP 1.1 Database Upgrade

Postby tauyeung » Tue Apr 01, 2014 1:16 pm

Just wondering if it's something with the version of the driver being used? Is it possible to swap it out for the adodb-postgres9 version?
tauyeung
 
Posts: 8
Joined: Wed Oct 21, 2009 8:59 am

Re: Error on OMP 1.1 Database Upgrade

Postby asmecher » Tue Apr 01, 2014 4:18 pm

Hi Tim,

As far as I can see, the driver should always be configured "postgres" and ADODB will take care of the particulars. Would you be able to share a database dump with me for some upgrade testing?

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm

Re: Error on OMP 1.1 Database Upgrade

Postby tauyeung » Wed Apr 02, 2014 11:46 am

I can do that -- expect an e-mail shortly.

Tim
tauyeung
 
Posts: 8
Joined: Wed Oct 21, 2009 8:59 am

Re: Error on OMP 1.1 Database Upgrade

Postby asmecher » Mon Apr 14, 2014 3:28 pm

Hi Tim,

I've attached a patch that will modify the PostgreSQL driver. I've tested it briefly and it appears to work. However, we likely won't integrate this into the distributed release -- at some point in the not-too-distant future we'll need to remove ADODB entirely as a database abstraction layer. It's suffering from poor maintenance and code rot. (It's safe -- but I don't want to invest time in refining it.)

Regards,
Alec Smecher
Public Knowledge Project Team
Attachments
postgresql-serials.diff
Patch against OMP 1.1.0
Alter ADODB's schema modification behavior to avoid the use of SERIAL "type" when altering existing columns
(2.85 KiB) Downloaded 48 times
asmecher
 
Posts: 9090
Joined: Wed Aug 10, 2005 12:56 pm


Return to OMP Technical Support

Who is online

Users browsing this forum: No registered users and 2 guests