core icon indicating copy to clipboard operation
core copied to clipboard

Update 7.0.4 -> 8.0.0 fails with MySQL Syntax error

Open jojomi opened this issue 11 years ago • 25 comments

I followed this idea to circumvent the update problems with the Debian package: https://github.com/owncloud/core/issues/13992#issuecomment-73555360

On running sudo -u www-data php /var/www/owncloud/occ upgrade I get:

An exception occurred while executing 'ALTER TABLE oc_appconfig_8x7jr6mhsg7k5 RENAME INDEX appconfig_config_key_index TO oc_6kz2t44isgfiv':

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INDEX appconfig_config_key_index TO oc_6kz2t44isgfiv' at line 1

The trailing numbers in the table name and the index name change on every new invocation and keep failing. Can anyone give a hint what might have gone wrong here?

jojomi avatar Feb 09 '15 19:02 jojomi

hmmm - where is that rename coming from?

Related to our migration testing? @icewind1991 please have a look - THX

DeepDiver1975 avatar Feb 09 '15 20:02 DeepDiver1975

@jojomi in case you have a backup of your data (which you for sure have :speak_no_evil: ) - you coud try to skip the migration testing by appending the command line option --skip-migration-test

DeepDiver1975 avatar Feb 09 '15 20:02 DeepDiver1975

That command line option fixed it for me:

# sudo -u www-data php /var/www/owncloud/occ upgrade --skip-migration-test
Turned on maintenance mode
Updated database
Turned off maintenance mode
Update successful

Files are still there, so seem to be the other data. Fingers crossed!

Thank you :)

jojomi avatar Feb 09 '15 21:02 jojomi

@jojomi: you are using mariadb 10, right?

@DeepDiver1975: I already discussed this in irc. Doctrine dbal 2.5.0 wrongly assumes that mariadb10 supports mysql 5.7 features.

See: https://github.com/doctrine/migrations/issues/196 https://github.com/doctrine/dbal/pull/742 https://github.com/doctrine/dbal/releases https://github.com/owncloud/core/issues/13071 https://github.com/owncloud/core/issues/13303

trampi avatar Feb 09 '15 21:02 trampi

Same issue on my server, i am running mariaDB 10

wallenium avatar Feb 09 '15 22:02 wallenium

we are working on integration of doctrine 2.5.1 for OC8.1 - we are running into some other issues there .... see #13537

DeepDiver1975 avatar Feb 09 '15 22:02 DeepDiver1975

so we have to wait for 8.1? to skip the migration test does not seem to be the safe way for the data ;)

wallenium avatar Feb 09 '15 22:02 wallenium

@wallenium: backing up and trying with skip in a test environment? :-)

trampi avatar Feb 09 '15 22:02 trampi

@wallenium it is safe in case you have a backup to revert to.

VicDeo avatar Feb 09 '15 22:02 VicDeo

Would be an option, but time intensive ;) Waiting seems to be the better solution, as there seems to be a couple of other bugs, too ;)

wallenium avatar Feb 09 '15 22:02 wallenium

Yes, I am using MariaDB 10.

jojomi avatar Feb 09 '15 22:02 jojomi

Would be an option, but time intensive ;) Waiting seems to be the better solution, as there seems to be a couple of other bugs, too ;)

8.1 is scheduled for May ... shipping 2.5.1 with 8.0.1 (delivery in March) is currently out of scope.

DeepDiver1975 avatar Feb 09 '15 22:02 DeepDiver1975

Would be an option, but time intensive ;)

Well - you know - backups are always recommended ... don't blame us if data got eaten :speak_no_evil:

DeepDiver1975 avatar Feb 09 '15 22:02 DeepDiver1975

I know. i have backups ;) i cloned the system and tried to upgrade, upgrade was successful, seems to work. Thanks for your help.

wallenium avatar Feb 09 '15 22:02 wallenium

I was able to bypass this table alter query error with the --skip-migration-test flag and am using MariaDB 10.0.16.

An exception occurred while executing 'ALTER TABLE oc_oc_appconfig_l3h0qk9vmxu2a RENAME INDEX appconfig_config_key_index TO oc_xd5q455qah20r': SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INDEX appconfig_config_key_index TO oc_xd5q455qah20r' at line 1

deekayen avatar Feb 09 '15 22:02 deekayen

Anyone have an account at the forums and could post that there? I see tons of duplicate posts there about this issue. :speak_no_evil:

ghost avatar Feb 09 '15 22:02 ghost

@DeepDiver1975 is it possible to add a check or a warning for 8.0.1 ?

karlitschek avatar Feb 09 '15 23:02 karlitschek

Upgrading from 7.0.4 to 8.0.0~beta2 (and then later to 8.0.0 final) worked for me on my server with mariadb-5.5.33-2.2.x86_64 on openSUSE 13.1 x86_64

PVince81 avatar Feb 10 '15 09:02 PVince81

--skip-migration-test did it for me

merylen avatar Feb 10 '15 09:02 merylen

@DeepDiver1975 is it possible to add a check or a warning for 8.0.1 ?

Will have a look at this once we are sure we cannot ship dbal 2.5.1 for 8.0.1

DeepDiver1975 avatar Feb 10 '15 09:02 DeepDiver1975