Skip to content
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

Duplicate column name 'synctoken' during upgrade #589

Closed
DigiAngel opened this issue Aug 25, 2016 · 11 comments
Closed

Duplicate column name 'synctoken' during upgrade #589

DigiAngel opened this issue Aug 25, 2016 · 11 comments
Labels

Comments

@DigiAngel
Copy link

Topic says it...looks like I've got a mysql-ish snafu or something...I get the below after:

move current baikal to baikal.orig
unzip baikal 0.4.6
cp -R baikal.orig/Specific baikal

screenshot from 2016-08-25 05-44-43

not sure where to turn next. Thank you.

@DigiAngel
Copy link
Author

Also I have saved before and after snapshots as this was testing in a vm. I also have this running in a production environment so please let me know what else I can provide. Thank you.

@evert
Copy link
Member

evert commented Aug 29, 2016

Hey! sorry for not messaging here earlier.

Generally the cause for this particular error is as follows:

  1. You upgrade baikal from 0.2.7 to 0.4.6
  2. The database upgrade fails
  3. You try again
  4. The upgrade fails again

This error is the error that would appear when trying upgrading again after a failed earlier upgrade.

So in order for me to help figure out what went wrong and to fix this bug, I really need the original error. The only way you (@DigiAngel @joschal) can get this information if you go back to your original 0.2.7 backup, attempt the upgrade again and describe the symptoms =)

@DigiAngel
Copy link
Author

Piece of cake...I'll try this after restoring my original Ubuntu 14.04/Baikal 0.2.7 setup. I'll get that to you tomorrow...thanks Evert!

@DigiAngel
Copy link
Author

Ok this time the upgrade went fine...so I'm going to guess that the damaged php might have had an impact my last try. Anyway here's my process:

cd /var/www/html
mv baikal baikal.orig
sudo unzip baikal-0.4.6.zip
cd baikal
sudo mv Specific Specific.orig
cd ../baikal.orig
sudo cp -R Specific ../baikal/
cd ..
sudo chown -R www-data:www-data baikal

I will most likely do a mysqldump when I do the upgrade in production. At this point I'mma close this ticket out..thanks Evert!

@evert
Copy link
Member

evert commented Aug 30, 2016

Good to hear!

@joschal
Copy link

joschal commented Sep 1, 2016

I followed the instructions of @DigiAngel but unfortunately still got this error.

Uncaught exception during upgrade: exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 duplicate column name: synctoken' in /var/www/html/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php:190 Stack trace: #0 /var/www/html/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php(190): PDO->exec('ALTER TABLE cal...') #1 /var/www/html/baikal/Core/Frameworks/BaikalAdmin/Controller/Install/VersionUpgrade.php(61): BaikalAdmin\Controller\Install\VersionUpgrade->upgrade('0.2.7', '0.4.6') #2 /var/www/html/baikal/Core/Frameworks/Flake/Core/Render/Container.php(71): BaikalAdmin\Controller\Install\VersionUpgrade->render() #3 /var/www/html/baikal/Core/Frameworks/Flake/Controller/Page.php(85): Flake\Core\Render\Container->renderBlocks() #4 /var/www/html/baikal/html/admin/install/index.php(83): Flake\Controller\Page->render() #5 {main}

More suggestions?

@joschal
Copy link

joschal commented Sep 1, 2016

I also turned off all devices that might sync with the server.

@evert
Copy link
Member

evert commented Sep 1, 2016

Hi @joschal ,

Is it possible that you messed up with your previous backup? If you didn't make a backup before the upgrade process you're basically stuck here.

@joschal
Copy link

joschal commented Sep 1, 2016

I did several backups. Currently I'm back at 0.2.7 and it works fine.

@joschal
Copy link

joschal commented Sep 1, 2016

Do you think there is a chance of fixing the issue? Might there be a version in between where the upgrade works?
Or should I just use a new and clean 0.4.6 instance and migrate my calendars and addressbooks via the clients?

Thanks for your fast support

@evert
Copy link
Member

evert commented Sep 1, 2016

Nothing really has changed. The part of the upgrade code that this is hitting is from 0.3.0, which runs because you're upgrading from an older version.

So as of right now I don't have an answer. I maintain that the error is actually happining earlier, and the real error you are seeing is a side-effect of running the upgrade again, after a previous failed one.

However, I have a manual upgrade process that you can try. Requires some console skills though.

sabre/dav ships with a command-line upgraders that provides more feedback. It's shipped with baikal. You'll need to run the following commands:

./vendor/sabre/dav/bin/migrate20.php
./vendor/sabre/dav/bin/migrate21.php
./vendor/sabre/dav/bin/migrate30.php

You must run them in order, and please report if one of them failed and with what error.

When you first run the commands, it gives you some information on what arguments it needs. Specifically, you will need to pass it information on how to connect to your database.

After all that you can change a configuration file in the Specific/ directory to tell baikal you are now upgraded.

Let me know if that works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants