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

apt-get upgrade does not upgrade database from 2.1 to 2.2 #100

Closed
schplurtz opened this Issue Jun 28, 2013 · 3 comments

Comments

Projects
None yet
2 participants
@schplurtz
Contributor

schplurtz commented Jun 28, 2013

Hello,

To my greatest surprise, apt-get upgrade broke the netmagis web frontend :

apache still working
pgauth still working as expected
but the cgi "index" fails with

Internal Server Error

I discovered that the database is not updated by apt, as there is no postinst script in package netmagis-database. It may be on purpose, but I tend to think the script was forgotten.

I uncompressed and ran the SQL upgrade script by hand (/usr/share/doc/netmagis/examples/upgrade/21-22/upgrade.sql.gz). Also it was necessary to set owner of the new p_l2only table, as I ran the updrade script under the postgresql super user account (silly me!)

web frontend was ok after this change.

/Schplurtz

@schplurtz

This comment has been minimized.

Show comment
Hide comment
@schplurtz

schplurtz Jul 26, 2013

Contributor

Hi.

Here is a postinst script that I successfully used used http://pastebin.com/mRUsfUGR

Contributor

schplurtz commented Jul 26, 2013

Hi.

Here is a postinst script that I successfully used used http://pastebin.com/mRUsfUGR

@pdav

This comment has been minimized.

Show comment
Hide comment
@pdav

pdav Aug 29, 2013

Collaborator

This message is a bug: the 2.2.* release notes tell us:
"Include a check on database version number in order to ease database upgrades. Now, a new read-only application parameter "schemaversion" is provided by database creation script and upgrade procedures. This parameter is checked by all Netmagis programs. If the value in database differ from the hard-coded value in programs, an error is generated and the database is not corrupted."

This check uses the global.config table ("schemaversion" key). However, the test against the schemaversion is using the "key" column name, which does not exist in pre-2.2 databases (it was a french column name). So, this new check is failing miserably...

Collaborator

pdav commented Aug 29, 2013

This message is a bug: the 2.2.* release notes tell us:
"Include a check on database version number in order to ease database upgrades. Now, a new read-only application parameter "schemaversion" is provided by database creation script and upgrade procedures. This parameter is checked by all Netmagis programs. If the value in database differ from the hard-coded value in programs, an error is generated and the database is not corrupted."

This check uses the global.config table ("schemaversion" key). However, the test against the schemaversion is using the "key" column name, which does not exist in pre-2.2 databases (it was a french column name). So, this new check is failing miserably...

pdav added a commit that referenced this issue Aug 29, 2013

Bad detection of schema version
This patch solves the bug diagnosed in issue #100 record.
The schema version is queried and the application displays
an appropriate error message even if database schema has not
been converted for 2.2.

pdav added a commit that referenced this issue Aug 29, 2013

Bad detection of schema version
This patch solves the bug diagnosed in issue #100 record.
The schema version is queried and the application displays
an appropriate error message even if database schema has not
been converted for 2.2.
(cherry picked from commit e75b24c)

pdav added a commit that referenced this issue Aug 29, 2013

Database automatic upgrade script
This script is intended to automatically
take care of database upgrading.

Issue #100

@pdav pdav modified the milestones: v2.2.2, v2.3 Feb 26, 2014

@pdav pdav added the feature label Feb 26, 2014

@pdav

This comment has been minimized.

Show comment
Hide comment
@pdav

pdav Mar 7, 2014

Collaborator

We don't think that decision to upgrade database may be left to an automated installation procedure.
Instead, we provide:

  • a (now fixed) check in the Web application, which refers to a (now fixed) URL to the upgrade doc
  • a new program "netmagis-dbupgrade" to automate database upgrading

Now, close this issue.

Collaborator

pdav commented Mar 7, 2014

We don't think that decision to upgrade database may be left to an automated installation procedure.
Instead, we provide:

  • a (now fixed) check in the Web application, which refers to a (now fixed) URL to the upgrade doc
  • a new program "netmagis-dbupgrade" to automate database upgrading

Now, close this issue.

@pdav pdav closed this Mar 7, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment