core icon indicating copy to clipboard operation
core copied to clipboard

Upgrade 6.0.4 to 7.0 MySQL Failure

Open twistedgrim opened this issue 12 years ago • 14 comments

An exception occurred while executing 'SELECT oc_permissions.fileid, permissions FROM oc_permissions INNER JOIN oc_filecache ON oc_permissions.fileid = oc_filecache.fileid WHERE oc_filecache.parent = ? AND oc_permissions.user = ?': SQLSTATE[23000]: Integrity constraint violation: 1052 Column 'permissions' in field list is ambiguous

Had a failure after copying the directory over via the update documentation, changing the config file and starting the webserver/upgrade. Showed the upgrade page then threw the SQL error above.

twistedgrim avatar Jul 24 '14 04:07 twistedgrim

the table oc_permissions in no longer in use in OC7 - most probably some pre-oc7 code files are still around.

DeepDiver1975 avatar Jul 24 '14 07:07 DeepDiver1975

I had the same error, but after restarting apache2 on the server and selecting begin upgrade on the owncloud login page, it came through properly and it was working afterwards.

frankuit avatar Jul 24 '14 08:07 frankuit

I had the same error, but after restarting apache2 on the server and selecting begin upgrade on the owncloud login page, it came through properly and it was working afterwards.

Nice - @twistedgrim maybe you want to try this as well?

@frankuit @twistedgrim do you have any kind of php op code cache installed? apc, xcache or anything like this

DeepDiver1975 avatar Jul 24 '14 08:07 DeepDiver1975

dpkg -l |grep php ii libapache2-mod-php5 5.4.4-14+deb7u12 amd64 server-side, HTML-embedded scripting language (Apache 2 module) ii libphp5-embed 5.4.4-14+deb7u12 amd64 HTML-embedded scripting language (Embedded SAPI library) ii php-apc 3.1.13-1 amd64 APC (Alternative PHP Cache) module for PHP 5 ii php-cache 1.5.6-1 all framework for caching of arbitrary data ii php-http-request 1.4.4-4 all PEAR class to provide an easy way to perform HTTP requests ii php-net-socket 1.0.9-2 all PHP PEAR Network Socket Interface module ii php-net-url 1.0.15-2 all easy parsing of Urls ii php-pear 5.4.4-14+deb7u12 all PEAR - PHP Extension and Application Repository ii php-xml-parser 1.3.4-6 all PHP PEAR module for parsing XML ii php5 5.4.4-14+deb7u12 all server-side, HTML-embedded scripting language (metapackage) ii php5-cli 5.4.4-14+deb7u12 amd64 command-line interpreter for the php5 scripting language ii php5-common 5.4.4-14+deb7u12 amd64 Common files for packages built from the php5 source ii php5-curl 5.4.4-14+deb7u12 amd64 CURL module for php5 ii php5-gd 5.4.4-14+deb7u12 amd64 GD module for php5 ii php5-imagick 3.1.0~rc1-1+b2 amd64 ImageMagick module for php5 ii php5-intl 5.4.4-14+deb7u12 amd64 internationalisation module for php5 ii php5-ldap 5.4.4-14+deb7u12 amd64 LDAP module for php5 ii php5-mcrypt 5.4.4-14+deb7u12 amd64 MCrypt module for php5 ii php5-memcache 3.0.6-6 amd64 memcache extension module for PHP5 ii php5-memcached 2.0.1-6 amd64 memcached extension module for PHP5, uses libmemcached ii php5-mysql 5.4.4-14+deb7u12 amd64 MySQL module for php5 ii php5-pgsql 5.4.4-14+deb7u12 amd64 PostgreSQL module for php5 ii php5-sqlite 5.4.4-14+deb7u12 amd64 SQLite module for php5

frankuit avatar Jul 24 '14 08:07 frankuit

ii php-apc 3.1.13-1 amd64 APC (Alternative PHP Cache) module for PHP 5

here we go - looks like OC6 code was still in the cache and got executed. @bantu does that make sense? THX

DeepDiver1975 avatar Jul 24 '14 08:07 DeepDiver1975

@DeepDiver1975 Yes, that is possible. Setting apc.stat=0 may result in this behaviour (see http://php.net/manual/en/apc.configuration.php)

bantu avatar Jul 24 '14 08:07 bantu

So we better tell people to restart apache after upgrade?

docs or in the upgrade screen?

DeepDiver1975 avatar Jul 24 '14 08:07 DeepDiver1975

@DeepDiver1975 It depends on their setup. When apc.stat=0, they will have to manually purge the cache after replacing any PHP files (or probably better set apc.stat=1 during the upgrade). Purging the APC cache can be achieved by restarting Apache in case of mod_php, but FastCGI/FPM will behave differently. Also, I expect apc.stat=0 to cause issues with the config file, so this might not actually be it.

bantu avatar Jul 24 '14 08:07 bantu

@DeepDiver1975 Detect apc.stat=0 and tell them to set it to 1 for the upgrade?

bantu avatar Jul 24 '14 08:07 bantu

this is the content on my server for that file:

/etc/php5/apache2/conf.d# cat 20-apc.ini extension=apc.so

there are no further entries in the file, so i don't know if it is actually being used. Hope this helps, Frank

frankuit avatar Jul 24 '14 09:07 frankuit

@frankuit There might be other apc configuration in the generic php.ini.

bantu avatar Jul 24 '14 09:07 bantu

/etc/php5/apache2# l total 76 4 drwxr-xr-x 2 root root 4096 Jun 18 21:13 . 4 drwxr-xr-x 7 root root 4096 Dec 20 2013 .. 0 lrwxrwxrwx 1 root root 9 Feb 17 10:32 conf.d -> ../conf.d 68 -rw-r--r-- 1 root root 65780 Mar 26 15:48 php.ini /etc/php5/apache2# grep -i apc php.ini lists no entries. is there any other spot i can check if it's active ? Frank

frankuit avatar Jul 24 '14 10:07 frankuit

I ended up renaming the owncloud folder to v603 (the name doesn't matter), wget the setup-owncloud.php again on the /var/www folder, ran it, setting the install folder to owncloud, then copied the ../config/config.php from the v603 to the new install Once that was done, refreshed the browser and it finally came back up.... That fixed it for me

ccasalicchio avatar Jul 28 '14 02:07 ccasalicchio

closing because I assume it is fixed in 8

karlitschek avatar Mar 24 '15 20:03 karlitschek