Project

General

Profile

schema_update.py

Added by Harry Kao almost 12 years ago

We are updating our Legion webserver from 2.1 to 2.2 on a Linux workstation.
When running schema_update.py,we get the following error:

File "schema_update.py", line 11, in <module>
updatelib_inst = updatelib.UpdateLib(project_dbupgrade)
File "/opt/myami-2.2.0/dbschema/updatelib.py", line 13, in init
self.checkout_revision = self.getCheckOutRevision()
File "/opt/myami-2.2.0/dbschema/updatelib.py", line 110, in getCheckOutRevision
release_revision = getReleaseRevisionFromXML(module_path)
NameError: global name 'getReleaseRevisionFromXML' is not defined

Replies (6)

RE: schema_update.py - Added by Anchi Cheng almost 12 years ago

I opened a bug report and repaired the obvious. The tar.gz file you downloaded may not be up to date in critical bug fixes. I will ask Amber looking into it.

Anchi

RE: schema_update.py - Added by Harry Kao almost 12 years ago

Hi Anchi,

I downloaded the latest trunk, ran pysetup.sh and then ran the schema_update again. There is a different err msg:

python schema_update.py
/usr/lib64/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet
connected to db 'projectdb' on server 'our_server'
Getting release revision from /opt/myami-17369/myamiweb/xml/projectDefaultValues.xml
Release revision is 16527
CUSTOM: SELECT value FROM `install` WHERE `key`='revision'
Database recorded revision is 15293
CUSTOM: SELECT value FROM `install` WHERE `key`='version'
Getting release revision from /opt/myami-17369/myamiweb/xml/projectDefaultValues.xml
Release revision is 16527
Traceback (most recent call last):
File "schema_update.py", line 13, in <module>
schema_revisions = updatelib_inst.getBranchUpdateRevisionSequence()
File "/opt/myami-17369/dbschema/updatelib.py", line 93, in getBranchUpdateRevisionSequence
checkout_update_sequence = self.getUpdateRevisionSequence(self.checkout_branch)
File "/opt/myami-17369/dbschema/updatelib.py", line 37, in getUpdateRevisionSequence
raise "Unknown svn branch"
TypeError: exceptions must be classes or instances, not str

RE: schema_update.py - Added by Anchi Cheng almost 12 years ago

Hi, Harry,

There seems to be a bug in the part about getting svn branch. While you help me find out why, you can
see if you can move ahead by hardcode the branch in
myami/dbschema/updatelib.py

class UpdateLib:
  def __init__(self,project_dbupgrade):
    printMsg = True
    self.project_dbupgrade = project_dbupgrade
    self.checkout_branch = version.getSVNBranch('.')

Change the last line

    self.checkout_branch = version.getSVNBranch('.')

to

    self.checkout_branch = 'trunk'

As for helping me debug, please give me the output of this from the same directory.

svn info

If it is indeed from svn checkout, it should look like this:

Path: .
URL: http://emg.nysbc.org/svn/myami/trunk/dbschema
Repository Root: http://emg.nysbc.org/svn/myami
Repository UUID: 7194d2a7-0b6d-4db4-844f-13006c256e48
Revision: 17368
Node Kind: directory
Schedule: normal
Last Changed Author: acheng
Last Changed Rev: 17366
Last Changed Date: 2013-01-30 18:03:58 -0800 (Wed, 30 Jan 2013)

RE: schema_update.py - Added by Harry Kao almost 12 years ago

I edited the updatelib.py file and the output of "svn info" is

Path: .
URL: http://emg.nysbc.org/svn/myami/trunk/dbschema
Repository Root: http://emg.nysbc.org/svn/myami
Repository UUID: 7194d2a7-0b6d-4db4-844f-13006c256e48
Revision: 17369
Node Kind: directory
Schedule: normal
Last Changed Author: acheng
Last Changed Rev: 17366
Last Changed Date: 2013-01-30 21:03:58 0500 (Wed, 30 Jan 2013)
-----------------------------------------------------------------

I re-ran the schema_update.py, this time it finished with a list of commands to run manually. Everything was fine until second to the last line. I have the following err:

python schema-r17224.py
/usr/lib64/python2.6/site-packages/MySQLdb/__init__.py:34: DeprecationWarning: the sets module is deprecated
from sets import ImmutableSet
connected to db 'projectdb' on server 'oahu'
connected to db 'leginondb' on server 'oahu'
SVN checkout revision is 17369
CUSTOM: SELECT value FROM `install` WHERE `key`='revision'
Database recorded revision is 17111
CUSTOM: SELECT value FROM `install` WHERE `key`='version'
SVN checkout revision is 17369
CUSTOM: SELECT value FROM `install` WHERE `key`='revision'
CUSTOM: SELECT * FROM `install` WHERE `key`='resetfrom'
15293
-------------------------------------------
Upgrading leginondb
ALTER: ALTER TABLE `AcquisitionImageData` ADD COLUMN `REF|CorrectorPlanData|corrector plan` int(20) NULL DEFAULT NULL;
added column REF|CorrectorPlanData|corrector plan
Update failed
Traceback (most recent call last):
File "schema-r17224.py", line 50, in <module>
update.run()
File "/opt/myami-17369/dbschema/schemabase.py", line 104, in run
self.upgradeLeginonDB()
File "schema-r17224.py", line 14, in upgradeLeginonDB
decameradata = leginondata.InstrumentData(name='DE12').query(results=1)[0]
IndexError: list index out of range

RE: schema_update.py - Added by Anchi Cheng almost 12 years ago

O.K. fixed that in r17224 Please update.

RE: schema_update.py - Added by Harry Kao almost 12 years ago

I updated the trunk and this time the installation went through without any error message. Thank you.

    (1-6/6)