Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Installation

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-26-2008, 06:34 AM
Junior Member
 
Posts: 9
Default [SOLVED] Error Upgrading from Zimbra 5.02 to Zimbra 5.04 OSS

When I try to upgrade to Zimbra 5.04 I get the following error:

This appears to be 5.0.2_GA
Redolog Version: 1.22 New Redolog Version: 1.22
Schema upgrade required
Running /opt/zimbra/libexec/scripts/migrate20080130-ImapFlags.pl
Mon Mar 24 20:18:43 2008: Verified schema version 50.
Mon Mar 24 20:18:44 2008: Adding flags column to mboxgroup1.imap_message.
ERROR 1060 (42S21) at line 1: Duplicate column name 'flags'
Mon Mar 24 20:18:44 2008: Error while running '/opt/zimbra/bin/mysql --user=zimbra --password=.prk0K8dvX6oG7NLCbkwr14635qT --database=zimbra --batch --skip-column-names'.
Script failed with code 256: - exiting
UPGRADE FAILED - exiting

Is this a known issue with my schema or do I have to manually fix it? Please help I'm completely lost on what to do next.
Reply With Quote
  #2 (permalink)  
Old 03-26-2008, 06:39 AM
Moderator
 
Posts: 7,928
Default

Welcome to the forums

It sounds like corruption to me in the MySQL tables. Do you have a good backup in case ?
__________________
Reply With Quote
  #3 (permalink)  
Old 03-26-2008, 06:46 AM
Junior Member
 
Posts: 9
Default

I reverted back to my backup and since then I'm running 5.02, my production server is running OK now, but I would like to upgrade to 5.04.

When I started the upgrade process I verified the databases and it was OK. Any ideas?
Reply With Quote
  #4 (permalink)  
Old 03-26-2008, 06:48 AM
Moderator
 
Posts: 7,928
Default

glad your up and running again. as you have restored and restarted Zimbra would you check your Log Files - Zimbra :: Wiki for any error messages and post them please.
__________________
Reply With Quote
  #5 (permalink)  
Old 03-26-2008, 06:59 AM
Outstanding Member
 
Posts: 684
Default

Did you allow Zimbra to verify database integrity during the upgrade?

I upgraded this morning from 5.0.2 to 5.0.4 and all went well.
Reply With Quote
  #6 (permalink)  
Old 03-26-2008, 07:04 AM
Junior Member
 
Posts: 9
Default

I did verify the database. Below you will find the log.

Operations logged to /tmp/zmsetup.03242008-201744.log
Getting installed packages
Getting local config zimbra_server_hostname
Getting local config ldap_url
zimbra_server_hostname contained in ldap_url checking ldap status
Checking ldap status.
*** Running as zimbra user: /opt/zimbra/bin/ldap status
Starting ldap...
*** Running as zimbra user: /opt/zimbra/sleepycat/bin/db_recover -h /opt/zimbra/
openldap-data
*** Running as zimbra user: /opt/zimbra/libexec/zmldapapplyldif
*** Running as zimbra user: /opt/zimbra/bin/ldap status
slapd running pid: 2522
done.
Getting installed services from ldap
checking isEnabled zimbra-core
zimbra-core not in enabled cache
enabled packages
zimbra_server_hostname contained in ldap_url checking ldap status
Checking ldap status.
*** Running as zimbra user: /opt/zimbra/bin/ldap status
slapd running pid: 2522
slapd already running.
Getting enabled services from ldap
Marking zimbra-apache as installed. Services for zimbra-apache will be enabled.
Setting defaults...
Setting local config zimbra_java_home to /opt/zimbra/java
*** Running as zimbra user: /opt/zimbra/bin/zmlocalconfig -f -e zimbra_java_home
='/opt/zimbra/java' 2> /dev/null
checking isEnabled zimbra-cluster
zimbra-cluster not in enabled cache
enabled packages zimbra-logger zimbra-store zimbra-mta zimbra-core zimbra-apache
zimbra-snmp zimbra-ldap zimbra-spell
zimbra_server_hostname contained in ldap_url checking ldap status
Checking ldap status.
*** Running as zimbra user: /opt/zimbra/bin/ldap status
slapd running pid: 2522
slapd already running.
Getting enabled services from ldap
Marking zimbra-apache as installed. Services for zimbra-apache will be enabled.
checking isEnabled zimbra-store
zimbra-store is enabled
checking isEnabled zimbra-ldap
zimbra-ldap is enabled
checking isEnabled zimbra-store
zimbra-store is enabled
checking isEnabled zimbra-mta
zimbra-mta is enabled
done.
Upgrading from 5.0.2_GA_1975 to 5.0.4_GA_2101
Stopping zimbra services
Verifying /opt/zimbra/conf/my.cnf
Starting mysql
Starting logger mysql
This appears to be 5.0.2_GA
Redolog Version: 1.22 New Redolog Version: 1.22
Schema upgrade required
Running /opt/zimbra/libexec/scripts/migrate20080130-ImapFlags.pl
Mon Mar 24 20:18:43 2008: Verified schema version 50.
Mon Mar 24 20:18:44 2008: Adding flags column to mboxgroup1.imap_message.
ERROR 1060 (42S21) at line 1: Duplicate column name 'flags'
Mon Mar 24 20:18:44 2008: Error while running '/opt/zimbra/bin/mysql --user=zimb
ra --password=.prk0K8dvX6oG7NLCbkwr14635qT --database=zimbra --batch --skip-colu
mn-names'.
Script failed with code 256: - exiting
UPGRADE FAILED - exiting
Reply With Quote
  #7 (permalink)  
Old 03-26-2008, 09:13 AM
Outstanding Member
 
Posts: 684
Default

According to this wiki - Account mailbox database structure - Zimbra :: Wiki - there is already a flags column in the database.

I am wondering why the upgrade would try to "add" this column. Something has me confused. The add worked on my upgrade however.
Reply With Quote
  #8 (permalink)  
Old 03-26-2008, 10:03 AM
Zimbra Employee
 
Posts: 78
Default

Looks like whatever scheme you used to roll back to 5.0.2 didn't roll back the database schema. The best thing to do is to roll back your database to the 5.0.2 schema. If this is not possible, you'll need to run the script attached to this bug:

Bug 26220 - Upgrade failure if some people use external IMAP sync

and then hack your upgrade process so that it doesn't run migrate20080130-ImapFlags.pl.
Reply With Quote
  #9 (permalink)  
Old 03-26-2008, 11:19 AM
Junior Member
 
Posts: 9
Default

Where is that script being called?
What should be the order that I have to use?
- Upgrade to 5.04 <- even if it fails
*Note that for the new packages get installed, it fails when it tries to upgrade the schema
- Run the imapfix script

Or should I do the following:
- Run the imapfix script
- Upgrade to 5.04 <- In theory it shouldn't run the migrate20080130-ImapFlags.pl
Reply With Quote
  #10 (permalink)  
Old 03-26-2008, 11:31 AM
Zimbra Employee
 
Posts: 604
Default

This isn't database corruption, this is caused by partially upgraded schema. This is usually caused when an upgrade is aborted or failed during a previous attempt. You should make sure that you completely restore to the previous version including the database schema.

In this case we have a script that will get you past a mid-upgrade failure. Steps to recover are

- Upgrade to 5.0.4
- Run fix script only if upgrade fails.
- Rerun zmsetup.pl after running the fix script

The fix script will fix the schema for the individual schema upgrade that is failing. Rerunning zmsetup.pl after that script will finish the upgrade process.

To run the fix script, download the attachment http://bugzilla.zimbra.com/attachment.cgi?id=9590
Save the attachment in /opt/zimbra/libexec/scripts/imapfix.pl
Make sure you logged in as zimbra (su - zimbra)
cd /opt/zimbra/libexec/scripts
perl ./imapfix.pl
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!

Last edited by brian; 03-26-2008 at 11:39 AM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.