You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Failed to update Calendar app (Upgrade 5.0.7 -> 5.0.8) #4013
While upgrading from 5.0.7 to 5.0.8 I got the following error msg. I didn't have any issues with calendar app so far. How to fix it?
Aktualisiere ownCloud auf Version 5.0.8. Dies könnte eine Weile dauern.
Turned on maintenance mode
Updated database
Failed to update Calendar app: Failed to update database structure (MDB2 Error: unknown error, _doQuery: [Error message: Could not execute statement] [Last executed query: ALTER TABLE oc_calendar_objects RENAME TO oc_clndr_objects, CHANGE idid INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, CHANGE calendaridcalendarid INT UNSIGNED DEFAULT 0 NOT NULL, CHANGE startdatestartdate DATETIME DEFAULT '1970-01-01 00:00:00', CHANGE enddateenddate DATETIME DEFAULT '1970-01-01 00:00:00'] [Native code: 1068] [Native message: Multiple primary key defined] )
The update was unsuccessful. Please report this issue to the ownCloud community.
Server configuration:
Operating system: Ubuntu 12.04
Web server: Server version: Apache/2.2.22 (Ubuntu), Server built: Mar 8 2013 15:53:13
Database: mysql
PHP version: PHP 5.3.10-1ubuntu3.6
ownCloud version: 5.0.7 (in progress of update to 5.0.8)
You have to rename all owncloud calendar tables from oc_calendar_* to oc_clndr_*. Afterwords you have to update the oc_appconfig table and set configvalue to 0.6.4 where appid is calendar and configkey is installed_version
Is there anything special in your ownCloud.log or apache's error log?
The posted error msg is the only error msg in ownCloud.log since last week.
apache error.log also does not contain more errors than usual:
[Wed Jul 10 22:30:40 2013] [error] [client 127.0.0.1] client denied by server configuration: /var/www/owncloud/data/htaccesstest.txt
[Wed Jul 10 22:30:40 2013] [error] [client 127.0.0.1] File does not exist: /var/www/core
[Wed Jul 10 22:41:24 2013] [error] [client 192.168.5.70] File does not exist: /var/www/favicon.ico
[Wed Jul 10 22:41:24 2013] [error] [client 192.168.5.70] File does not exist: /var/www/favicon.ico
Thanks for providing the necessary database changes. Although I'll have to look closer into the mysql documentation because I've no clue how to do these "simple" changes. I wouldn't mind if someone could post copy'n'paste commands.
Thanks for all your help! I'll report back as soon as possible.
May one last note: I was also hit by issue 999 and did the following commands to solve upgrade issues from 5.0.5 to 5.0.6 (#999 (comment))
Any relation to this database issue?
@georgehrke I did the manual database changes as mentioned by you. At least I tried ;)
That's what I did:
mysql> RENAME TABLE oc_calendar_calendars TO oc_clndr_calendars;
mysql> RENAME TABLE oc_calendar_objects TO oc_clndr_objects;
mysql> RENAME TABLE oc_calendar_repeat TO oc_clndr_repeat;
mysql> RENAME TABLE oc_calendar_share_calendar TO oc_clndr_share_calendar;
mysql> RENAME TABLE oc_calendar_share_event TO oc_clndr_share_event;
mysql> UPDATE oc_appconfig SET configvalue = "0.6.4" WHERE appid = "calendar" AND configkey = "installed_version";
After doing that, I was able to access the webfrontend of owncloud again! On the first view, I would also say that nothing is lost. Thanks again for your quick response and help!!!
The only question which remains is: Why did the update fail in the first step? Why was I able to do a manual database update, but the updater itself failed? Doesn't the updater itself do the same steps?
Your initial post shows the error message "Multiple primary key defined". I've no clue where this error message comes from. Let's see if our DB experts have an idea why this error occurred (ping @DeepDiver1975@butonic)
Maybe I'm repeating myself and I know nothing about mysql, but issue 999 seems to be also related to "Multiple primary key defined". See for example: #999 (comment)
Maybe I'm repeating myself and I know nothing about mysql, but issue 999 seems to be also related to "Multiple primary key defined". See for example: #999
Maybe the cause is the same!?
You are right. It looks like there is most certainly a connection between those two bugs
We had the same issue when updating from 5.0.7 to 5.0.8 using sqlite over ubuntu 12.04 64 bits.
The messages were the following:
Actualizando ownCloud a la versión 5.0.8, esto puede demorar un tiempo.
Turned on maintenance mode
Updated database
Updating filecache, this may take really long...
... 9% done ...
... 18% done ...
... 27% done ...
... 36% done ...
... 45% done ...
... 54% done ...
... 63% done ...
... 72% done ...
... 81% done ...
... 90% done ...
... 100% done ...
Updated filecache
Failed to update Calendar app: Failed to update database structure (MDB2_Schema Error: invalid, it was specified a previous table name ("oc_calendar_repeat") for table "oc_clndr_repeat" that does not exist)
The update was unsuccessful. Please report this issue to the ownCloud community.
I had to roll back to 5.0.7 with the db file used for the update, so please, if maybe we have problems in that side, tell me about them. It seems to work correctly.
I'm having the issues that the calendar app couldnt update. Now I did some renaming (from calendar to cldnr) in phpmyadmin. strange thing with my DB is that it is missing the oc_calendar_share_calendar table.
I'm having the issues that the calendar app couldnt update. Now I did some renaming (from calendar to cldnr) in phpmyadmin. strange thing with my DB is that it is missing the oc_calendar_share_calendar table.
Should I be worried?
Did you had problems with stucking in maintenance mode with earlier versions of owncloud?
That's probably the reason why the table was missing.
If you created oc_calendar_share_calendar for now, there should be no problems with future updates.
Is the content of the table of any concern or can I just use the "create table" in my phpadmin tool to create a table with only one column called "id" (since every table needs to have one column it says).
Is the content of the table of any concern or can I just use the "create table" in my phpadmin tool to create a table with only one column called "id" (since every table needs to have one column it says).
If the database structure is not correct the next update will most certainly fail
The query for creating the oc_calendar_repeat table on MySQL is:
CREATE TABLE oc_calendar_repeat (id INTEGER AUTO_INCREMENT, eventid INTEGER UNSIGNED DEFAULT 0 NOT NULL, calid INTEGER UNSIGNED DEFAULT 0 NOT NULL, startdate DATETIME DEFAULT '1970-01-01 00:00:00', enddate DATETIME DEFAULT '1970-01-01 00:00:00', PRIMARY KEY (id));
And if you get an error about multiple primary keys defined, you probably have to change the query to:
ALTER TABLE oc_calendar_repeat RENAME TO oc_clndr_repeat, CHANGE id id INT UNSIGNED NOT NULL AUTO_INCREMENT;
I’m closing this issue because it has been inactive for a few months. This probably means that the issue is not reproducible or it has been fixed in a newer version.
Activity
VicDeo commentedon Jul 10, 2013
@XueSheng-GIT please update your report according to issue template https://raw.github.com/owncloud/core/master/issue_template.md
karlitschek commentedon Jul 10, 2013
@georgehrke Do you have any idea? any DB schema changes?
georgehrke commentedon Jul 10, 2013
we renamed the database table from oc_calendar_objects to oc_clndr_objects, so it's compatible with oracleDB.
@XueSheng-GIT what db do you use?
XueSheng-GIT commentedon Jul 10, 2013
I've updated the report with my server configuration. I'm using mysql database.
Expected behaviour/Actual behaviour should be obvious.
@georgehrke so I have to repair the database? How to do that?
georgehrke commentedon Jul 10, 2013
Strange
I use Debian wheezy with MySQL and Apache 2.2.22 and my upgrade worked just fine
VicDeo commentedon Jul 10, 2013
@XueSheng-GIT do you have any other tables besides owncloud in that particular database?
XueSheng-GIT commentedon Jul 10, 2013
I've owncloud running in its own guest system. mysql is only used for owncloud (no other databases).
Database setup was done according to:
http://doc.owncloud.org/server/5.0/admin_manual/configuration/configuration_database.html
georgehrke commentedon Jul 10, 2013
You have to rename all owncloud calendar tables from oc_calendar_* to oc_clndr_*. Afterwords you have to update the oc_appconfig table and set configvalue to 0.6.4 where appid is calendar and configkey is installed_version
Is there anything special in your ownCloud.log or apache's error log?
XueSheng-GIT commentedon Jul 10, 2013
The posted error msg is the only error msg in ownCloud.log since last week.
apache error.log also does not contain more errors than usual:
Thanks for providing the necessary database changes. Although I'll have to look closer into the mysql documentation because I've no clue how to do these "simple" changes. I wouldn't mind if someone could post copy'n'paste commands.
Thanks for all your help! I'll report back as soon as possible.
May one last note: I was also hit by issue 999 and did the following commands to solve upgrade issues from 5.0.5 to 5.0.6 (#999 (comment))
Any relation to this database issue?
VicDeo commentedon Jul 10, 2013
Nothing to worry about. Automatic data folder protection works and your host has no favicon.ico in the root directory (it is in core/img/favicon.png)
XueSheng-GIT commentedon Jul 11, 2013
@georgehrke I did the manual database changes as mentioned by you. At least I tried ;)
That's what I did:
After doing that, I was able to access the webfrontend of owncloud again! On the first view, I would also say that nothing is lost. Thanks again for your quick response and help!!!
The only question which remains is: Why did the update fail in the first step? Why was I able to do a manual database update, but the updater itself failed? Doesn't the updater itself do the same steps?
georgehrke commentedon Jul 11, 2013
Your initial post shows the error message "Multiple primary key defined". I've no clue where this error message comes from. Let's see if our DB experts have an idea why this error occurred (ping @DeepDiver1975 @butonic)
XueSheng-GIT commentedon Jul 11, 2013
Maybe I'm repeating myself and I know nothing about mysql, but issue 999 seems to be also related to "Multiple primary key defined". See for example: #999 (comment)
Maybe the cause is the same!?
georgehrke commentedon Jul 11, 2013
You are right. It looks like there is most certainly a connection between those two bugs
omarwllorente commentedon Jul 11, 2013
Hi!
We had the same issue when updating from 5.0.7 to 5.0.8 using sqlite over ubuntu 12.04 64 bits.
The messages were the following:
Actualizando ownCloud a la versión 5.0.8, esto puede demorar un tiempo.
Turned on maintenance mode
Updated database
Updating filecache, this may take really long...
... 9% done ...
... 18% done ...
... 27% done ...
... 36% done ...
... 45% done ...
... 54% done ...
... 63% done ...
... 72% done ...
... 81% done ...
... 90% done ...
... 100% done ...
Updated filecache
Failed to update Calendar app: Failed to update database structure (MDB2_Schema Error: invalid, it was specified a previous table name ("oc_calendar_repeat") for table "oc_clndr_repeat" that does not exist)
The update was unsuccessful. Please report this issue to the ownCloud community.
I had to roll back to 5.0.7 with the db file used for the update, so please, if maybe we have problems in that side, tell me about them. It seems to work correctly.
Thanks for the efforts.
Omar
10 remaining items
eggithub commentedon Jul 17, 2013
hi there,
I'm having the issues that the calendar app couldnt update. Now I did some renaming (from calendar to cldnr) in phpmyadmin. strange thing with my DB is that it is missing the oc_calendar_share_calendar table.
Should I be worried?
georgehrke commentedon Jul 17, 2013
Did you had problems with stucking in maintenance mode with earlier versions of owncloud?
eggithub commentedon Jul 17, 2013
I can remember one maybe two times.not sure it was in 4 or 5. however I am able to share calendars...
georgehrke commentedon Jul 17, 2013
That's probably the reason why the table was missing.
If you created oc_calendar_share_calendar for now, there should be no problems with future updates.
eggithub commentedon Jul 17, 2013
but shouldnt it be named oc_clndr_share_calendar now? or do you mean, first create then rename to new convention?
oh and perhaps do you have the query for me? my pretty much a noob at this
georgehrke commentedon Jul 17, 2013
yes, it should
eggithub commentedon Jul 17, 2013
Is the content of the table of any concern or can I just use the "create table" in my phpadmin tool to create a table with only one column called "id" (since every table needs to have one column it says).
thanx
georgehrke commentedon Jul 17, 2013
If the database structure is not correct the next update will most certainly fail
eggithub commentedon Jul 17, 2013
could you provide me with the query to create the table with the right content?
georgehrke commentedon Jul 17, 2013
eggithub commentedon Jul 17, 2013
Thanx mate, didnt work at first but figured it out (had to lose the double quotes).
you're an angel.
diederikdehaas commentedon Dec 12, 2013
The query for creating the oc_calendar_repeat table on MySQL is:
CREATE TABLE oc_calendar_repeat (id INTEGER AUTO_INCREMENT, eventid INTEGER UNSIGNED DEFAULT 0 NOT NULL, calid INTEGER UNSIGNED DEFAULT 0 NOT NULL, startdate DATETIME DEFAULT '1970-01-01 00:00:00', enddate DATETIME DEFAULT '1970-01-01 00:00:00', PRIMARY KEY (id));
And if you get an error about multiple primary keys defined, you probably have to change the query to:
ALTER TABLE oc_calendar_repeat RENAME TO oc_clndr_repeat, CHANGE id id INT UNSIGNED NOT NULL AUTO_INCREMENT;
HTH
jancborchardt commentedon Feb 26, 2014
I’m closing this issue because it has been inactive for a few months. This probably means that the issue is not reproducible or it has been fixed in a newer version.
Please reopen if you still encounter this issue with the latest stable version and then please use the issue template. You an also contribute directly by providing a patch – see the developer manual. :)
Thank you!